PluginProbe ʕ •ᴥ•ʔ
Brevo – Email, SMS, Web Push, Chat, and more. / 3.1.52
Brevo – Email, SMS, Web Push, Chat, and more. v3.1.52
2.9.13 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.2 3.1.20 3.1.21 3.1.22 3.1.23 3.1.24 3.1.25 3.1.26 3.1.27 3.1.28 3.1.29 3.1.3 3.1.30 3.1.31 3.1.32 3.1.33 3.1.34 3.1.35 3.1.36 3.1.37 3.1.38 3.1.39 3.1.4 3.1.40 3.1.41 3.1.42 3.1.43 3.1.44 3.1.45 3.1.46 3.1.47 3.1.48 3.1.49 3.1.5 3.1.50 3.1.51 3.1.52 3.1.53 3.1.54 3.1.55 3.1.56 3.1.57 3.1.58 3.1.59 3.1.6 3.1.60 3.1.61 3.1.62 3.1.63 3.1.64 3.1.65 3.1.66 3.1.67 3.1.68 3.1.69 3.1.7 3.1.70 3.1.71 3.1.72 3.1.73 3.1.74 3.1.75 3.1.76 3.1.77 3.1.78 3.1.79 3.1.8 3.1.80 3.1.81 3.1.82 3.1.83 3.1.84 3.1.85 3.1.86 3.1.87 3.1.88 3.1.89 3.1.9 3.1.90 3.1.91 3.1.92 3.1.93 3.1.94 3.1.95 3.1.96 3.1.97 3.1.98 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 trunk 1.0 1.5 2.0.8 2.9.10 2.9.11 2.9.12
mailin / scripts / service-worker-prod.php
mailin / scripts Last commit date
service-worker-prod.php 4 years ago service-worker-staging.php 4 years ago
service-worker-prod.php
245 lines
1 "use strict";
2
3 function _classCallCheck(t, e) {
4 if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
5 }
6
7 function _defineProperties(t, e) {
8 for (var n = 0; n < e.length; n++) {
9 var i = e[n];
10 i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i)
11 }
12 }
13
14 function _createClass(t, e, n) {
15 return e && _defineProperties(t.prototype, e), n && _defineProperties(t, n), Object.defineProperty(t, "prototype", {
16 writable: !1
17 }), t
18 }
19 self.PUSHOWL_SERVICE_WORKER_VERSION = "2.2";
20 var ErrorHelper = function() {
21 var e = "https://sentry.io/api/1891871/store/?sentry_version=7&sentry_key=0df575aa94e3419782416c33a46d9dd7";
22
23 function i(t) {
24 (t = t || {}).poServiceWorkerVersion = self.PUSHOWL_SERVICE_WORKER_VERSION;
25 var e = (new Date).toISOString().split(".")[0];
26 return {
27 event_id: "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(t) {
28 var e = 16 * Math.random() | 0;
29 return ("x" === t ? e : 3 & e | 8).toString(16)
30 }),
31 logger: "cdn-service-worker",
32 platform: "javascript",
33 timestamp: e,
34 extra: t,
35 release: "de87afe"
36 }
37 }
38
39 function r(t) {
40 return fetch(e, {
41 method: "post",
42 mode: "no-cors",
43 headers: {
44 "Content-Type": "application/json"
45 },
46 body: JSON.stringify(t)
47 })
48 }
49
50 function a(t, e) {
51 (e = e || {}).errorDump = {
52 str: String(t),
53 stack: t && t.stack
54 };
55 var n = i(e);
56 return n.exception = ((t = ((e = t).stack || "").split("\n").map(function(t) {
57 return t.trim()
58 }).filter(function(t) {
59 return t.startsWith("at")
60 }).map(function(t) {
61 var e = "",
62 n = 0,
63 i = 0,
64 r = "",
65 t = t.split(/[ ]+/);
66 return "at" === t[0].trim() && 1 < t.length && (1 < (t = (2 < t.length ? (e = t[1], t[2]) : t[1]).replace("(", "").replace(")", "").split(":")).length && (n = t[t.length - 1], i = t[t.length - 2], r = t.slice(0, t.length - 2).join(":"))), {
67 in_app: !0,
68 function: e,
69 colno: Number(n) || n,
70 lineno: Number(i) || i,
71 filename: r
72 }
73 })).reverse(), {
74 values: [{
75 type: e.name || "Error",
76 value: e.message || String(e),
77 stacktrace: {
78 frames: t
79 }
80 }]
81 }), r(n)
82 }
83 return {
84 log: function(t, e) {
85 return (e = i(e)).message = t, r(e)
86 },
87 logException: a,
88 withErrorReporting: function(t) {
89 return function(e) {
90 if (!e || !e.waitUntil) throw new Error("withErrorReporting should only be used for handlers that receive ExtendableEvent");
91 try {
92 return t(e)
93 } catch (t) {
94 var n = a(t, {
95 eventData: e && e.data && e.data.json()
96 });
97 e.waitUntil(n)
98 }
99 }
100 }
101 }
102 }();
103 ! function() {
104 var e = console,
105 o = new(function() {
106 function e(t) {
107 t = t.maxNetworkRetries;
108 _classCallCheck(this, e), this.maxNetworkRetries = t
109 }
110 return _createClass(e, [{
111 key: "payloadTransformation",
112 value: function(e) {
113 var t = e.title,
114 n = [],
115 i = e.actions;
116 if (i)
117 for (var r = 0; r < i.length; r++) {
118 var a = {
119 action: "action" + r,
120 title: i[r].title
121 };
122 n.push(a)
123 }
124 var o = !("require_interaction" in e) || e.require_interaction,
125 c = {
126 body: e.description || "",
127 tag: e.tag || e.id,
128 actions: n,
129 requireInteraction: o,
130 data: e
131 };
132 return ["icon", "badge", "image"].forEach(function(t) {
133 e[t] && (c[t] = e[t])
134 }), {
135 title: t,
136 config: c
137 }
138 }
139 }, {
140 key: "processPush",
141 value: function(t) {
142 if (this.payload = t.data.json().data, !this.payload || "pushowl" !== this.payload.app) return Promise.resolve();
143 var e = this.payloadTransformation(this.payload),
144 t = e.title,
145 e = e.config,
146 t = this.displayNotification(t, e),
147 e = this.payload.delivery_acknowledgement_url,
148 e = this.update(e);
149 return Promise.all([e, t])
150 }
151 }, {
152 key: "displayNotification",
153 value: function(t, e) {
154 return self.registration.showNotification(t, e)
155 }
156 }, {
157 key: "update",
158 value: function(t) {
159 var r = this,
160 a = 1;
161 return new Promise(function(i, e) {
162 (function n() {
163 fetch(t, {
164 method: "POST",
165 headers: {
166 "Content-Type": "text/plain"
167 }
168 }).then(function(t) {
169 var e = Math.min(8e3, 1e3 * Math.pow(2, a));
170 429 === t.status && a++ <= r.maxNetworkRetries ? setTimeout(n, e) : i(t)
171 }).catch(function(t) {
172 return e(t)
173 })
174 })()
175 })
176 }
177 }, {
178 key: "openLink",
179 value: function(i) {
180 i && clients.matchAll({
181 type: "window"
182 }).then(function(t) {
183 for (var e = 0; e < t.length; e++) {
184 var n = t[e];
185 if (n.url === i && "focus" in n) return n.focus()
186 }
187 if (clients.openWindow) return clients.openWindow(i)
188 })
189 }
190 }], [{
191 key: "version",
192 get: function() {
193 return self.PUSHOWL_SERVICE_WORKER_VERSION
194 }
195 }]), e
196 }())({
197 maxNetworkRetries: 5
198 });
199 self.addEventListener("install", function(t) {
200 t.waitUntil(self.skipWaiting())
201 }), self.addEventListener("activate", function(t) {
202 t.waitUntil(self.clients.claim())
203 }), self.addEventListener("push", ErrorHelper.withErrorReporting(function(t) {
204 if (self.Notification && "granted" === self.Notification.permission) {
205 if (!t.data) throw new Error("Empty event data.");
206 var e = o.processPush(t);
207 t.waitUntil(e)
208 }
209 })), self.addEventListener("notificationclick", function(n) {
210 var i, t, e = n.notification,
211 r = e.data;
212 try {
213 i = r.redirect_url, a = r.click_acknowledgement_url, t = "body", n.action && (n.action.includes("action0") ? (i = r.actions[0].redirect_url, t = "cta1") : n.action.includes("action1") && (i = r.actions[1].redirect_url, t = "cta2"))
214 } catch (t) {
215 ErrorHelper.logException(t, e ? {
216 notification: {
217 title: e.title,
218 data: e.data,
219 actions: e.actions
220 }
221 } : void 0)
222 }
223 e = new Promise(function(t, e) {
224 n.notification.close(), o.openLink(i), t()
225 });
226 a += "&clicked_component=" + t;
227 var a = Promise.all([e, o.update(a)]);
228 n.waitUntil(a)
229 }), self.addEventListener("message", function(t) {
230 var e = o.payloadTransformation(t.data),
231 n = e.title,
232 e = e.config;
233 n && t.waitUntil(o.displayNotification(n, e))
234 }), self.addEventListener("notificationclose", function(i) {
235 i.waitUntil(new Promise(function(t, e) {
236 var n = i.notification.data.close_acknowledgement_url;
237 o.update(n).then(function() {
238 t()
239 }).catch(function() {})
240 }))
241 }), self.addEventListener("error", function(t) {
242 ErrorHelper.logException(t.error), e.error(t.filename, t.lineno, t.colno, t.message)
243 })
244 }();
245