choco-one-click-payment 1.1.46 → 1.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +565 -534
- package/dist/index.js +11 -11
- package/index.d.ts +13 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.choco-one-click-widget{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999;font-family:Sirius,sans-serif;--choco-widget-accent-color: #2F2F2F;pointer-events:none}.choco-one-click-widget--embedded{position:static;top:auto;left:auto;right:auto;bottom:auto;z-index:auto;pointer-events:auto;min-height:1px}.choco-one-click-widget--embedded .choco-widget-bottom-bar{position:static;box-shadow:none;border-radius:24px}.choco-one-click-widget--embedded .choco-widget-payment-sheet{position:fixed}.choco-one-click-widget *{box-sizing:border-box;font-family:Sirius,sans-serif}.choco-one-click-widget .choco-widget-bottom-bar{opacity:0;transform:translateY(16px)}.choco-one-click-widget .choco-widget-balance-section,.choco-one-click-widget .choco-widget-payment-info{opacity:0;transform:translateY(8px)}.choco-one-click-widget--visible .choco-widget-bottom-bar,.choco-one-click-widget--visible .choco-widget-balance-section,.choco-one-click-widget--visible .choco-widget-payment-info{opacity:1;transform:translateY(0)}.choco-widget-bottom-bar{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;padding:16px;box-shadow:0 -4px 20px #0000001a;transition:transform .24s cubic-bezier(.4,0,.2,1),opacity .2s ease;pointer-events:auto}.choco-widget-payment-info{display:flex;flex-direction:column;gap:12px;align-items:stretch;transition:transform .22s ease,opacity .2s ease}.choco-widget-payment-info-main{display:flex;gap:12px;align-items:center}.choco-widget-payment-method{gap:12px;background:#f1f2f7;border-radius:16px;padding:5px 8px;cursor:pointer;transition:background .2s ease;border:none;font-family:inherit;text-align:left;width:100%;position:relative;height:46px}.choco-widget-payment-method:disabled{cursor:not-allowed;pointer-events:none;opacity:.5}.choco-widget-payment-method.google_pay,.choco-widget-payment-method.apple_pay{max-width:140px}.choco-widget-method-icon-placeholder{font-size:24px}.choco-widget-method-details{flex:1}.choco-widget-method-label{font-size:14px;color:#000}.choco-widget-method-value{font-size:14px;font-weight:600;color:#000;display:flex;align-items:center;gap:4px}.choco-widget-method-icon-wrapper svg{display:block;width:100%;max-width:29px;max-height:18px;margin-top:2px}.choco-widget-method-icon-wrapper:empty{display:none}.choco-widget-method-icon-wrapper.google_pay svg{height:17px;max-width:35px;border:1px solid #3C4043;padding:3px 4px 2px;border-radius:8px}.choco-widget-method-name{font-size:14px;font-weight:700}.choco-widget-method-name.google_pay,.choco-widget-method-name.apple_pay{display:none}.choco-widget-method-chevron{position:absolute;right:5px;top:0;bottom:0;margin:auto 0;width:24px;height:24px}.choco-widget-freedom-card-btn{width:100%;height:46px;padding:0 13px;background:linear-gradient(to right,#17678d,#00ca82);border:none;border-radius:16px;font-size:16px;font-weight:700;font-family:inherit;color:#fff;cursor:pointer}.choco-widget-freedom-card-btn:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button{background:var(--choco-widget-accent-color);color:#fff;border:none;border-radius:16px;height:46px;padding:0 16px;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap;width:100%;overflow:hidden}.choco-widget-pay-button--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-pay-button--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-pay-button--loading:after{content:"";display:block;width:100%;height:100%;background:#2f2f2f;position:absolute;left:0;top:0}.choco-widget-pay-button:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button--hidden{display:none}.choco-widget-google-pay-amount{min-width:124px;height:46px;display:flex;flex-direction:column;justify-content:center;text-align:right;width:100%}.choco-widget-google-pay-amount--hidden{display:none}.choco-widget-google-pay-amount-label{font-size:20px;font-weight:700;line-height:24px;color:#1d1d1d}.choco-widget-google-pay-amount-value{font-size:14px;line-height:18px;color:#1d1d1d;white-space:nowrap;opacity:.5}.choco-widget-google-pay-amount-value--hidden{display:none}.choco-widget-google-pay-amount-value-number{text-decoration:line-through}.choco-widget-google-pay-row--hidden{display:none}.choco-widget-wallet-blocked{pointer-events:none;opacity:.6}.choco-widget-google-pay-button-slot{width:100%}.choco-widget-google-pay-button-slot>button{width:100%!important;height:52px;min-height:52px;border-radius:12px!important;font-size:16px!important}.choco-widget-apple-pay-row--hidden{display:none}.choco-widget-apple-pay-button-slot{width:100%}.choco-widget-apple-pay-button-wrapper{position:relative;width:100%;height:52px}.choco-widget-apple-pay-button{width:100%;height:52px;min-height:52px;border:0;border-radius:12px;cursor:pointer;background:#000;color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 16px}.choco-widget-apple-pay-button--native{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:52px;opacity:.01;z-index:2}.choco-widget-apple-pay-button-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;background:#000;border-radius:12px;pointer-events:none;z-index:1}.choco-widget-apple-pay-button-text{font-size:16px;line-height:20px;font-weight:600;color:#fff}.choco-widget-apple-pay-button-icon{display:inline-flex;align-items:center;justify-content:center}.choco-widget-payment-sheet{position:absolute;bottom:0;left:0;right:0;top:0;background:#00000080;display:flex;align-items:flex-end;opacity:0;pointer-events:none;transition:opacity .3s ease}.choco-widget-payment-sheet--open{opacity:1;pointer-events:auto}.choco-widget-payment-sheet--open .choco-widget-sheet-content{transform:translateY(0)}.choco-widget-sheet-content{background:#fff;border-radius:24px 24px 0 0;width:100%;max-height:70vh;overflow-y:auto;transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);padding:8px 16px 16px;position:relative;will-change:transform}.choco-widget-sheet-content--dragging{transition:none}.choco-widget-sheet-grabber{flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;margin-bottom:8px;-webkit-user-select:none;user-select:none}.choco-widget-sheet-grabber:active{cursor:grabbing}.choco-widget-sheet-grabber:before{content:"";width:72px;height:6px;background:#e5e5e7;border-radius:42px}.choco-widget-sheet-content{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.choco-widget-sheet-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;position:relative}.choco-widget-sheet-title{font-size:20px;font-weight:700;color:#000;margin:0;flex:1;text-align:center}.choco-widget-payment-sheet--edit .choco-widget-sheet-title{padding-left:30px}.choco-widget-payment-sheet--no-cards .choco-widget-sheet-title{padding-right:30px}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-title{padding:0}.choco-widget-sheet-button{background:none;border:none;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.choco-widget-sheet-button svg{color:#000}.choco-widget-sheet-delete-confirm{display:none;padding-top:16px}.choco-widget-payment-sheet--delete-confirm .choco-widget-payment-methods,.choco-widget-payment-sheet--delete-confirm .choco-widget-cashback-section{display:none!important}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-delete-confirm{display:block}.choco-widget-sheet-delete-confirm-text{margin:0 0 24px;font-size:16px;line-height:1.4;color:#242424;text-align:center}.choco-widget-sheet-delete-confirm-actions{display:flex;gap:12px}.choco-widget-delete-confirm-btn{flex:1;padding:14px 20px;font-size:16px;font-weight:600;font-family:inherit;border-radius:16px;border:none;cursor:pointer;transition:background .2s ease,opacity .2s ease}.choco-widget-delete-confirm-btn--cancel{background:#f1f2f7;color:#242424}.choco-widget-delete-confirm-btn--delete{background:var(--choco-widget-accent-color);color:#fff}.choco-widget-delete-confirm-btn--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-sheet-delete-confirm-actions.choco-widget-sheet-delete-confirm-actions--loading .choco-widget-delete-confirm-btn{pointer-events:none;cursor:not-allowed;opacity:.7}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:after{content:"";display:block;width:100%;height:100%;background:#cc3434;position:absolute;left:0;top:0;border-radius:16px}.choco-widget-add-card-sheet{align-items:stretch}.choco-widget-add-card-sheet .choco-widget-add-card-sheet-content{max-height:none;height:100%;display:flex;flex-direction:column;transform:none;border-radius:0;padding:0}.choco-widget-add-card-sheet--open .choco-widget-add-card-sheet-content{transform:none}.choco-widget-add-card-sheet .choco-widget-sheet-header{flex-shrink:0;margin-bottom:0;padding:12px 0;border-bottom:1px solid #eee}.choco-widget-add-card-iframe-wrapper{flex:1;min-height:0;background:#fff}.choco-widget-add-card-iframe{width:100%;height:100%;border:none;display:block}.choco-widget-balance-section{margin-bottom:12px;padding:12px 8px;background:#f1f2f7;border-radius:12px;transition:transform .22s ease,opacity .2s ease}.choco-widget-balance-section.disabled{opacity:.5;pointer-events:none}.choco-widget-balance-toggle{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding:4px 0}.choco-widget-balance-toggle:last-child{margin-bottom:0}.choco-widget-balance-toggle--disabled{opacity:.5;pointer-events:none}.choco-widget-balance-info{display:flex;align-items:center;gap:12px}.choco-widget-balance-text{display:flex;flex-direction:column}.choco-widget-balance-label-wrapper{display:flex;align-items:center;gap:8px}.choco-widget-balance-label{font-size:16px;font-weight:500}.choco-widget-balance-sublabel{font-size:12px;color:#767485;margin-top:2px}.choco-widget-balance-icon{width:22px;height:22px}.choco-widget-balance-amount{font-size:16px;font-weight:500;color:#000;white-space:nowrap}.choco-widget-toggle{position:relative;display:inline-block;width:42px;height:26px}.choco-widget-toggle input{opacity:0;width:0;height:0}.choco-widget-toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#d4d3df;transition:.3s;border-radius:28px}.choco-widget-toggle-slider:before{position:absolute;content:"";height:22px;width:22px;left:2px;bottom:0;top:0;margin:auto;background-color:#fff;transition:.3s;border-radius:50%}.choco-widget-toggle input:checked+.choco-widget-toggle-slider{background-color:var(--choco-widget-accent-color)}.choco-widget-toggle input:checked+.choco-widget-toggle-slider:before{transform:translate(16px)}.choco-widget-cashback-section{margin-top:20px;padding-top:20px;border-top:1px solid #f0f0f0}.choco-widget-cashback-info{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#fff5ee;border-radius:12px;font-size:14px;color:#ff6b00}.choco-widget-cashback-icon{font-size:20px}.choco-widget-cashback-text strong{font-weight:700}.choco-widget-payment-methods{display:flex;flex-direction:column;gap:8px}.choco-widget-method-item{display:flex;align-items:center;gap:12px;padding:10px 0;cursor:pointer;transition:all .2s ease;border:2px solid transparent;width:100%;border:0;background:none;text-align:left;font-family:inherit;font-size:inherit}.choco-widget-method-item-icon-wrapper{width:37px}.choco-widget-method-item-icon-wrapper svg{display:block;width:100%;max-width:29px;height:29px;margin:0 auto}.choco-widget-method-item-icon-wrapper.google_pay{outline:1px solid #3C4043;padding:3px 5px 2px;border-radius:15px}.choco-widget-method-item-icon-wrapper.google_pay svg{height:15px;max-width:29px}.choco-widget-method-item-label{flex:1;font-size:16px;color:#000}.choco-widget-method-item-check,.choco-widget-method-item-trash-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;margin:-6px 0 -6px 6px;background:none;border:none;cursor:pointer;border-radius:8px;-webkit-tap-highlight-color:transparent}.choco-widget-method-item-check{height:30px;width:30px}.choco-widget-method-item-trash-btn:hover{background:#cc343414}.choco-widget-method-item-trash{flex-shrink:0;width:20px;height:20px}.choco-widget-bottom-bar-prerender{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -4px 20px #0000001a;transition:transform .3s cubic-bezier(.4,0,.2,1);height:78px}.choco-widget-payment-loading{width:30px;height:30px;animation:choco-spin 1s linear infinite;border:3px solid var(--choco-widget-accent-color);border-top:3px solid transparent;border-radius:50%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}@keyframes choco-spin{to{transform:rotate(360deg)}}@keyframes choco-fade-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@media(max-width:768px){.choco-widget-bottom-bar{padding:16px 16px 20px}.choco-widget-sheet-content{max-height:80vh}.choco-widget-sheet-title{font-size:18px}.choco-widget-method-item-label{font-size:17px}}@media(max-width:768px)and (min-height:812px){.choco-widget-bottom-bar,.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom,20px))}}@supports (padding: env(safe-area-inset-bottom)){.choco-widget-bottom-bar{padding-bottom:calc(16px + env(safe-area-inset-bottom))}.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom))}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
const
|
|
2
|
+
const br = {
|
|
3
3
|
ru: {
|
|
4
4
|
paymentMethod: "Способ оплаты",
|
|
5
5
|
selectMethod: "Выберите метод",
|
|
@@ -156,51 +156,51 @@ const mr = {
|
|
|
156
156
|
errorWidgetInit: "ვიჯეტის ინიციალიზაციის შეცდომა",
|
|
157
157
|
errorPaymentProcess: "გადახდის შეცდომა"
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, Er = {
|
|
160
160
|
KZT: "₸",
|
|
161
161
|
GEL: "₾"
|
|
162
162
|
};
|
|
163
|
-
function
|
|
163
|
+
function vr(e) {
|
|
164
164
|
return e === "production" ? "https://api-proxy.choco.kz" : "https://api-proxy.chocodev.kz";
|
|
165
165
|
}
|
|
166
166
|
let Le;
|
|
167
|
-
const
|
|
168
|
-
function
|
|
167
|
+
const Ir = new Uint8Array(16);
|
|
168
|
+
function Br() {
|
|
169
169
|
if (!Le && (Le = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Le))
|
|
170
170
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
171
|
-
return Le(
|
|
171
|
+
return Le(Ir);
|
|
172
172
|
}
|
|
173
173
|
const H = [];
|
|
174
174
|
for (let e = 0; e < 256; ++e)
|
|
175
175
|
H.push((e + 256).toString(16).slice(1));
|
|
176
|
-
function
|
|
176
|
+
function Sr(e, t = 0) {
|
|
177
177
|
return H[e[t + 0]] + H[e[t + 1]] + H[e[t + 2]] + H[e[t + 3]] + "-" + H[e[t + 4]] + H[e[t + 5]] + "-" + H[e[t + 6]] + H[e[t + 7]] + "-" + H[e[t + 8]] + H[e[t + 9]] + "-" + H[e[t + 10]] + H[e[t + 11]] + H[e[t + 12]] + H[e[t + 13]] + H[e[t + 14]] + H[e[t + 15]];
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
randomUUID:
|
|
179
|
+
const _r = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Yt = {
|
|
180
|
+
randomUUID: _r
|
|
181
181
|
};
|
|
182
|
-
function
|
|
182
|
+
function Ze(e, t, n) {
|
|
183
183
|
if (Yt.randomUUID && !e)
|
|
184
184
|
return Yt.randomUUID();
|
|
185
185
|
e = e || {};
|
|
186
|
-
const r = e.random || (e.rng ||
|
|
187
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
186
|
+
const r = e.random || (e.rng || Br)();
|
|
187
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Sr(r);
|
|
188
188
|
}
|
|
189
189
|
const Vt = "choco_device_id";
|
|
190
190
|
function $(e, t = "ru", n = "KZT") {
|
|
191
191
|
const r = Number(e), o = t === "ru" ? "ru-RU" : "en-US";
|
|
192
|
-
return `${r.toLocaleString(o)} ${
|
|
192
|
+
return `${r.toLocaleString(o)} ${Er[n]}`;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Nn() {
|
|
195
195
|
let e = localStorage.getItem(Vt);
|
|
196
|
-
return e || (e =
|
|
196
|
+
return e || (e = Ze(), localStorage.setItem(Vt, e)), e;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function qe() {
|
|
199
199
|
if (typeof window > "u") return !1;
|
|
200
200
|
const e = window.safari !== void 0, t = window.navigator.userAgent || "", n = !!t.match(/iPad/i) || !!t.match(/iPhone/i), r = !!t.match(/WebKit/i), o = n && r && !t.match(/CriOS/i);
|
|
201
201
|
return e || o;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Dn() {
|
|
204
204
|
if (typeof navigator > "u") return 0;
|
|
205
205
|
const e = navigator.userAgent || "", t = e.indexOf("OS");
|
|
206
206
|
return (e.indexOf("iPhone") > -1 || e.indexOf("iPad") > -1) && t > -1 ? Number(e.substring(t + 3, t + 6).replace("_", ".")) : 0;
|
|
@@ -211,25 +211,25 @@ function Lt() {
|
|
|
211
211
|
const e = (navigator.userAgent || navigator.vendor || "").toLowerCase(), t = (navigator.platform || "").toLowerCase(), n = (((i = navigator.userAgentData) == null ? void 0 : i.platform) || "").toLowerCase(), r = `${e} ${t} ${n}`;
|
|
212
212
|
return /iphone|ipad|ipod/.test(r) || r.includes("macintosh") && typeof document < "u" && "ontouchend" in document ? "ios" : r.includes("android") ? "android" : r.includes("windows") ? "windows" : r.includes("mac") ? "macos" : "other";
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function ze() {
|
|
215
215
|
if (typeof navigator > "u") return !1;
|
|
216
216
|
const e = navigator.userAgentData;
|
|
217
217
|
return e != null && e.platform && ["iOS", "iPadOS"].includes(e.platform) || Lt() === "ios" ? !0 : (navigator.userAgent || "").includes("Macintosh") && typeof document < "u" && "ontouchend" in document;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function Ke(e) {
|
|
220
220
|
if (typeof sessionStorage > "u") return !1;
|
|
221
221
|
const t = e === "apple_pay" ? "disableApplePay" : e === "google_pay" ? "disableGooglePay" : null;
|
|
222
222
|
return t ? sessionStorage.getItem(t) === "true" : !1;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Qr(e) {
|
|
225
225
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
226
226
|
}
|
|
227
|
-
var Fe = { exports: {} },
|
|
228
|
-
function
|
|
227
|
+
var Fe = { exports: {} }, kr = Fe.exports, Zt;
|
|
228
|
+
function Pr() {
|
|
229
229
|
return Zt || (Zt = 1, (function(e, t) {
|
|
230
230
|
(function(r, o) {
|
|
231
231
|
e.exports = o();
|
|
232
|
-
})(
|
|
232
|
+
})(kr, function() {
|
|
233
233
|
return (
|
|
234
234
|
/******/
|
|
235
235
|
(function() {
|
|
@@ -241,16 +241,16 @@ function Qr() {
|
|
|
241
241
|
Object.defineProperty(u, "__esModule", {
|
|
242
242
|
value: !0
|
|
243
243
|
}), u.Centrifuge = void 0;
|
|
244
|
-
var h = I(l(187)), y = I(l(471)),
|
|
244
|
+
var h = I(l(187)), y = I(l(471)), m = l(147), b = l(853);
|
|
245
245
|
function I(g) {
|
|
246
246
|
return g && g.__esModule ? g : { default: g };
|
|
247
247
|
}
|
|
248
248
|
function B(g) {
|
|
249
249
|
"@babel/helpers - typeof";
|
|
250
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? B = function(
|
|
251
|
-
return typeof
|
|
252
|
-
} : B = function(
|
|
253
|
-
return
|
|
250
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? B = function(C) {
|
|
251
|
+
return typeof C;
|
|
252
|
+
} : B = function(C) {
|
|
253
|
+
return C && typeof Symbol == "function" && C.constructor === Symbol && C !== Symbol.prototype ? "symbol" : typeof C;
|
|
254
254
|
}, B(g);
|
|
255
255
|
}
|
|
256
256
|
function Q(g, p) {
|
|
@@ -258,12 +258,12 @@ function Qr() {
|
|
|
258
258
|
throw new TypeError("Cannot call a class as a function");
|
|
259
259
|
}
|
|
260
260
|
function S(g, p) {
|
|
261
|
-
for (var
|
|
262
|
-
var d = p[
|
|
261
|
+
for (var C = 0; C < p.length; C++) {
|
|
262
|
+
var d = p[C];
|
|
263
263
|
d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(g, d.key, d);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
function P(g, p,
|
|
266
|
+
function P(g, p, C) {
|
|
267
267
|
return p && S(g.prototype, p), g;
|
|
268
268
|
}
|
|
269
269
|
function k(g, p) {
|
|
@@ -311,16 +311,16 @@ function Qr() {
|
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
function z(g) {
|
|
314
|
-
return z = Object.setPrototypeOf ? Object.getPrototypeOf : function(
|
|
315
|
-
return
|
|
314
|
+
return z = Object.setPrototypeOf ? Object.getPrototypeOf : function(C) {
|
|
315
|
+
return C.__proto__ || Object.getPrototypeOf(C);
|
|
316
316
|
}, z(g);
|
|
317
317
|
}
|
|
318
318
|
var J = "timeout", M = "connection closed", v = /* @__PURE__ */ (function(g) {
|
|
319
|
-
k(
|
|
320
|
-
var p = L(
|
|
321
|
-
function
|
|
319
|
+
k(C, g);
|
|
320
|
+
var p = L(C);
|
|
321
|
+
function C(d, s) {
|
|
322
322
|
var a;
|
|
323
|
-
return Q(this,
|
|
323
|
+
return Q(this, C), a = p.call(this), a._url = d, a._websocket = null, a._sockjs = null, a._isSockjs = !1, a._xmlhttprequest = null, a._binary = !1, a._methodType = null, a._pushType = null, a._encoder = null, a._decoder = null, a._status = "disconnected", a._reconnect = !0, a._reconnecting = !1, a._transport = null, a._transportName = null, a._transportClosed = !0, a._messageId = 0, a._clientID = null, a._refreshRequired = !1, a._subs = {}, a._serverSubs = {}, a._lastSeq = {}, a._lastGen = {}, a._lastOffset = {}, a._lastEpoch = {}, a._messages = [], a._isBatching = !1, a._isSubscribeBatching = !1, a._privateChannels = {}, a._numRefreshFailed = 0, a._refreshTimeout = null, a._pingTimeout = null, a._pongTimeout = null, a._subRefreshTimeouts = {}, a._retries = 0, a._callbacks = {}, a._latency = null, a._latencyStart = null, a._connectData = null, a._token = null, a._xhrID = 0, a._xhrs = {}, a._dispatchPromise = Promise.resolve(), a._protocol = "", a._config = {
|
|
324
324
|
protocol: "",
|
|
325
325
|
debug: !1,
|
|
326
326
|
name: "js",
|
|
@@ -355,7 +355,7 @@ function Qr() {
|
|
|
355
355
|
disableWithCredentials: !1
|
|
356
356
|
}, a._configure(s), a;
|
|
357
357
|
}
|
|
358
|
-
return P(
|
|
358
|
+
return P(C, [{
|
|
359
359
|
key: "setToken",
|
|
360
360
|
value: function(s) {
|
|
361
361
|
this._token = s;
|
|
@@ -449,7 +449,7 @@ function Qr() {
|
|
|
449
449
|
if (!this._formatOverride(s)) {
|
|
450
450
|
if (s === "protobuf")
|
|
451
451
|
throw new Error("not implemented by JSON only Centrifuge client – use client with Protobuf");
|
|
452
|
-
this._binary = !1, this._methodType =
|
|
452
|
+
this._binary = !1, this._methodType = m.JsonMethodType, this._pushType = m.JsonPushType, this._encoder = new m.JsonEncoder(), this._decoder = new m.JsonDecoder();
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
}, {
|
|
@@ -948,14 +948,14 @@ function Qr() {
|
|
|
948
948
|
}
|
|
949
949
|
var ge = F[s];
|
|
950
950
|
if (ge) {
|
|
951
|
-
var
|
|
951
|
+
var lt = {
|
|
952
952
|
method: a._methodType.SUB_REFRESH,
|
|
953
953
|
params: {
|
|
954
954
|
channel: s,
|
|
955
955
|
token: ge
|
|
956
956
|
}
|
|
957
957
|
}, Te = a._getSub(s);
|
|
958
|
-
Te !== null && a._call(
|
|
958
|
+
Te !== null && a._call(lt).then(function(ne) {
|
|
959
959
|
a._subRefreshResponse(s, a._decoder.decodeCommandResult(a._methodType.SUB_REFRESH, ne.result)), ne.next && ne.next();
|
|
960
960
|
}, function(ne) {
|
|
961
961
|
a._subRefreshError(s, ne.error), ne.next && ne.next();
|
|
@@ -1467,22 +1467,22 @@ function Qr() {
|
|
|
1467
1467
|
s._debug("authorization request failed");
|
|
1468
1468
|
for (var ge in A)
|
|
1469
1469
|
if (A.hasOwnProperty(ge)) {
|
|
1470
|
-
var
|
|
1471
|
-
s._subscribeError(
|
|
1470
|
+
var lt = A[ge];
|
|
1471
|
+
s._subscribeError(lt, s._createErrorObject("authorization request failed"));
|
|
1472
1472
|
}
|
|
1473
1473
|
return;
|
|
1474
1474
|
}
|
|
1475
1475
|
var Te = {};
|
|
1476
1476
|
if (x.data.channels)
|
|
1477
1477
|
for (var ne in x.data.channels) {
|
|
1478
|
-
var
|
|
1479
|
-
|
|
1478
|
+
var At = x.data.channels[ne];
|
|
1479
|
+
At.channel && (Te[At.channel] = At.token);
|
|
1480
1480
|
}
|
|
1481
1481
|
var jt = !1;
|
|
1482
1482
|
s._isBatching || (s.startBatching(), jt = !0);
|
|
1483
1483
|
for (var Jt in A)
|
|
1484
1484
|
if (A.hasOwnProperty(Jt)) {
|
|
1485
|
-
var
|
|
1485
|
+
var Cr = (function() {
|
|
1486
1486
|
var Z = A[Jt], qt = Te[Z];
|
|
1487
1487
|
if (qt) {
|
|
1488
1488
|
var ye = {
|
|
@@ -1497,9 +1497,9 @@ function Qr() {
|
|
|
1497
1497
|
var Kt = zt._needRecover();
|
|
1498
1498
|
if (Kt === !0) {
|
|
1499
1499
|
ye.params.recover = !0;
|
|
1500
|
-
var
|
|
1501
|
-
if (
|
|
1502
|
-
|
|
1500
|
+
var dt = s._getLastSeq(Z), ft = s._getLastGen(Z);
|
|
1501
|
+
if (dt || ft)
|
|
1502
|
+
dt && (ye.params.seq = dt), ft && (ye.params.gen = ft);
|
|
1503
1503
|
else {
|
|
1504
1504
|
var Gt = s._getLastOffset(Z);
|
|
1505
1505
|
Gt && (ye.params.offset = Gt);
|
|
@@ -1515,7 +1515,7 @@ function Qr() {
|
|
|
1515
1515
|
} else
|
|
1516
1516
|
return s._subscribeError(Z, s._createErrorObject("permission denied", 103)), "continue";
|
|
1517
1517
|
})();
|
|
1518
|
-
if (
|
|
1518
|
+
if (Cr === "continue") continue;
|
|
1519
1519
|
}
|
|
1520
1520
|
jt && s.stopBatching();
|
|
1521
1521
|
}
|
|
@@ -1543,7 +1543,7 @@ function Qr() {
|
|
|
1543
1543
|
var E = new y.default(this, s, a);
|
|
1544
1544
|
return this._subs[s] = E, E.subscribe(A), E;
|
|
1545
1545
|
}
|
|
1546
|
-
}]),
|
|
1546
|
+
}]), C;
|
|
1547
1547
|
})(h.default);
|
|
1548
1548
|
u.Centrifuge = v;
|
|
1549
1549
|
})
|
|
@@ -1579,7 +1579,7 @@ function Qr() {
|
|
|
1579
1579
|
function y(Q, S, P) {
|
|
1580
1580
|
return S && h(Q.prototype, S), Q;
|
|
1581
1581
|
}
|
|
1582
|
-
var
|
|
1582
|
+
var m = {
|
|
1583
1583
|
CONNECT: 0,
|
|
1584
1584
|
SUBSCRIBE: 1,
|
|
1585
1585
|
UNSUBSCRIBE: 2,
|
|
@@ -1593,7 +1593,7 @@ function Qr() {
|
|
|
1593
1593
|
REFRESH: 10,
|
|
1594
1594
|
SUB_REFRESH: 11
|
|
1595
1595
|
};
|
|
1596
|
-
u.JsonMethodType =
|
|
1596
|
+
u.JsonMethodType = m;
|
|
1597
1597
|
var b = {
|
|
1598
1598
|
PUBLICATION: 0,
|
|
1599
1599
|
JOIN: 1,
|
|
@@ -1667,38 +1667,38 @@ function Qr() {
|
|
|
1667
1667
|
Object.defineProperty(u, "__esModule", {
|
|
1668
1668
|
value: !0
|
|
1669
1669
|
}), u.default = void 0;
|
|
1670
|
-
var y = b(l(187)),
|
|
1670
|
+
var y = b(l(187)), m = l(853);
|
|
1671
1671
|
function b(p) {
|
|
1672
1672
|
return p && p.__esModule ? p : { default: p };
|
|
1673
1673
|
}
|
|
1674
|
-
function I(p,
|
|
1675
|
-
if (!(p instanceof
|
|
1674
|
+
function I(p, C) {
|
|
1675
|
+
if (!(p instanceof C))
|
|
1676
1676
|
throw new TypeError("Cannot call a class as a function");
|
|
1677
1677
|
}
|
|
1678
|
-
function B(p,
|
|
1679
|
-
for (var d = 0; d <
|
|
1680
|
-
var s =
|
|
1678
|
+
function B(p, C) {
|
|
1679
|
+
for (var d = 0; d < C.length; d++) {
|
|
1680
|
+
var s = C[d];
|
|
1681
1681
|
s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(p, s.key, s);
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
|
-
function Q(p,
|
|
1685
|
-
return
|
|
1684
|
+
function Q(p, C, d) {
|
|
1685
|
+
return C && B(p.prototype, C), p;
|
|
1686
1686
|
}
|
|
1687
|
-
function S(p,
|
|
1688
|
-
if (typeof
|
|
1687
|
+
function S(p, C) {
|
|
1688
|
+
if (typeof C != "function" && C !== null)
|
|
1689
1689
|
throw new TypeError("Super expression must either be null or a function");
|
|
1690
|
-
p.prototype = Object.create(
|
|
1690
|
+
p.prototype = Object.create(C && C.prototype, { constructor: { value: p, writable: !0, configurable: !0 } }), C && P(p, C);
|
|
1691
1691
|
}
|
|
1692
|
-
function P(p,
|
|
1692
|
+
function P(p, C) {
|
|
1693
1693
|
return P = Object.setPrototypeOf || function(s, a) {
|
|
1694
1694
|
return s.__proto__ = a, s;
|
|
1695
|
-
}, P(p,
|
|
1695
|
+
}, P(p, C);
|
|
1696
1696
|
}
|
|
1697
1697
|
function k(p) {
|
|
1698
|
-
var
|
|
1698
|
+
var C = q();
|
|
1699
1699
|
return function() {
|
|
1700
1700
|
var s = D(p), a;
|
|
1701
|
-
if (
|
|
1701
|
+
if (C) {
|
|
1702
1702
|
var A = D(this).constructor;
|
|
1703
1703
|
a = Reflect.construct(s, arguments, A);
|
|
1704
1704
|
} else
|
|
@@ -1706,10 +1706,10 @@ function Qr() {
|
|
|
1706
1706
|
return R(this, a);
|
|
1707
1707
|
};
|
|
1708
1708
|
}
|
|
1709
|
-
function R(p,
|
|
1710
|
-
if (
|
|
1711
|
-
return
|
|
1712
|
-
if (
|
|
1709
|
+
function R(p, C) {
|
|
1710
|
+
if (C && (h(C) === "object" || typeof C == "function"))
|
|
1711
|
+
return C;
|
|
1712
|
+
if (C !== void 0)
|
|
1713
1713
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1714
1714
|
return L(p);
|
|
1715
1715
|
}
|
|
@@ -1735,10 +1735,10 @@ function Qr() {
|
|
|
1735
1735
|
}
|
|
1736
1736
|
var K = 0, z = 1, J = 2, M = 3, v = 4, g = /* @__PURE__ */ (function(p) {
|
|
1737
1737
|
S(d, p);
|
|
1738
|
-
var
|
|
1738
|
+
var C = k(d);
|
|
1739
1739
|
function d(s, a, A) {
|
|
1740
1740
|
var f;
|
|
1741
|
-
return I(this, d), f =
|
|
1741
|
+
return I(this, d), f = C.call(this), f.channel = a, f._centrifuge = s, f._status = K, f._error = null, f._isResubscribe = !1, f._ready = !1, f._subscriptionPromise = null, f._noResubscribe = !1, f._recoverable = !1, f._recover = !1, f._setEvents(A), f._initializePromise(), f._promises = {}, f._promiseId = 0, f._subscribeData = null, f.on("error", function(E) {
|
|
1742
1742
|
this._centrifuge._debug("subscription error", E);
|
|
1743
1743
|
}), f;
|
|
1744
1744
|
}
|
|
@@ -1775,7 +1775,7 @@ function Qr() {
|
|
|
1775
1775
|
key: "_setEvents",
|
|
1776
1776
|
value: function(a) {
|
|
1777
1777
|
if (a) {
|
|
1778
|
-
if ((0,
|
|
1778
|
+
if ((0, m.isFunction)(a))
|
|
1779
1779
|
this.on("publish", a);
|
|
1780
1780
|
else if (Object.prototype.toString.call(a) === Object.prototype.toString.call({}))
|
|
1781
1781
|
for (var A = ["publish", "join", "leave", "unsubscribe", "subscribe", "error"], f = 0, E = A.length; f < E; f++) {
|
|
@@ -1967,14 +1967,14 @@ function Qr() {
|
|
|
1967
1967
|
(function(c, u, l) {
|
|
1968
1968
|
Object.defineProperty(u, "__esModule", {
|
|
1969
1969
|
value: !0
|
|
1970
|
-
}), u.backoff = b, u.errorExists = I, u.extend = B, u.isFunction = y, u.log =
|
|
1970
|
+
}), u.backoff = b, u.errorExists = I, u.extend = B, u.isFunction = y, u.log = m, u.startsWith = h;
|
|
1971
1971
|
function h(Q, S) {
|
|
1972
1972
|
return Q.lastIndexOf(S, 0) === 0;
|
|
1973
1973
|
}
|
|
1974
1974
|
function y(Q) {
|
|
1975
1975
|
return Q == null ? !1 : typeof Q == "function";
|
|
1976
1976
|
}
|
|
1977
|
-
function
|
|
1977
|
+
function m(Q, S) {
|
|
1978
1978
|
if (l.g.console) {
|
|
1979
1979
|
var P = l.g.console[Q];
|
|
1980
1980
|
y(P) && P.apply(l.g.console, S);
|
|
@@ -1998,8 +1998,8 @@ function Qr() {
|
|
|
1998
1998
|
187: (
|
|
1999
1999
|
/***/
|
|
2000
2000
|
(function(c) {
|
|
2001
|
-
var u = typeof Reflect == "object" ? Reflect : null, l = u && typeof u.apply == "function" ? u.apply : function(g, p,
|
|
2002
|
-
return Function.prototype.apply.call(g, p,
|
|
2001
|
+
var u = typeof Reflect == "object" ? Reflect : null, l = u && typeof u.apply == "function" ? u.apply : function(g, p, C) {
|
|
2002
|
+
return Function.prototype.apply.call(g, p, C);
|
|
2003
2003
|
}, h;
|
|
2004
2004
|
u && typeof u.ownKeys == "function" ? h = u.ownKeys : Object.getOwnPropertySymbols ? h = function(g) {
|
|
2005
2005
|
return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g));
|
|
@@ -2009,7 +2009,7 @@ function Qr() {
|
|
|
2009
2009
|
function y(v) {
|
|
2010
2010
|
console && console.warn && console.warn(v);
|
|
2011
2011
|
}
|
|
2012
|
-
var
|
|
2012
|
+
var m = Number.isNaN || function(g) {
|
|
2013
2013
|
return g !== g;
|
|
2014
2014
|
};
|
|
2015
2015
|
function b() {
|
|
@@ -2027,14 +2027,14 @@ function Qr() {
|
|
|
2027
2027
|
return I;
|
|
2028
2028
|
},
|
|
2029
2029
|
set: function(v) {
|
|
2030
|
-
if (typeof v != "number" || v < 0 ||
|
|
2030
|
+
if (typeof v != "number" || v < 0 || m(v))
|
|
2031
2031
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + v + ".");
|
|
2032
2032
|
I = v;
|
|
2033
2033
|
}
|
|
2034
2034
|
}), b.init = function() {
|
|
2035
2035
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
2036
2036
|
}, b.prototype.setMaxListeners = function(g) {
|
|
2037
|
-
if (typeof g != "number" || g < 0 ||
|
|
2037
|
+
if (typeof g != "number" || g < 0 || m(g))
|
|
2038
2038
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + g + ".");
|
|
2039
2039
|
return this._maxListeners = g, this;
|
|
2040
2040
|
};
|
|
@@ -2044,7 +2044,7 @@ function Qr() {
|
|
|
2044
2044
|
b.prototype.getMaxListeners = function() {
|
|
2045
2045
|
return Q(this);
|
|
2046
2046
|
}, b.prototype.emit = function(g) {
|
|
2047
|
-
for (var p = [],
|
|
2047
|
+
for (var p = [], C = 1; C < arguments.length; C++) p.push(arguments[C]);
|
|
2048
2048
|
var d = g === "error", s = this._events;
|
|
2049
2049
|
if (s !== void 0)
|
|
2050
2050
|
d = d && s.error === void 0;
|
|
@@ -2063,11 +2063,11 @@ function Qr() {
|
|
|
2063
2063
|
if (typeof f == "function")
|
|
2064
2064
|
l(f, this, p);
|
|
2065
2065
|
else
|
|
2066
|
-
for (var E = f.length, _ = q(f, E),
|
|
2067
|
-
l(_[
|
|
2066
|
+
for (var E = f.length, _ = q(f, E), C = 0; C < E; ++C)
|
|
2067
|
+
l(_[C], this, p);
|
|
2068
2068
|
return !0;
|
|
2069
2069
|
};
|
|
2070
|
-
function S(v, g, p,
|
|
2070
|
+
function S(v, g, p, C) {
|
|
2071
2071
|
var d, s, a;
|
|
2072
2072
|
if (B(p), s = v._events, s === void 0 ? (s = v._events = /* @__PURE__ */ Object.create(null), v._eventsCount = 0) : (s.newListener !== void 0 && (v.emit(
|
|
2073
2073
|
"newListener",
|
|
@@ -2075,7 +2075,7 @@ function Qr() {
|
|
|
2075
2075
|
p.listener ? p.listener : p
|
|
2076
2076
|
), s = v._events), a = s[g]), a === void 0)
|
|
2077
2077
|
a = s[g] = p, ++v._eventsCount;
|
|
2078
|
-
else if (typeof a == "function" ? a = s[g] =
|
|
2078
|
+
else if (typeof a == "function" ? a = s[g] = C ? [p, a] : [a, p] : C ? a.unshift(p) : a.push(p), d = Q(v), d > 0 && a.length > d && !a.warned) {
|
|
2079
2079
|
a.warned = !0;
|
|
2080
2080
|
var A = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + String(g) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
2081
2081
|
A.name = "MaxListenersExceededWarning", A.emitter = v, A.type = g, A.count = a.length, y(A);
|
|
@@ -2092,45 +2092,45 @@ function Qr() {
|
|
|
2092
2092
|
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
2093
2093
|
}
|
|
2094
2094
|
function k(v, g, p) {
|
|
2095
|
-
var
|
|
2096
|
-
return d.listener = p,
|
|
2095
|
+
var C = { fired: !1, wrapFn: void 0, target: v, type: g, listener: p }, d = P.bind(C);
|
|
2096
|
+
return d.listener = p, C.wrapFn = d, d;
|
|
2097
2097
|
}
|
|
2098
2098
|
b.prototype.once = function(g, p) {
|
|
2099
2099
|
return B(p), this.on(g, k(this, g, p)), this;
|
|
2100
2100
|
}, b.prototype.prependOnceListener = function(g, p) {
|
|
2101
2101
|
return B(p), this.prependListener(g, k(this, g, p)), this;
|
|
2102
2102
|
}, b.prototype.removeListener = function(g, p) {
|
|
2103
|
-
var
|
|
2103
|
+
var C, d, s, a, A;
|
|
2104
2104
|
if (B(p), d = this._events, d === void 0)
|
|
2105
2105
|
return this;
|
|
2106
|
-
if (
|
|
2106
|
+
if (C = d[g], C === void 0)
|
|
2107
2107
|
return this;
|
|
2108
|
-
if (
|
|
2109
|
-
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete d[g], d.removeListener && this.emit("removeListener", g,
|
|
2110
|
-
else if (typeof
|
|
2111
|
-
for (s = -1, a =
|
|
2112
|
-
if (
|
|
2113
|
-
A =
|
|
2108
|
+
if (C === p || C.listener === p)
|
|
2109
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete d[g], d.removeListener && this.emit("removeListener", g, C.listener || p));
|
|
2110
|
+
else if (typeof C != "function") {
|
|
2111
|
+
for (s = -1, a = C.length - 1; a >= 0; a--)
|
|
2112
|
+
if (C[a] === p || C[a].listener === p) {
|
|
2113
|
+
A = C[a].listener, s = a;
|
|
2114
2114
|
break;
|
|
2115
2115
|
}
|
|
2116
2116
|
if (s < 0)
|
|
2117
2117
|
return this;
|
|
2118
|
-
s === 0 ?
|
|
2118
|
+
s === 0 ? C.shift() : D(C, s), C.length === 1 && (d[g] = C[0]), d.removeListener !== void 0 && this.emit("removeListener", g, A || p);
|
|
2119
2119
|
}
|
|
2120
2120
|
return this;
|
|
2121
2121
|
}, b.prototype.off = b.prototype.removeListener, b.prototype.removeAllListeners = function(g) {
|
|
2122
|
-
var p,
|
|
2123
|
-
if (
|
|
2122
|
+
var p, C, d;
|
|
2123
|
+
if (C = this._events, C === void 0)
|
|
2124
2124
|
return this;
|
|
2125
|
-
if (
|
|
2126
|
-
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) :
|
|
2125
|
+
if (C.removeListener === void 0)
|
|
2126
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : C[g] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete C[g]), this;
|
|
2127
2127
|
if (arguments.length === 0) {
|
|
2128
|
-
var s = Object.keys(
|
|
2128
|
+
var s = Object.keys(C), a;
|
|
2129
2129
|
for (d = 0; d < s.length; ++d)
|
|
2130
2130
|
a = s[d], a !== "removeListener" && this.removeAllListeners(a);
|
|
2131
2131
|
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
2132
2132
|
}
|
|
2133
|
-
if (p =
|
|
2133
|
+
if (p = C[g], typeof p == "function")
|
|
2134
2134
|
this.removeListener(g, p);
|
|
2135
2135
|
else if (p !== void 0)
|
|
2136
2136
|
for (d = p.length - 1; d >= 0; d--)
|
|
@@ -2138,10 +2138,10 @@ function Qr() {
|
|
|
2138
2138
|
return this;
|
|
2139
2139
|
};
|
|
2140
2140
|
function R(v, g, p) {
|
|
2141
|
-
var
|
|
2142
|
-
if (
|
|
2141
|
+
var C = v._events;
|
|
2142
|
+
if (C === void 0)
|
|
2143
2143
|
return [];
|
|
2144
|
-
var d =
|
|
2144
|
+
var d = C[g];
|
|
2145
2145
|
return d === void 0 ? [] : typeof d == "function" ? p ? [d.listener || d] : [d] : p ? K(d) : q(d, d.length);
|
|
2146
2146
|
}
|
|
2147
2147
|
b.prototype.listeners = function(g) {
|
|
@@ -2166,8 +2166,8 @@ function Qr() {
|
|
|
2166
2166
|
return this._eventsCount > 0 ? h(this._events) : [];
|
|
2167
2167
|
};
|
|
2168
2168
|
function q(v, g) {
|
|
2169
|
-
for (var p = new Array(g),
|
|
2170
|
-
p[
|
|
2169
|
+
for (var p = new Array(g), C = 0; C < g; ++C)
|
|
2170
|
+
p[C] = v[C];
|
|
2171
2171
|
return p;
|
|
2172
2172
|
}
|
|
2173
2173
|
function D(v, g) {
|
|
@@ -2181,9 +2181,9 @@ function Qr() {
|
|
|
2181
2181
|
return g;
|
|
2182
2182
|
}
|
|
2183
2183
|
function z(v, g) {
|
|
2184
|
-
return new Promise(function(p,
|
|
2184
|
+
return new Promise(function(p, C) {
|
|
2185
2185
|
function d(a) {
|
|
2186
|
-
v.removeListener(g, s),
|
|
2186
|
+
v.removeListener(g, s), C(a);
|
|
2187
2187
|
}
|
|
2188
2188
|
function s() {
|
|
2189
2189
|
typeof v.removeListener == "function" && v.removeListener("error", d), p([].slice.call(arguments));
|
|
@@ -2194,12 +2194,12 @@ function Qr() {
|
|
|
2194
2194
|
function J(v, g, p) {
|
|
2195
2195
|
typeof v.on == "function" && M(v, "error", g, p);
|
|
2196
2196
|
}
|
|
2197
|
-
function M(v, g, p,
|
|
2197
|
+
function M(v, g, p, C) {
|
|
2198
2198
|
if (typeof v.on == "function")
|
|
2199
|
-
|
|
2199
|
+
C.once ? v.once(g, p) : v.on(g, p);
|
|
2200
2200
|
else if (typeof v.addEventListener == "function")
|
|
2201
2201
|
v.addEventListener(g, function d(s) {
|
|
2202
|
-
|
|
2202
|
+
C.once && v.removeEventListener(g, d), p(s);
|
|
2203
2203
|
});
|
|
2204
2204
|
else
|
|
2205
2205
|
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof v);
|
|
@@ -2240,8 +2240,8 @@ function Qr() {
|
|
|
2240
2240
|
});
|
|
2241
2241
|
})(Fe)), Fe.exports;
|
|
2242
2242
|
}
|
|
2243
|
-
var
|
|
2244
|
-
const
|
|
2243
|
+
var wr = Pr();
|
|
2244
|
+
const Tr = /* @__PURE__ */ Qr(wr);
|
|
2245
2245
|
let Re = null;
|
|
2246
2246
|
function $t(e, t) {
|
|
2247
2247
|
if (!(e != null && e.client_url) || !(e != null && e.token) || !(e != null && e.channel))
|
|
@@ -2256,13 +2256,13 @@ function $t(e, t) {
|
|
|
2256
2256
|
Re = null;
|
|
2257
2257
|
}
|
|
2258
2258
|
console.log("[Centrifuge] Creating new instance:", n);
|
|
2259
|
-
const i = new
|
|
2259
|
+
const i = new Tr(n);
|
|
2260
2260
|
return i.setToken(r), i.on("connect", (c) => {
|
|
2261
2261
|
console.log("[Centrifuge] Connected", c), console.log("[Centrifuge] Subscribing to channel:", o);
|
|
2262
2262
|
const u = i.subscribe(o);
|
|
2263
2263
|
u.on("publish", (l) => {
|
|
2264
2264
|
console.log("[Centrifuge] Publish event received:", l);
|
|
2265
|
-
const h =
|
|
2265
|
+
const h = Lr(l);
|
|
2266
2266
|
h && t(h);
|
|
2267
2267
|
}), u.on("subscribe", (l) => {
|
|
2268
2268
|
console.log("[Centrifuge] ✅ Channel subscribed successfully:", o, l);
|
|
@@ -2273,7 +2273,7 @@ function $t(e, t) {
|
|
|
2273
2273
|
});
|
|
2274
2274
|
}), i.on("disconnect", (c) => console.log("[Centrifuge] Disconnected", c)), i.on("error", (c) => console.error("[Centrifuge] Error", c)), console.log("[Centrifuge] Calling connect()..."), i.connect(), Re = i, { centrifuge: i };
|
|
2275
2275
|
}
|
|
2276
|
-
function
|
|
2276
|
+
function Lr(e) {
|
|
2277
2277
|
var n, r, o;
|
|
2278
2278
|
if (console.log("[Centrifuge] Raw message received:", JSON.stringify(e)), !(e != null && e.data))
|
|
2279
2279
|
return console.warn("[Centrifuge] Empty or invalid response"), null;
|
|
@@ -2287,11 +2287,11 @@ const Ae = {
|
|
|
2287
2287
|
iconType: "kaspi_pay",
|
|
2288
2288
|
label: "Kaspi.kz",
|
|
2289
2289
|
type: "kaspi_pay"
|
|
2290
|
-
},
|
|
2290
|
+
}, Mn = {
|
|
2291
2291
|
iconType: "apple_pay",
|
|
2292
2292
|
label: "Apple Pay",
|
|
2293
2293
|
type: "apple_pay"
|
|
2294
|
-
},
|
|
2294
|
+
}, xn = {
|
|
2295
2295
|
iconType: "google_pay",
|
|
2296
2296
|
label: "Google Pay",
|
|
2297
2297
|
type: "google_pay"
|
|
@@ -2304,7 +2304,7 @@ function en(e) {
|
|
|
2304
2304
|
let t = String(e).trim().toLowerCase();
|
|
2305
2305
|
return t.startsWith("payment_method_") && (t = t.replace("payment_method_", "")), t === "kaspi" ? "kaspi_pay" : t === "apple" ? "apple_pay" : t === "google" ? "google_pay" : t === "newcard" ? "new_card" : t === "card" ? "card" : ["kaspi_pay", "apple_pay", "google_pay", "new_card"].includes(t) ? t : null;
|
|
2306
2306
|
}
|
|
2307
|
-
function
|
|
2307
|
+
function Rr(e) {
|
|
2308
2308
|
var i, c, u;
|
|
2309
2309
|
const t = e, n = ((i = t == null ? void 0 : t.context) == null ? void 0 : i.last_payment_method) ?? (t == null ? void 0 : t.last_payment_method) ?? ((c = t == null ? void 0 : t.attributes) == null ? void 0 : c.last_payment_method);
|
|
2310
2310
|
if (!n) return null;
|
|
@@ -2317,10 +2317,10 @@ function Tr(e) {
|
|
|
2317
2317
|
cardId: o != null ? String(o) : null
|
|
2318
2318
|
};
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2320
|
+
function Or(e, t, n = {}) {
|
|
2321
2321
|
var S, P, k, R;
|
|
2322
|
-
const r = [], o = (S = e == null ? void 0 : e.kaspi) == null ? void 0 : S.data, i = ((P = e == null ? void 0 : e.cards_v2) == null ? void 0 : P.data) || [], c = ((R = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : R.attributes) || {}, u = ee(c.payment_method_kaspi), l = ee(c.payment_method_card), h = typeof window < "u" && window.self === window.top,
|
|
2323
|
-
return o != null && o.isKaspiOnly && u && !I ? [Ae] : b ? o != null && o.isAvailable && u && !I ? [Ae] : [] : (ee(c.payment_method_apple_pay) && !
|
|
2322
|
+
const r = [], o = (S = e == null ? void 0 : e.kaspi) == null ? void 0 : S.data, i = ((P = e == null ? void 0 : e.cards_v2) == null ? void 0 : P.data) || [], c = ((R = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : R.attributes) || {}, u = ee(c.payment_method_kaspi), l = ee(c.payment_method_card), h = typeof window < "u" && window.self === window.top, m = Lt() === "ios", b = !!(n != null && n.onlyKaspiAvailable), I = !!(n != null && n.disableKaspi);
|
|
2323
|
+
return o != null && o.isKaspiOnly && u && !I ? [Ae] : b ? o != null && o.isAvailable && u && !I ? [Ae] : [] : (ee(c.payment_method_apple_pay) && !Ke("apple_pay") && (qe() && h || ze() || m || Dn() === 16) && r.push(Mn), o != null && o.isAvailable && u && !I && r.push(Ae), l && i.filter((L) => !L.isExpired).forEach((L) => {
|
|
2324
2324
|
r.push({
|
|
2325
2325
|
iconType: Xe(L.attributes.mask),
|
|
2326
2326
|
type: "card",
|
|
@@ -2329,22 +2329,22 @@ function Lr(e, t, n = {}) {
|
|
|
2329
2329
|
cardType: L.type,
|
|
2330
2330
|
isDefault: L.attributes.isDefault
|
|
2331
2331
|
});
|
|
2332
|
-
}), ee(c.payment_method_google_pay) && !
|
|
2332
|
+
}), ee(c.payment_method_google_pay) && !Ke("google_pay") && !(n != null && n.disableGooglePay) && !qe() && !ze() && r.push(xn), ee(c.payment_method_new_card) && r.push({
|
|
2333
2333
|
iconType: "new_card",
|
|
2334
2334
|
type: "new_card",
|
|
2335
2335
|
label: t ? t("newCard") : "Оплата новой картой"
|
|
2336
2336
|
}), r);
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2338
|
+
function mt(e, t = {}) {
|
|
2339
2339
|
var Q, S, P, k;
|
|
2340
|
-
const n = (Q = e == null ? void 0 : e.kaspi) == null ? void 0 : Q.data, r = ((S = e == null ? void 0 : e.cards_v2) == null ? void 0 : S.data) || [], o = ((k = (P = e == null ? void 0 : e.payment_methods) == null ? void 0 : P.data) == null ? void 0 : k.attributes) || {}, i = ee(o.payment_method_kaspi), c = ee(o.payment_method_card), u = !!(t != null && t.disableKaspi), l = typeof window < "u" && window.self === window.top, y = Lt() === "ios",
|
|
2340
|
+
const n = (Q = e == null ? void 0 : e.kaspi) == null ? void 0 : Q.data, r = ((S = e == null ? void 0 : e.cards_v2) == null ? void 0 : S.data) || [], o = ((k = (P = e == null ? void 0 : e.payment_methods) == null ? void 0 : P.data) == null ? void 0 : k.attributes) || {}, i = ee(o.payment_method_kaspi), c = ee(o.payment_method_card), u = !!(t != null && t.disableKaspi), l = typeof window < "u" && window.self === window.top, y = Lt() === "ios", m = ee(o.payment_method_apple_pay) && !Ke("apple_pay") && (qe() && l || ze() || y || Dn() === 16), b = ee(o.payment_method_google_pay) && !Ke("google_pay") && !(t != null && t.disableGooglePay) && !qe() && !ze();
|
|
2341
2341
|
if (n != null && n.isKaspiOnly && i && !u || t != null && t.onlyKaspiAvailable && (n != null && n.isAvailable) && i && !u)
|
|
2342
2342
|
return Ae;
|
|
2343
|
-
const I =
|
|
2343
|
+
const I = Rr(e);
|
|
2344
2344
|
if ((I == null ? void 0 : I.type) === "kaspi_pay" && (n != null && n.isAvailable) && i && !u)
|
|
2345
2345
|
return Ae;
|
|
2346
|
-
if ((I == null ? void 0 : I.type) === "apple_pay" &&
|
|
2347
|
-
if ((I == null ? void 0 : I.type) === "google_pay" && b) return
|
|
2346
|
+
if ((I == null ? void 0 : I.type) === "apple_pay" && m) return Mn;
|
|
2347
|
+
if ((I == null ? void 0 : I.type) === "google_pay" && b) return xn;
|
|
2348
2348
|
if ((I == null ? void 0 : I.type) === "new_card" && ee(o.payment_method_new_card))
|
|
2349
2349
|
return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
|
|
2350
2350
|
if ((I == null ? void 0 : I.type) === "card" && c) {
|
|
@@ -2382,7 +2382,7 @@ function yt(e, t = {}) {
|
|
|
2382
2382
|
cardType: B.type
|
|
2383
2383
|
} : null;
|
|
2384
2384
|
}
|
|
2385
|
-
function
|
|
2385
|
+
function Un(e) {
|
|
2386
2386
|
if (typeof localStorage > "u") return null;
|
|
2387
2387
|
try {
|
|
2388
2388
|
return localStorage.getItem(e);
|
|
@@ -2390,21 +2390,21 @@ function Mn(e) {
|
|
|
2390
2390
|
return null;
|
|
2391
2391
|
}
|
|
2392
2392
|
}
|
|
2393
|
-
function
|
|
2393
|
+
function Ct(e, t) {
|
|
2394
2394
|
if (!(typeof localStorage > "u"))
|
|
2395
2395
|
try {
|
|
2396
2396
|
localStorage.setItem(e, t);
|
|
2397
2397
|
} catch {
|
|
2398
2398
|
}
|
|
2399
2399
|
}
|
|
2400
|
-
function
|
|
2400
|
+
function Ge(e) {
|
|
2401
2401
|
if (!(typeof localStorage > "u"))
|
|
2402
2402
|
try {
|
|
2403
2403
|
localStorage.removeItem(e);
|
|
2404
2404
|
} catch {
|
|
2405
2405
|
}
|
|
2406
2406
|
}
|
|
2407
|
-
async function
|
|
2407
|
+
async function Nr(e, t) {
|
|
2408
2408
|
var n;
|
|
2409
2409
|
try {
|
|
2410
2410
|
const r = await e.json(), o = (n = r == null ? void 0 : r.errors) == null ? void 0 : n[0];
|
|
@@ -2414,10 +2414,10 @@ async function Rr(e, t) {
|
|
|
2414
2414
|
}
|
|
2415
2415
|
}
|
|
2416
2416
|
async function ue(e, t) {
|
|
2417
|
-
const n = await
|
|
2417
|
+
const n = await Nr(e, t);
|
|
2418
2418
|
throw Object.assign(new Error(n), { status: e.status });
|
|
2419
2419
|
}
|
|
2420
|
-
function
|
|
2420
|
+
function $e(e, t, n = {}) {
|
|
2421
2421
|
const r = Number.isFinite(n.checkoutAmount) && n.checkoutAmount >= 0 ? Number(n.checkoutAmount) : e.amount, o = !!n.forceBalanceMethod, i = !!n.useBalance, c = n.voucher;
|
|
2422
2422
|
return {
|
|
2423
2423
|
checkoutAmount: r,
|
|
@@ -2426,7 +2426,7 @@ function Ze(e, t, n = {}) {
|
|
|
2426
2426
|
voucher: c
|
|
2427
2427
|
};
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2429
|
+
function et(e, t, n, r, o) {
|
|
2430
2430
|
return {
|
|
2431
2431
|
preorder_id: e.preorderId,
|
|
2432
2432
|
terminal_id: e.terminalId,
|
|
@@ -2442,13 +2442,13 @@ function $e(e, t, n, r, o) {
|
|
|
2442
2442
|
...e.isFridge && { is_fridge: !0 }
|
|
2443
2443
|
};
|
|
2444
2444
|
}
|
|
2445
|
-
async function
|
|
2445
|
+
async function tt(e, t, n, r, o) {
|
|
2446
2446
|
const i = await fetch(`${e}/orders/v1/checkout`, {
|
|
2447
2447
|
method: "POST",
|
|
2448
2448
|
headers: {
|
|
2449
2449
|
"Content-Type": "application/json",
|
|
2450
2450
|
Authorization: `Bearer ${t.accessToken}`,
|
|
2451
|
-
"X-Idempotency-Key": t.idempotencyKey ??
|
|
2451
|
+
"X-Idempotency-Key": t.idempotencyKey ?? Ze(),
|
|
2452
2452
|
"X-Device-Id": n,
|
|
2453
2453
|
"X-OS": "WEB"
|
|
2454
2454
|
},
|
|
@@ -2456,14 +2456,14 @@ async function et(e, t, n, r, o) {
|
|
|
2456
2456
|
});
|
|
2457
2457
|
return i.ok || await ue(i, o), i.json();
|
|
2458
2458
|
}
|
|
2459
|
-
async function
|
|
2459
|
+
async function tn(e, t, n) {
|
|
2460
2460
|
var u, l, h, y;
|
|
2461
2461
|
const r = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2462
2462
|
method: "POST",
|
|
2463
2463
|
headers: {
|
|
2464
2464
|
"Content-Type": "application/json",
|
|
2465
|
-
"X-Idempotency-Key":
|
|
2466
|
-
"X-Fingerprint":
|
|
2465
|
+
"X-Idempotency-Key": Ze(),
|
|
2466
|
+
"X-Fingerprint": Nn()
|
|
2467
2467
|
},
|
|
2468
2468
|
body: JSON.stringify({
|
|
2469
2469
|
client_id: t,
|
|
@@ -2476,7 +2476,7 @@ async function Or(e, t, n) {
|
|
|
2476
2476
|
if (!i) throw new Error("В ответе отсутствует access_token");
|
|
2477
2477
|
return { access_token: i, refresh_token: c };
|
|
2478
2478
|
}
|
|
2479
|
-
async function
|
|
2479
|
+
async function Dr(e, t, n) {
|
|
2480
2480
|
var u, l, h, y;
|
|
2481
2481
|
const r = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2482
2482
|
method: "POST",
|
|
@@ -2492,13 +2492,13 @@ async function Nr(e, t, n) {
|
|
|
2492
2492
|
if (!i) throw new Error("В ответе отсутствует access_token");
|
|
2493
2493
|
return { access_token: i, refresh_token: c };
|
|
2494
2494
|
}
|
|
2495
|
-
async function
|
|
2495
|
+
async function bt(e, t) {
|
|
2496
2496
|
const n = await fetch(`${e}/orders/v1/checkout/context`, {
|
|
2497
2497
|
method: "POST",
|
|
2498
2498
|
headers: {
|
|
2499
2499
|
"Content-Type": "application/json",
|
|
2500
2500
|
Authorization: `Bearer ${t.accessToken}`,
|
|
2501
|
-
"X-Idempotency-Key":
|
|
2501
|
+
"X-Idempotency-Key": Ze()
|
|
2502
2502
|
},
|
|
2503
2503
|
body: JSON.stringify({
|
|
2504
2504
|
terminal_id: t.terminalId,
|
|
@@ -2511,7 +2511,7 @@ async function Ct(e, t) {
|
|
|
2511
2511
|
});
|
|
2512
2512
|
return n.ok || await ue(n, "Ошибка получения контекста оплаты"), n.json();
|
|
2513
2513
|
}
|
|
2514
|
-
async function
|
|
2514
|
+
async function Mr(e, t, n) {
|
|
2515
2515
|
const r = await fetch(`${e}/payment-gateway/v1/cards/${n}`, {
|
|
2516
2516
|
method: "DELETE",
|
|
2517
2517
|
headers: {
|
|
@@ -2521,7 +2521,7 @@ async function Dr(e, t, n) {
|
|
|
2521
2521
|
});
|
|
2522
2522
|
return r.ok || await ue(r, "Не удалось удалить карту"), r.json().catch(() => ({}));
|
|
2523
2523
|
}
|
|
2524
|
-
async function
|
|
2524
|
+
async function xr(e, t, n) {
|
|
2525
2525
|
const r = await fetch(
|
|
2526
2526
|
`${e}/payment-gateway/v1/cards/${n}/mark_as_default`,
|
|
2527
2527
|
{
|
|
@@ -2534,7 +2534,7 @@ async function Mr(e, t, n) {
|
|
|
2534
2534
|
);
|
|
2535
2535
|
return r.ok || await ue(r, "Не удалось отметить карту как основную"), r.json().catch(() => ({}));
|
|
2536
2536
|
}
|
|
2537
|
-
async function
|
|
2537
|
+
async function Ur(e, t, n) {
|
|
2538
2538
|
const r = await fetch(`${e}/orders/v1/orders/${n}/status`, {
|
|
2539
2539
|
method: "GET",
|
|
2540
2540
|
headers: {
|
|
@@ -2550,8 +2550,8 @@ async function xr(e, t, n) {
|
|
|
2550
2550
|
const o = await r.json(), i = (o == null ? void 0 : o.data) ?? o;
|
|
2551
2551
|
return { data: { status: i == null ? void 0 : i.status, payload: (i == null ? void 0 : i.payload) ?? {} } };
|
|
2552
2552
|
}
|
|
2553
|
-
async function
|
|
2554
|
-
const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } =
|
|
2553
|
+
async function nn(e, t, n, r, o = {}) {
|
|
2554
|
+
const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } = $e(
|
|
2555
2555
|
t,
|
|
2556
2556
|
{
|
|
2557
2557
|
type: r.type,
|
|
@@ -2559,29 +2559,29 @@ async function tn(e, t, n, r, o = {}) {
|
|
|
2559
2559
|
},
|
|
2560
2560
|
o
|
|
2561
2561
|
);
|
|
2562
|
-
return
|
|
2562
|
+
return tt(
|
|
2563
2563
|
e,
|
|
2564
2564
|
t,
|
|
2565
2565
|
n,
|
|
2566
|
-
|
|
2566
|
+
et(t, c, i, u, l),
|
|
2567
2567
|
"Ошибка создания заказа"
|
|
2568
2568
|
);
|
|
2569
2569
|
}
|
|
2570
|
-
async function
|
|
2571
|
-
const { checkoutAmount: o, checkoutPaymentMethod: i, useBalanceFlag: c, voucher: u } =
|
|
2570
|
+
async function Fr(e, t, n, r = {}) {
|
|
2571
|
+
const { checkoutAmount: o, checkoutPaymentMethod: i, useBalanceFlag: c, voucher: u } = $e(
|
|
2572
2572
|
t,
|
|
2573
2573
|
{ type: "new_card" },
|
|
2574
2574
|
r
|
|
2575
2575
|
);
|
|
2576
|
-
return
|
|
2576
|
+
return tt(
|
|
2577
2577
|
e,
|
|
2578
2578
|
t,
|
|
2579
2579
|
n,
|
|
2580
|
-
|
|
2580
|
+
et(t, i, o, c, u),
|
|
2581
2581
|
"Ошибка создания заказа для новой карты"
|
|
2582
2582
|
);
|
|
2583
2583
|
}
|
|
2584
|
-
async function
|
|
2584
|
+
async function Xr(e, t) {
|
|
2585
2585
|
const n = await fetch(
|
|
2586
2586
|
`${e}/loyalty/v6/coupons/by_terminal/${t.terminalId}/at_payment?order_pay_amount=${t.amount}`,
|
|
2587
2587
|
{
|
|
@@ -2594,7 +2594,7 @@ async function Fr(e, t) {
|
|
|
2594
2594
|
);
|
|
2595
2595
|
return n.ok || await ue(n, "Ошибка получения купонов"), n.json();
|
|
2596
2596
|
}
|
|
2597
|
-
async function
|
|
2597
|
+
async function rn(e, t, n) {
|
|
2598
2598
|
const r = window.location.hostname, o = await fetch(`${e}/payment-gateway/v1/apple/session`, {
|
|
2599
2599
|
method: "POST",
|
|
2600
2600
|
headers: {
|
|
@@ -2607,30 +2607,30 @@ async function Xr(e, t, n) {
|
|
|
2607
2607
|
return o.ok || await ue(o, "Ошибка получения Apple Pay сессии"), o.json();
|
|
2608
2608
|
}
|
|
2609
2609
|
async function Hr(e, t, n, r, o = {}) {
|
|
2610
|
-
const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } =
|
|
2610
|
+
const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } = $e(
|
|
2611
2611
|
t,
|
|
2612
2612
|
{ type: "apple_pay", data: r },
|
|
2613
2613
|
o
|
|
2614
2614
|
);
|
|
2615
|
-
return
|
|
2615
|
+
return tt(
|
|
2616
2616
|
e,
|
|
2617
2617
|
t,
|
|
2618
2618
|
n,
|
|
2619
|
-
|
|
2619
|
+
et(t, c, i, u, l),
|
|
2620
2620
|
"Ошибка создания заказа с Apple Pay"
|
|
2621
2621
|
);
|
|
2622
2622
|
}
|
|
2623
|
-
async function
|
|
2624
|
-
const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } =
|
|
2623
|
+
async function Fn(e, t, n, r, o = {}) {
|
|
2624
|
+
const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } = $e(
|
|
2625
2625
|
t,
|
|
2626
2626
|
{ type: "google_pay", data: r },
|
|
2627
2627
|
o
|
|
2628
2628
|
);
|
|
2629
|
-
return
|
|
2629
|
+
return tt(
|
|
2630
2630
|
e,
|
|
2631
2631
|
t,
|
|
2632
2632
|
n,
|
|
2633
|
-
|
|
2633
|
+
et(t, c, i, u, l),
|
|
2634
2634
|
"Ошибка создания заказа с Google Pay"
|
|
2635
2635
|
);
|
|
2636
2636
|
}
|
|
@@ -2667,6 +2667,7 @@ function jr(e) {
|
|
|
2667
2667
|
onUserEvent: typeof e.onUserEvent == "function" ? e.onUserEvent : null,
|
|
2668
2668
|
onBeforeCheckout: typeof e.onBeforeCheckout == "function" ? e.onBeforeCheckout : null,
|
|
2669
2669
|
onFreedomLink: typeof e.onFreedomLink == "function" ? e.onFreedomLink : null,
|
|
2670
|
+
onRequestNewTrackId: typeof e.onRequestNewTrackId == "function" ? e.onRequestNewTrackId : null,
|
|
2670
2671
|
idempotencyKey: e.idempotencyKey,
|
|
2671
2672
|
locale: e.locale || "ru",
|
|
2672
2673
|
containerSelector: typeof e.containerSelector == "string" ? e.containerSelector.trim() : "",
|
|
@@ -2681,11 +2682,11 @@ function jr(e) {
|
|
|
2681
2682
|
};
|
|
2682
2683
|
}
|
|
2683
2684
|
const U = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, fe = "8.55.2", j = globalThis;
|
|
2684
|
-
function
|
|
2685
|
+
function nt(e, t, n) {
|
|
2685
2686
|
const r = n || j, o = r.__SENTRY__ = r.__SENTRY__ || {}, i = o[fe] = o[fe] || {};
|
|
2686
2687
|
return i[e] || (i[e] = t());
|
|
2687
2688
|
}
|
|
2688
|
-
const Rt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Jr = "Sentry Logger ",
|
|
2689
|
+
const Rt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Jr = "Sentry Logger ", on = [
|
|
2689
2690
|
"debug",
|
|
2690
2691
|
"info",
|
|
2691
2692
|
"warn",
|
|
@@ -2693,13 +2694,13 @@ const Rt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Jr = "Sentry Logge
|
|
|
2693
2694
|
"log",
|
|
2694
2695
|
"assert",
|
|
2695
2696
|
"trace"
|
|
2696
|
-
],
|
|
2697
|
-
function
|
|
2697
|
+
], sn = {};
|
|
2698
|
+
function rt(e) {
|
|
2698
2699
|
if (!("console" in j))
|
|
2699
2700
|
return e();
|
|
2700
|
-
const t = j.console, n = {}, r = Object.keys(
|
|
2701
|
+
const t = j.console, n = {}, r = Object.keys(sn);
|
|
2701
2702
|
r.forEach((o) => {
|
|
2702
|
-
const i =
|
|
2703
|
+
const i = sn[o];
|
|
2703
2704
|
n[o] = t[o], t[o] = i;
|
|
2704
2705
|
});
|
|
2705
2706
|
try {
|
|
@@ -2721,18 +2722,18 @@ function qr() {
|
|
|
2721
2722
|
},
|
|
2722
2723
|
isEnabled: () => e
|
|
2723
2724
|
};
|
|
2724
|
-
return Rt ?
|
|
2725
|
+
return Rt ? on.forEach((n) => {
|
|
2725
2726
|
t[n] = (...r) => {
|
|
2726
|
-
e &&
|
|
2727
|
+
e && rt(() => {
|
|
2727
2728
|
j.console[n](`${Jr}[${n}]:`, ...r);
|
|
2728
2729
|
});
|
|
2729
2730
|
};
|
|
2730
|
-
}) :
|
|
2731
|
+
}) : on.forEach((n) => {
|
|
2731
2732
|
t[n] = () => {
|
|
2732
2733
|
};
|
|
2733
2734
|
}), t;
|
|
2734
2735
|
}
|
|
2735
|
-
const N =
|
|
2736
|
+
const N = nt("logger", qr), Xn = 50, be = "?", an = /\(error: (.*)\)/, cn = /captureMessage|captureException/;
|
|
2736
2737
|
function zr(...e) {
|
|
2737
2738
|
const t = e.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
|
|
2738
2739
|
return (n, r = 0, o = 0) => {
|
|
@@ -2742,16 +2743,16 @@ function zr(...e) {
|
|
|
2742
2743
|
const l = c[u];
|
|
2743
2744
|
if (l.length > 1024)
|
|
2744
2745
|
continue;
|
|
2745
|
-
const h =
|
|
2746
|
+
const h = an.test(l) ? l.replace(an, "$1") : l;
|
|
2746
2747
|
if (!h.match(/\S*Error: /)) {
|
|
2747
2748
|
for (const y of t) {
|
|
2748
|
-
const
|
|
2749
|
-
if (
|
|
2750
|
-
i.push(
|
|
2749
|
+
const m = y(h);
|
|
2750
|
+
if (m) {
|
|
2751
|
+
i.push(m);
|
|
2751
2752
|
break;
|
|
2752
2753
|
}
|
|
2753
2754
|
}
|
|
2754
|
-
if (i.length >=
|
|
2755
|
+
if (i.length >= Xn + o)
|
|
2755
2756
|
break;
|
|
2756
2757
|
}
|
|
2757
2758
|
}
|
|
@@ -2762,7 +2763,7 @@ function Kr(e) {
|
|
|
2762
2763
|
if (!e.length)
|
|
2763
2764
|
return [];
|
|
2764
2765
|
const t = Array.from(e);
|
|
2765
|
-
return /sentryWrapped/.test(Oe(t).function || "") && t.pop(), t.reverse(),
|
|
2766
|
+
return /sentryWrapped/.test(Oe(t).function || "") && t.pop(), t.reverse(), cn.test(Oe(t).function || "") && (t.pop(), cn.test(Oe(t).function || "") && t.pop()), t.slice(0, Xn).map((n) => ({
|
|
2766
2767
|
...n,
|
|
2767
2768
|
filename: n.filename || Oe(t).filename,
|
|
2768
2769
|
function: n.function || be
|
|
@@ -2771,12 +2772,12 @@ function Kr(e) {
|
|
|
2771
2772
|
function Oe(e) {
|
|
2772
2773
|
return e[e.length - 1] || {};
|
|
2773
2774
|
}
|
|
2774
|
-
const
|
|
2775
|
+
const ht = "<anonymous>";
|
|
2775
2776
|
function Gr(e) {
|
|
2776
2777
|
try {
|
|
2777
|
-
return !e || typeof e != "function" ?
|
|
2778
|
+
return !e || typeof e != "function" ? ht : e.name || ht;
|
|
2778
2779
|
} catch {
|
|
2779
|
-
return
|
|
2780
|
+
return ht;
|
|
2780
2781
|
}
|
|
2781
2782
|
}
|
|
2782
2783
|
function Ot() {
|
|
@@ -2786,31 +2787,31 @@ function Nt(e) {
|
|
|
2786
2787
|
const t = e.__SENTRY__ = e.__SENTRY__ || {};
|
|
2787
2788
|
return t.version = t.version || fe, t[fe] = t[fe] || {};
|
|
2788
2789
|
}
|
|
2789
|
-
const
|
|
2790
|
-
function
|
|
2791
|
-
switch (
|
|
2790
|
+
const Hn = Object.prototype.toString;
|
|
2791
|
+
function jn(e) {
|
|
2792
|
+
switch (Hn.call(e)) {
|
|
2792
2793
|
case "[object Error]":
|
|
2793
2794
|
case "[object Exception]":
|
|
2794
2795
|
case "[object DOMException]":
|
|
2795
2796
|
case "[object WebAssembly.Exception]":
|
|
2796
2797
|
return !0;
|
|
2797
2798
|
default:
|
|
2798
|
-
return
|
|
2799
|
+
return it(e, Error);
|
|
2799
2800
|
}
|
|
2800
2801
|
}
|
|
2801
2802
|
function Pe(e, t) {
|
|
2802
|
-
return
|
|
2803
|
+
return Hn.call(e) === `[object ${t}]`;
|
|
2803
2804
|
}
|
|
2804
|
-
function
|
|
2805
|
+
function Jn(e) {
|
|
2805
2806
|
return Pe(e, "ErrorEvent");
|
|
2806
2807
|
}
|
|
2807
|
-
function
|
|
2808
|
+
function un(e) {
|
|
2808
2809
|
return Pe(e, "DOMError");
|
|
2809
2810
|
}
|
|
2810
2811
|
function Wr(e) {
|
|
2811
2812
|
return Pe(e, "DOMException");
|
|
2812
2813
|
}
|
|
2813
|
-
function
|
|
2814
|
+
function qn(e) {
|
|
2814
2815
|
return Pe(e, "String");
|
|
2815
2816
|
}
|
|
2816
2817
|
function Dt(e) {
|
|
@@ -2822,19 +2823,19 @@ function Yr(e) {
|
|
|
2822
2823
|
function Ee(e) {
|
|
2823
2824
|
return Pe(e, "Object");
|
|
2824
2825
|
}
|
|
2825
|
-
function
|
|
2826
|
-
return typeof Event < "u" &&
|
|
2826
|
+
function ot(e) {
|
|
2827
|
+
return typeof Event < "u" && it(e, Event);
|
|
2827
2828
|
}
|
|
2828
2829
|
function Vr(e) {
|
|
2829
|
-
return typeof Element < "u" &&
|
|
2830
|
+
return typeof Element < "u" && it(e, Element);
|
|
2830
2831
|
}
|
|
2831
|
-
function
|
|
2832
|
+
function st(e) {
|
|
2832
2833
|
return !!(e && e.then && typeof e.then == "function");
|
|
2833
2834
|
}
|
|
2834
2835
|
function Zr(e) {
|
|
2835
2836
|
return Ee(e) && "nativeEvent" in e && "preventDefault" in e && "stopPropagation" in e;
|
|
2836
2837
|
}
|
|
2837
|
-
function
|
|
2838
|
+
function it(e, t) {
|
|
2838
2839
|
try {
|
|
2839
2840
|
return e instanceof t;
|
|
2840
2841
|
} catch {
|
|
@@ -2854,8 +2855,8 @@ function no(e, t = {}) {
|
|
|
2854
2855
|
let i = 0, c = 0;
|
|
2855
2856
|
const u = " > ", l = u.length;
|
|
2856
2857
|
let h;
|
|
2857
|
-
const y = Array.isArray(t) ? t : t.keyAttrs,
|
|
2858
|
-
for (; n && i++ < r && (h = ro(n, y), !(h === "html" || i > 1 && c + o.length * l + h.length >=
|
|
2858
|
+
const y = Array.isArray(t) ? t : t.keyAttrs, m = !Array.isArray(t) && t.maxStringLength || to;
|
|
2859
|
+
for (; n && i++ < r && (h = ro(n, y), !(h === "html" || i > 1 && c + o.length * l + h.length >= m)); )
|
|
2859
2860
|
o.push(h), c += h.length, n = n.parentNode;
|
|
2860
2861
|
return o.reverse().join(u);
|
|
2861
2862
|
} catch {
|
|
@@ -2881,7 +2882,7 @@ function ro(e, t) {
|
|
|
2881
2882
|
else {
|
|
2882
2883
|
n.id && r.push(`#${n.id}`);
|
|
2883
2884
|
const c = n.className;
|
|
2884
|
-
if (c &&
|
|
2885
|
+
if (c && qn(c)) {
|
|
2885
2886
|
const u = c.split(/\s+/);
|
|
2886
2887
|
for (const l of u)
|
|
2887
2888
|
r.push(`.${l}`);
|
|
@@ -2897,7 +2898,7 @@ function ro(e, t) {
|
|
|
2897
2898
|
function Se(e, t = 0) {
|
|
2898
2899
|
return typeof e != "string" || t === 0 || e.length <= t ? e : `${e.slice(0, t)}...`;
|
|
2899
2900
|
}
|
|
2900
|
-
function
|
|
2901
|
+
function zn(e, t, n) {
|
|
2901
2902
|
try {
|
|
2902
2903
|
Object.defineProperty(e, t, {
|
|
2903
2904
|
// enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
|
|
@@ -2909,33 +2910,33 @@ function Jn(e, t, n) {
|
|
|
2909
2910
|
Rt && N.log(`Failed to add non-enumerable property "${t}" to object`, e);
|
|
2910
2911
|
}
|
|
2911
2912
|
}
|
|
2912
|
-
function
|
|
2913
|
-
if (
|
|
2913
|
+
function Kn(e) {
|
|
2914
|
+
if (jn(e))
|
|
2914
2915
|
return {
|
|
2915
2916
|
message: e.message,
|
|
2916
2917
|
name: e.name,
|
|
2917
2918
|
stack: e.stack,
|
|
2918
|
-
...
|
|
2919
|
+
...An(e)
|
|
2919
2920
|
};
|
|
2920
|
-
if (
|
|
2921
|
+
if (ot(e)) {
|
|
2921
2922
|
const t = {
|
|
2922
2923
|
type: e.type,
|
|
2923
|
-
target:
|
|
2924
|
-
currentTarget:
|
|
2925
|
-
...
|
|
2924
|
+
target: ln(e.target),
|
|
2925
|
+
currentTarget: ln(e.currentTarget),
|
|
2926
|
+
...An(e)
|
|
2926
2927
|
};
|
|
2927
|
-
return typeof CustomEvent < "u" &&
|
|
2928
|
+
return typeof CustomEvent < "u" && it(e, CustomEvent) && (t.detail = e.detail), t;
|
|
2928
2929
|
} else
|
|
2929
2930
|
return e;
|
|
2930
2931
|
}
|
|
2931
|
-
function
|
|
2932
|
+
function ln(e) {
|
|
2932
2933
|
try {
|
|
2933
2934
|
return Vr(e) ? no(e) : Object.prototype.toString.call(e);
|
|
2934
2935
|
} catch {
|
|
2935
2936
|
return "<unknown>";
|
|
2936
2937
|
}
|
|
2937
2938
|
}
|
|
2938
|
-
function
|
|
2939
|
+
function An(e) {
|
|
2939
2940
|
if (typeof e == "object" && e !== null) {
|
|
2940
2941
|
const t = {};
|
|
2941
2942
|
for (const n in e)
|
|
@@ -2945,7 +2946,7 @@ function un(e) {
|
|
|
2945
2946
|
return {};
|
|
2946
2947
|
}
|
|
2947
2948
|
function oo(e, t = 40) {
|
|
2948
|
-
const n = Object.keys(
|
|
2949
|
+
const n = Object.keys(Kn(e));
|
|
2949
2950
|
n.sort();
|
|
2950
2951
|
const r = n[0];
|
|
2951
2952
|
if (!r)
|
|
@@ -2960,9 +2961,9 @@ function oo(e, t = 40) {
|
|
|
2960
2961
|
return "";
|
|
2961
2962
|
}
|
|
2962
2963
|
function V(e) {
|
|
2963
|
-
return
|
|
2964
|
+
return Et(e, /* @__PURE__ */ new Map());
|
|
2964
2965
|
}
|
|
2965
|
-
function
|
|
2966
|
+
function Et(e, t) {
|
|
2966
2967
|
if (so(e)) {
|
|
2967
2968
|
const n = t.get(e);
|
|
2968
2969
|
if (n !== void 0)
|
|
@@ -2970,7 +2971,7 @@ function bt(e, t) {
|
|
|
2970
2971
|
const r = {};
|
|
2971
2972
|
t.set(e, r);
|
|
2972
2973
|
for (const o of Object.getOwnPropertyNames(e))
|
|
2973
|
-
typeof e[o] < "u" && (r[o] =
|
|
2974
|
+
typeof e[o] < "u" && (r[o] = Et(e[o], t));
|
|
2974
2975
|
return r;
|
|
2975
2976
|
}
|
|
2976
2977
|
if (Array.isArray(e)) {
|
|
@@ -2979,7 +2980,7 @@ function bt(e, t) {
|
|
|
2979
2980
|
return n;
|
|
2980
2981
|
const r = [];
|
|
2981
2982
|
return t.set(e, r), e.forEach((o) => {
|
|
2982
|
-
r.push(
|
|
2983
|
+
r.push(Et(o, t));
|
|
2983
2984
|
}), r;
|
|
2984
2985
|
}
|
|
2985
2986
|
return e;
|
|
@@ -2994,18 +2995,18 @@ function so(e) {
|
|
|
2994
2995
|
return !0;
|
|
2995
2996
|
}
|
|
2996
2997
|
}
|
|
2997
|
-
const
|
|
2998
|
-
function
|
|
2999
|
-
return Date.now() /
|
|
2998
|
+
const Gn = 1e3;
|
|
2999
|
+
function at() {
|
|
3000
|
+
return Date.now() / Gn;
|
|
3000
3001
|
}
|
|
3001
3002
|
function io() {
|
|
3002
3003
|
const { performance: e } = j;
|
|
3003
3004
|
if (!e || !e.now)
|
|
3004
|
-
return
|
|
3005
|
+
return at;
|
|
3005
3006
|
const t = Date.now() - e.now(), n = e.timeOrigin == null ? t : e.timeOrigin;
|
|
3006
|
-
return () => (n + e.now()) /
|
|
3007
|
+
return () => (n + e.now()) / Gn;
|
|
3007
3008
|
}
|
|
3008
|
-
const
|
|
3009
|
+
const Wn = io();
|
|
3009
3010
|
(() => {
|
|
3010
3011
|
const { performance: e } = j;
|
|
3011
3012
|
if (!e || !e.now)
|
|
@@ -3036,7 +3037,7 @@ function te() {
|
|
|
3036
3037
|
function ao(e) {
|
|
3037
3038
|
return e.exception && e.exception.values ? e.exception.values[0] : void 0;
|
|
3038
3039
|
}
|
|
3039
|
-
function
|
|
3040
|
+
function dn(e, t, n) {
|
|
3040
3041
|
const r = e.exception = e.exception || {}, o = r.values = r.values || [], i = o[0] = o[0] || {};
|
|
3041
3042
|
i.value || (i.value = t || ""), i.type || (i.type = "Error");
|
|
3042
3043
|
}
|
|
@@ -3050,11 +3051,11 @@ function _e(e, t) {
|
|
|
3050
3051
|
n.mechanism.data = i;
|
|
3051
3052
|
}
|
|
3052
3053
|
}
|
|
3053
|
-
function
|
|
3054
|
+
function fn(e) {
|
|
3054
3055
|
if (co(e))
|
|
3055
3056
|
return !0;
|
|
3056
3057
|
try {
|
|
3057
|
-
|
|
3058
|
+
zn(e, "__sentry_captured__", !0);
|
|
3058
3059
|
} catch {
|
|
3059
3060
|
}
|
|
3060
3061
|
return !1;
|
|
@@ -3078,7 +3079,7 @@ function he(e) {
|
|
|
3078
3079
|
t(e);
|
|
3079
3080
|
});
|
|
3080
3081
|
}
|
|
3081
|
-
function
|
|
3082
|
+
function We(e) {
|
|
3082
3083
|
return new G((t, n) => {
|
|
3083
3084
|
n(e);
|
|
3084
3085
|
});
|
|
@@ -3160,7 +3161,7 @@ class G {
|
|
|
3160
3161
|
__init3() {
|
|
3161
3162
|
this._setResult = (t, n) => {
|
|
3162
3163
|
if (this._state === re.PENDING) {
|
|
3163
|
-
if (
|
|
3164
|
+
if (st(n)) {
|
|
3164
3165
|
n.then(this._resolve, this._reject);
|
|
3165
3166
|
return;
|
|
3166
3167
|
}
|
|
@@ -3180,8 +3181,8 @@ class G {
|
|
|
3180
3181
|
};
|
|
3181
3182
|
}
|
|
3182
3183
|
}
|
|
3183
|
-
function
|
|
3184
|
-
if (t.user && (!e.ipAddress && t.user.ip_address && (e.ipAddress = t.user.ip_address), !e.did && !t.did && (e.did = t.user.id || t.user.email || t.user.username)), e.timestamp = t.timestamp ||
|
|
3184
|
+
function vt(e, t = {}) {
|
|
3185
|
+
if (t.user && (!e.ipAddress && t.user.ip_address && (e.ipAddress = t.user.ip_address), !e.did && !t.did && (e.did = t.user.id || t.user.email || t.user.username)), e.timestamp = t.timestamp || Wn(), t.abnormal_mechanism && (e.abnormal_mechanism = t.abnormal_mechanism), t.ignoreDuration && (e.ignoreDuration = t.ignoreDuration), t.sid && (e.sid = t.sid.length === 32 ? t.sid : te()), t.init !== void 0 && (e.init = t.init), !e.did && t.did && (e.did = `${t.did}`), typeof t.started == "number" && (e.started = t.started), e.ignoreDuration)
|
|
3185
3186
|
e.duration = void 0;
|
|
3186
3187
|
else if (typeof t.duration == "number")
|
|
3187
3188
|
e.duration = t.duration;
|
|
@@ -3191,28 +3192,28 @@ function Et(e, t = {}) {
|
|
|
3191
3192
|
}
|
|
3192
3193
|
t.release && (e.release = t.release), t.environment && (e.environment = t.environment), !e.ipAddress && t.ipAddress && (e.ipAddress = t.ipAddress), !e.userAgent && t.userAgent && (e.userAgent = t.userAgent), typeof t.errors == "number" && (e.errors = t.errors), t.status && (e.status = t.status);
|
|
3193
3194
|
}
|
|
3194
|
-
function
|
|
3195
|
+
function hn() {
|
|
3195
3196
|
return te();
|
|
3196
3197
|
}
|
|
3197
|
-
function
|
|
3198
|
+
function It() {
|
|
3198
3199
|
return te().substring(16);
|
|
3199
3200
|
}
|
|
3200
|
-
function
|
|
3201
|
+
function ct(e, t, n = 2) {
|
|
3201
3202
|
if (!t || typeof t != "object" || n <= 0)
|
|
3202
3203
|
return t;
|
|
3203
3204
|
if (e && t && Object.keys(t).length === 0)
|
|
3204
3205
|
return e;
|
|
3205
3206
|
const r = { ...e };
|
|
3206
3207
|
for (const o in t)
|
|
3207
|
-
Object.prototype.hasOwnProperty.call(t, o) && (r[o] =
|
|
3208
|
+
Object.prototype.hasOwnProperty.call(t, o) && (r[o] = ct(r[o], t[o], n - 1));
|
|
3208
3209
|
return r;
|
|
3209
3210
|
}
|
|
3210
|
-
const
|
|
3211
|
-
function
|
|
3212
|
-
t ?
|
|
3211
|
+
const Bt = "_sentrySpan";
|
|
3212
|
+
function pn(e, t) {
|
|
3213
|
+
t ? zn(e, Bt, t) : delete e[Bt];
|
|
3213
3214
|
}
|
|
3214
|
-
function
|
|
3215
|
-
return e[
|
|
3215
|
+
function gn(e) {
|
|
3216
|
+
return e[Bt];
|
|
3216
3217
|
}
|
|
3217
3218
|
const uo = 100;
|
|
3218
3219
|
class Mt {
|
|
@@ -3246,8 +3247,8 @@ class Mt {
|
|
|
3246
3247
|
// NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.
|
|
3247
3248
|
constructor() {
|
|
3248
3249
|
this._notifyingListeners = !1, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = {
|
|
3249
|
-
traceId:
|
|
3250
|
-
spanId:
|
|
3250
|
+
traceId: hn(),
|
|
3251
|
+
spanId: It()
|
|
3251
3252
|
};
|
|
3252
3253
|
}
|
|
3253
3254
|
/**
|
|
@@ -3257,7 +3258,7 @@ class Mt {
|
|
|
3257
3258
|
const t = new Mt();
|
|
3258
3259
|
return t._breadcrumbs = [...this._breadcrumbs], t._tags = { ...this._tags }, t._extra = { ...this._extra }, t._contexts = { ...this._contexts }, this._contexts.flags && (t._contexts.flags = {
|
|
3259
3260
|
values: [...this._contexts.flags.values]
|
|
3260
|
-
}), t._user = this._user, t._level = this._level, t._session = this._session, t._transactionName = this._transactionName, t._fingerprint = this._fingerprint, t._eventProcessors = [...this._eventProcessors], t._requestSession = this._requestSession, t._attachments = [...this._attachments], t._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, t._propagationContext = { ...this._propagationContext }, t._client = this._client, t._lastEventId = this._lastEventId,
|
|
3261
|
+
}), t._user = this._user, t._level = this._level, t._session = this._session, t._transactionName = this._transactionName, t._fingerprint = this._fingerprint, t._eventProcessors = [...this._eventProcessors], t._requestSession = this._requestSession, t._attachments = [...this._attachments], t._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, t._propagationContext = { ...this._propagationContext }, t._client = this._client, t._lastEventId = this._lastEventId, pn(t, gn(this)), t;
|
|
3261
3262
|
}
|
|
3262
3263
|
/**
|
|
3263
3264
|
* @inheritDoc
|
|
@@ -3304,7 +3305,7 @@ class Mt {
|
|
|
3304
3305
|
id: void 0,
|
|
3305
3306
|
ip_address: void 0,
|
|
3306
3307
|
username: void 0
|
|
3307
|
-
}, this._session &&
|
|
3308
|
+
}, this._session && vt(this._session, { user: t }), this._notifyScopeListeners(), this;
|
|
3308
3309
|
}
|
|
3309
3310
|
/**
|
|
3310
3311
|
* @inheritDoc
|
|
@@ -3409,14 +3410,14 @@ class Mt {
|
|
|
3409
3410
|
const n = typeof t == "function" ? t(this) : t, [r, o] = n instanceof ce ? (
|
|
3410
3411
|
// eslint-disable-next-line deprecation/deprecation
|
|
3411
3412
|
[n.getScopeData(), n.getRequestSession()]
|
|
3412
|
-
) : Ee(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level: h, fingerprint: y = [], propagationContext:
|
|
3413
|
-
return this._tags = { ...this._tags, ...i }, this._extra = { ...this._extra, ...c }, this._contexts = { ...this._contexts, ...l }, u && Object.keys(u).length && (this._user = u), h && (this._level = h), y.length && (this._fingerprint = y),
|
|
3413
|
+
) : Ee(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level: h, fingerprint: y = [], propagationContext: m } = r || {};
|
|
3414
|
+
return this._tags = { ...this._tags, ...i }, this._extra = { ...this._extra, ...c }, this._contexts = { ...this._contexts, ...l }, u && Object.keys(u).length && (this._user = u), h && (this._level = h), y.length && (this._fingerprint = y), m && (this._propagationContext = m), o && (this._requestSession = o), this;
|
|
3414
3415
|
}
|
|
3415
3416
|
/**
|
|
3416
3417
|
* @inheritDoc
|
|
3417
3418
|
*/
|
|
3418
3419
|
clear() {
|
|
3419
|
-
return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._session = void 0,
|
|
3420
|
+
return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._session = void 0, pn(this, void 0), this._attachments = [], this.setPropagationContext({ traceId: hn() }), this._notifyScopeListeners(), this;
|
|
3420
3421
|
}
|
|
3421
3422
|
/**
|
|
3422
3423
|
* @inheritDoc
|
|
@@ -3426,7 +3427,7 @@ class Mt {
|
|
|
3426
3427
|
if (r <= 0)
|
|
3427
3428
|
return this;
|
|
3428
3429
|
const o = {
|
|
3429
|
-
timestamp:
|
|
3430
|
+
timestamp: at(),
|
|
3430
3431
|
...t
|
|
3431
3432
|
};
|
|
3432
3433
|
return this._breadcrumbs.push(o), this._breadcrumbs.length > r && (this._breadcrumbs = this._breadcrumbs.slice(-r), this._client && this._client.recordDroppedEvent("buffer_overflow", "log_item")), this._notifyScopeListeners(), this;
|
|
@@ -3470,14 +3471,14 @@ class Mt {
|
|
|
3470
3471
|
propagationContext: this._propagationContext,
|
|
3471
3472
|
sdkProcessingMetadata: this._sdkProcessingMetadata,
|
|
3472
3473
|
transactionName: this._transactionName,
|
|
3473
|
-
span:
|
|
3474
|
+
span: gn(this)
|
|
3474
3475
|
};
|
|
3475
3476
|
}
|
|
3476
3477
|
/**
|
|
3477
3478
|
* @inheritDoc
|
|
3478
3479
|
*/
|
|
3479
3480
|
setSDKProcessingMetadata(t) {
|
|
3480
|
-
return this._sdkProcessingMetadata =
|
|
3481
|
+
return this._sdkProcessingMetadata = ct(this._sdkProcessingMetadata, t, 2), this;
|
|
3481
3482
|
}
|
|
3482
3483
|
/**
|
|
3483
3484
|
* @inheritDoc
|
|
@@ -3485,7 +3486,7 @@ class Mt {
|
|
|
3485
3486
|
setPropagationContext(t) {
|
|
3486
3487
|
return this._propagationContext = {
|
|
3487
3488
|
// eslint-disable-next-line deprecation/deprecation
|
|
3488
|
-
spanId:
|
|
3489
|
+
spanId: It(),
|
|
3489
3490
|
...t
|
|
3490
3491
|
}, this;
|
|
3491
3492
|
}
|
|
@@ -3552,10 +3553,10 @@ class Mt {
|
|
|
3552
3553
|
}
|
|
3553
3554
|
const ce = Mt;
|
|
3554
3555
|
function lo() {
|
|
3555
|
-
return
|
|
3556
|
+
return nt("defaultCurrentScope", () => new ce());
|
|
3556
3557
|
}
|
|
3557
3558
|
function Ao() {
|
|
3558
|
-
return
|
|
3559
|
+
return nt("defaultIsolationScope", () => new ce());
|
|
3559
3560
|
}
|
|
3560
3561
|
class fo {
|
|
3561
3562
|
constructor(t, n) {
|
|
@@ -3575,7 +3576,7 @@ class fo {
|
|
|
3575
3576
|
} catch (o) {
|
|
3576
3577
|
throw this._popScope(), o;
|
|
3577
3578
|
}
|
|
3578
|
-
return
|
|
3579
|
+
return st(r) ? r.then(
|
|
3579
3580
|
(o) => (this._popScope(), o),
|
|
3580
3581
|
(o) => {
|
|
3581
3582
|
throw this._popScope(), o;
|
|
@@ -3634,36 +3635,36 @@ function po(e, t) {
|
|
|
3634
3635
|
const n = ve();
|
|
3635
3636
|
return n.withScope(() => (n.getStackTop().scope = e, t(e)));
|
|
3636
3637
|
}
|
|
3637
|
-
function
|
|
3638
|
+
function yn(e) {
|
|
3638
3639
|
return ve().withScope(() => e(ve().getIsolationScope()));
|
|
3639
3640
|
}
|
|
3640
3641
|
function go() {
|
|
3641
3642
|
return {
|
|
3642
|
-
withIsolationScope:
|
|
3643
|
+
withIsolationScope: yn,
|
|
3643
3644
|
withScope: ho,
|
|
3644
3645
|
withSetScope: po,
|
|
3645
|
-
withSetIsolationScope: (e, t) =>
|
|
3646
|
+
withSetIsolationScope: (e, t) => yn(t),
|
|
3646
3647
|
getCurrentScope: () => ve().getScope(),
|
|
3647
3648
|
getIsolationScope: () => ve().getIsolationScope()
|
|
3648
3649
|
};
|
|
3649
3650
|
}
|
|
3650
|
-
function
|
|
3651
|
+
function Yn(e) {
|
|
3651
3652
|
const t = Nt(e);
|
|
3652
3653
|
return t.acs ? t.acs : go();
|
|
3653
3654
|
}
|
|
3654
|
-
function
|
|
3655
|
+
function Vn() {
|
|
3655
3656
|
const e = Ot();
|
|
3656
|
-
return
|
|
3657
|
+
return Yn(e).getCurrentScope();
|
|
3657
3658
|
}
|
|
3658
3659
|
function yo() {
|
|
3659
3660
|
const e = Ot();
|
|
3660
|
-
return
|
|
3661
|
+
return Yn(e).getIsolationScope();
|
|
3661
3662
|
}
|
|
3662
3663
|
function mo() {
|
|
3663
|
-
return
|
|
3664
|
+
return nt("globalScope", () => new ce());
|
|
3664
3665
|
}
|
|
3665
3666
|
function xt() {
|
|
3666
|
-
return
|
|
3667
|
+
return Vn().getClient();
|
|
3667
3668
|
}
|
|
3668
3669
|
function Co(e) {
|
|
3669
3670
|
const t = e.getPropagationContext(), { traceId: n, spanId: r, parentSpanId: o } = t;
|
|
@@ -3699,31 +3700,31 @@ function wo(e) {
|
|
|
3699
3700
|
return n;
|
|
3700
3701
|
}
|
|
3701
3702
|
function To(e) {
|
|
3702
|
-
if (!(!e || !
|
|
3703
|
+
if (!(!e || !qn(e) && !Array.isArray(e)))
|
|
3703
3704
|
return Array.isArray(e) ? e.reduce((t, n) => {
|
|
3704
|
-
const r =
|
|
3705
|
+
const r = mn(n);
|
|
3705
3706
|
return Object.entries(r).forEach(([o, i]) => {
|
|
3706
3707
|
t[o] = i;
|
|
3707
3708
|
}), t;
|
|
3708
|
-
}, {}) :
|
|
3709
|
+
}, {}) : mn(e);
|
|
3709
3710
|
}
|
|
3710
|
-
function
|
|
3711
|
+
function mn(e) {
|
|
3711
3712
|
return e.split(",").map((t) => t.split("=").map((n) => decodeURIComponent(n.trim()))).reduce((t, [n, r]) => (n && r && (t[n] = r), t), {});
|
|
3712
3713
|
}
|
|
3713
3714
|
const Lo = 1;
|
|
3714
|
-
let
|
|
3715
|
+
let Cn = !1;
|
|
3715
3716
|
function Ro(e) {
|
|
3716
|
-
const { spanId: t, traceId: n, isRemote: r } = e.spanContext(), o = r ? t : Ut(e).parent_span_id, i = r ?
|
|
3717
|
+
const { spanId: t, traceId: n, isRemote: r } = e.spanContext(), o = r ? t : Ut(e).parent_span_id, i = r ? It() : t;
|
|
3717
3718
|
return V({
|
|
3718
3719
|
parent_span_id: o,
|
|
3719
3720
|
span_id: i,
|
|
3720
3721
|
trace_id: n
|
|
3721
3722
|
});
|
|
3722
3723
|
}
|
|
3723
|
-
function
|
|
3724
|
-
return typeof e == "number" ?
|
|
3724
|
+
function bn(e) {
|
|
3725
|
+
return typeof e == "number" ? En(e) : Array.isArray(e) ? e[0] + e[1] / 1e9 : e instanceof Date ? En(e.getTime()) : Wn();
|
|
3725
3726
|
}
|
|
3726
|
-
function
|
|
3727
|
+
function En(e) {
|
|
3727
3728
|
return e > 9999999999 ? e / 1e3 : e;
|
|
3728
3729
|
}
|
|
3729
3730
|
function Ut(e) {
|
|
@@ -3739,9 +3740,9 @@ function Ut(e) {
|
|
|
3739
3740
|
data: r,
|
|
3740
3741
|
description: i,
|
|
3741
3742
|
parent_span_id: u,
|
|
3742
|
-
start_timestamp:
|
|
3743
|
+
start_timestamp: bn(o),
|
|
3743
3744
|
// This is [0,0] by default in OTEL, in which case we want to interpret this as no end time
|
|
3744
|
-
timestamp:
|
|
3745
|
+
timestamp: bn(c) || void 0,
|
|
3745
3746
|
status: Mo(l),
|
|
3746
3747
|
op: r[Bo],
|
|
3747
3748
|
origin: r[So],
|
|
@@ -3772,15 +3773,15 @@ function Mo(e) {
|
|
|
3772
3773
|
return e.code === Qo ? "ok" : e.message || "unknown_error";
|
|
3773
3774
|
}
|
|
3774
3775
|
const xo = "_sentryRootSpan";
|
|
3775
|
-
function
|
|
3776
|
+
function Zn(e) {
|
|
3776
3777
|
return e[xo] || e;
|
|
3777
3778
|
}
|
|
3778
3779
|
function Uo() {
|
|
3779
|
-
|
|
3780
|
+
Cn || (rt(() => {
|
|
3780
3781
|
console.warn(
|
|
3781
3782
|
"[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly."
|
|
3782
3783
|
);
|
|
3783
|
-
}),
|
|
3784
|
+
}), Cn = !0);
|
|
3784
3785
|
}
|
|
3785
3786
|
function Fo(e) {
|
|
3786
3787
|
if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__)
|
|
@@ -3788,10 +3789,10 @@ function Fo(e) {
|
|
|
3788
3789
|
const t = xt(), n = t && t.getOptions();
|
|
3789
3790
|
return !!n && (n.enableTracing || "tracesSampleRate" in n || "tracesSampler" in n);
|
|
3790
3791
|
}
|
|
3791
|
-
const
|
|
3792
|
-
function
|
|
3792
|
+
const $n = "production", Xo = "_frozenDsc";
|
|
3793
|
+
function er(e, t) {
|
|
3793
3794
|
const n = t.getOptions(), { publicKey: r } = t.getDsn() || {}, o = V({
|
|
3794
|
-
environment: n.environment ||
|
|
3795
|
+
environment: n.environment || $n,
|
|
3795
3796
|
release: n.release,
|
|
3796
3797
|
public_key: r,
|
|
3797
3798
|
trace_id: e
|
|
@@ -3800,22 +3801,22 @@ function Zn(e, t) {
|
|
|
3800
3801
|
}
|
|
3801
3802
|
function Ho(e, t) {
|
|
3802
3803
|
const n = t.getPropagationContext();
|
|
3803
|
-
return n.dsc ||
|
|
3804
|
+
return n.dsc || er(n.traceId, e);
|
|
3804
3805
|
}
|
|
3805
3806
|
function jo(e) {
|
|
3806
3807
|
const t = xt();
|
|
3807
3808
|
if (!t)
|
|
3808
3809
|
return {};
|
|
3809
|
-
const n =
|
|
3810
|
+
const n = Zn(e), r = n[Xo];
|
|
3810
3811
|
if (r)
|
|
3811
3812
|
return r;
|
|
3812
3813
|
const o = n.spanContext().traceState, i = o && o.get("sentry.dsc"), c = i && wo(i);
|
|
3813
3814
|
if (c)
|
|
3814
3815
|
return c;
|
|
3815
|
-
const u =
|
|
3816
|
+
const u = er(e.spanContext().traceId, t), l = Ut(n), h = l.data || {}, y = h[Io];
|
|
3816
3817
|
y != null && (u.sample_rate = `${y}`);
|
|
3817
|
-
const
|
|
3818
|
-
return
|
|
3818
|
+
const m = h[vo], b = l.description;
|
|
3819
|
+
return m !== "url" && b && (u.transaction = b), Fo() && (u.sampled = String(Do(n))), t.emit("createDsc", u, n), u;
|
|
3819
3820
|
}
|
|
3820
3821
|
function Jo(e) {
|
|
3821
3822
|
if (typeof e == "boolean")
|
|
@@ -3835,14 +3836,14 @@ const qo = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
|
|
|
3835
3836
|
function zo(e) {
|
|
3836
3837
|
return e === "http" || e === "https";
|
|
3837
3838
|
}
|
|
3838
|
-
function
|
|
3839
|
+
function ut(e, t = !1) {
|
|
3839
3840
|
const { host: n, path: r, pass: o, port: i, projectId: c, protocol: u, publicKey: l } = e;
|
|
3840
3841
|
return `${u}://${l}${t && o ? `:${o}` : ""}@${n}${i ? `:${i}` : ""}/${r && `${r}/`}${c}`;
|
|
3841
3842
|
}
|
|
3842
3843
|
function Ko(e) {
|
|
3843
3844
|
const t = qo.exec(e);
|
|
3844
3845
|
if (!t) {
|
|
3845
|
-
|
|
3846
|
+
rt(() => {
|
|
3846
3847
|
console.error(`Invalid Sentry Dsn: ${e}`);
|
|
3847
3848
|
});
|
|
3848
3849
|
return;
|
|
@@ -3851,12 +3852,12 @@ function Ko(e) {
|
|
|
3851
3852
|
let l = "", h = u;
|
|
3852
3853
|
const y = h.split("/");
|
|
3853
3854
|
if (y.length > 1 && (l = y.slice(0, -1).join("/"), h = y.pop()), h) {
|
|
3854
|
-
const
|
|
3855
|
-
|
|
3855
|
+
const m = h.match(/^\d+/);
|
|
3856
|
+
m && (h = m[0]);
|
|
3856
3857
|
}
|
|
3857
|
-
return
|
|
3858
|
+
return tr({ host: i, pass: o, path: l, projectId: h, port: c, protocol: n, publicKey: r });
|
|
3858
3859
|
}
|
|
3859
|
-
function
|
|
3860
|
+
function tr(e) {
|
|
3860
3861
|
return {
|
|
3861
3862
|
protocol: e.protocol,
|
|
3862
3863
|
publicKey: e.publicKey || "",
|
|
@@ -3874,7 +3875,7 @@ function Go(e) {
|
|
|
3874
3875
|
return ["protocol", "publicKey", "host", "projectId"].find((c) => e[c] ? !1 : (N.error(`Invalid Sentry Dsn: ${c} missing`), !0)) ? !1 : n.match(/^\d+$/) ? zo(r) ? t && isNaN(parseInt(t, 10)) ? (N.error(`Invalid Sentry Dsn: Invalid port ${t}`), !1) : !0 : (N.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), !1) : (N.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), !1);
|
|
3875
3876
|
}
|
|
3876
3877
|
function Wo(e) {
|
|
3877
|
-
const t = typeof e == "string" ? Ko(e) :
|
|
3878
|
+
const t = typeof e == "string" ? Ko(e) : tr(e);
|
|
3878
3879
|
if (!(!t || !Go(t)))
|
|
3879
3880
|
return t;
|
|
3880
3881
|
}
|
|
@@ -3902,16 +3903,16 @@ function Yo() {
|
|
|
3902
3903
|
}
|
|
3903
3904
|
function oe(e, t = 100, n = 1 / 0) {
|
|
3904
3905
|
try {
|
|
3905
|
-
return
|
|
3906
|
+
return St("", e, t, n);
|
|
3906
3907
|
} catch (r) {
|
|
3907
3908
|
return { ERROR: `**non-serializable** (${r})` };
|
|
3908
3909
|
}
|
|
3909
3910
|
}
|
|
3910
|
-
function
|
|
3911
|
+
function nr(e, t = 3, n = 100 * 1024) {
|
|
3911
3912
|
const r = oe(e, t);
|
|
3912
|
-
return es(r) > n ?
|
|
3913
|
+
return es(r) > n ? nr(e, t - 1, n) : r;
|
|
3913
3914
|
}
|
|
3914
|
-
function
|
|
3915
|
+
function St(e, t, n = 1 / 0, r = 1 / 0, o = Yo()) {
|
|
3915
3916
|
const [i, c] = o;
|
|
3916
3917
|
if (t == null || // this matches null and undefined -> eqeq not eqeqeq
|
|
3917
3918
|
["boolean", "string"].includes(typeof t) || typeof t == "number" && Number.isFinite(t))
|
|
@@ -3930,21 +3931,21 @@ function Bt(e, t, n = 1 / 0, r = 1 / 0, o = Yo()) {
|
|
|
3930
3931
|
if (h && typeof h.toJSON == "function")
|
|
3931
3932
|
try {
|
|
3932
3933
|
const I = h.toJSON();
|
|
3933
|
-
return
|
|
3934
|
+
return St("", I, l - 1, r, o);
|
|
3934
3935
|
} catch {
|
|
3935
3936
|
}
|
|
3936
3937
|
const y = Array.isArray(t) ? [] : {};
|
|
3937
|
-
let
|
|
3938
|
-
const b =
|
|
3938
|
+
let m = 0;
|
|
3939
|
+
const b = Kn(t);
|
|
3939
3940
|
for (const I in b) {
|
|
3940
3941
|
if (!Object.prototype.hasOwnProperty.call(b, I))
|
|
3941
3942
|
continue;
|
|
3942
|
-
if (
|
|
3943
|
+
if (m >= r) {
|
|
3943
3944
|
y[I] = "[MaxProperties ~]";
|
|
3944
3945
|
break;
|
|
3945
3946
|
}
|
|
3946
3947
|
const B = b[I];
|
|
3947
|
-
y[I] =
|
|
3948
|
+
y[I] = St(I, B, l - 1, r, o), m++;
|
|
3948
3949
|
}
|
|
3949
3950
|
return c(t), y;
|
|
3950
3951
|
}
|
|
@@ -3995,7 +3996,7 @@ function ts(e, t) {
|
|
|
3995
3996
|
const [n, r] = e;
|
|
3996
3997
|
return [n, [...r, t]];
|
|
3997
3998
|
}
|
|
3998
|
-
function
|
|
3999
|
+
function vn(e, t) {
|
|
3999
4000
|
const n = e[1];
|
|
4000
4001
|
for (const r of n) {
|
|
4001
4002
|
const o = r[0].type;
|
|
@@ -4004,14 +4005,14 @@ function bn(e, t) {
|
|
|
4004
4005
|
}
|
|
4005
4006
|
return !1;
|
|
4006
4007
|
}
|
|
4007
|
-
function
|
|
4008
|
+
function _t(e) {
|
|
4008
4009
|
return j.__SENTRY__ && j.__SENTRY__.encodePolyfill ? j.__SENTRY__.encodePolyfill(e) : new TextEncoder().encode(e);
|
|
4009
4010
|
}
|
|
4010
4011
|
function ns(e) {
|
|
4011
4012
|
const [t, n] = e;
|
|
4012
4013
|
let r = JSON.stringify(t);
|
|
4013
4014
|
function o(i) {
|
|
4014
|
-
typeof r == "string" ? r = typeof i == "string" ? r + i : [
|
|
4015
|
+
typeof r == "string" ? r = typeof i == "string" ? r + i : [_t(r), i] : r.push(typeof i == "string" ? _t(i) : i);
|
|
4015
4016
|
}
|
|
4016
4017
|
for (const i of n) {
|
|
4017
4018
|
const [c, u] = i;
|
|
@@ -4039,7 +4040,7 @@ function rs(e) {
|
|
|
4039
4040
|
return n;
|
|
4040
4041
|
}
|
|
4041
4042
|
function os(e) {
|
|
4042
|
-
const t = typeof e.data == "string" ?
|
|
4043
|
+
const t = typeof e.data == "string" ? _t(e.data) : e.data;
|
|
4043
4044
|
return [
|
|
4044
4045
|
V({
|
|
4045
4046
|
type: "attachment",
|
|
@@ -4069,10 +4070,10 @@ const ss = {
|
|
|
4069
4070
|
statsd: "metric_bucket",
|
|
4070
4071
|
raw_security: "security"
|
|
4071
4072
|
};
|
|
4072
|
-
function
|
|
4073
|
+
function In(e) {
|
|
4073
4074
|
return ss[e];
|
|
4074
4075
|
}
|
|
4075
|
-
function
|
|
4076
|
+
function rr(e) {
|
|
4076
4077
|
if (!e || !e.sdk)
|
|
4077
4078
|
return;
|
|
4078
4079
|
const { name: t, version: n } = e.sdk;
|
|
@@ -4084,7 +4085,7 @@ function is(e, t, n, r) {
|
|
|
4084
4085
|
event_id: e.event_id,
|
|
4085
4086
|
sent_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4086
4087
|
...t && { sdk: t },
|
|
4087
|
-
...!!n && r && { dsn:
|
|
4088
|
+
...!!n && r && { dsn: ut(r) },
|
|
4088
4089
|
...o && {
|
|
4089
4090
|
trace: V({ ...o })
|
|
4090
4091
|
}
|
|
@@ -4094,37 +4095,37 @@ function as(e, t) {
|
|
|
4094
4095
|
return t && (e.sdk = e.sdk || {}, e.sdk.name = e.sdk.name || t.name, e.sdk.version = e.sdk.version || t.version, e.sdk.integrations = [...e.sdk.integrations || [], ...t.integrations || []], e.sdk.packages = [...e.sdk.packages || [], ...t.packages || []]), e;
|
|
4095
4096
|
}
|
|
4096
4097
|
function cs(e, t, n, r) {
|
|
4097
|
-
const o =
|
|
4098
|
+
const o = rr(n), i = {
|
|
4098
4099
|
sent_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4099
4100
|
...o && { sdk: o },
|
|
4100
|
-
...!!r && t && { dsn:
|
|
4101
|
+
...!!r && t && { dsn: ut(t) }
|
|
4101
4102
|
}, c = "aggregates" in e ? [{ type: "sessions" }, e] : [{ type: "session" }, e.toJSON()];
|
|
4102
4103
|
return we(i, [c]);
|
|
4103
4104
|
}
|
|
4104
4105
|
function us(e, t, n, r) {
|
|
4105
|
-
const o =
|
|
4106
|
+
const o = rr(n), i = e.type && e.type !== "replay_event" ? e.type : "event";
|
|
4106
4107
|
as(e, n && n.sdk);
|
|
4107
4108
|
const c = is(e, o, r, t);
|
|
4108
4109
|
return delete e.sdkProcessingMetadata, we(c, [[{ type: i }, e]]);
|
|
4109
4110
|
}
|
|
4110
|
-
function
|
|
4111
|
+
function Qt(e, t, n, r = 0) {
|
|
4111
4112
|
return new G((o, i) => {
|
|
4112
4113
|
const c = e[r];
|
|
4113
4114
|
if (t === null || typeof c != "function")
|
|
4114
4115
|
o(t);
|
|
4115
4116
|
else {
|
|
4116
4117
|
const u = c({ ...t }, n);
|
|
4117
|
-
U && c.id && u === null && N.log(`Event processor "${c.id}" dropped event`),
|
|
4118
|
+
U && c.id && u === null && N.log(`Event processor "${c.id}" dropped event`), st(u) ? u.then((l) => Qt(e, l, n, r + 1).then(o)).then(null, i) : Qt(e, u, n, r + 1).then(o).then(null, i);
|
|
4118
4119
|
}
|
|
4119
4120
|
});
|
|
4120
4121
|
}
|
|
4121
|
-
let Ne,
|
|
4122
|
+
let Ne, Bn, De;
|
|
4122
4123
|
function ls(e) {
|
|
4123
4124
|
const t = j._sentryDebugIds;
|
|
4124
4125
|
if (!t)
|
|
4125
4126
|
return {};
|
|
4126
4127
|
const n = Object.keys(t);
|
|
4127
|
-
return De && n.length ===
|
|
4128
|
+
return De && n.length === Bn || (Bn = n.length, De = n.reduce((r, o) => {
|
|
4128
4129
|
Ne || (Ne = {});
|
|
4129
4130
|
const i = Ne[o];
|
|
4130
4131
|
if (i)
|
|
@@ -4146,7 +4147,7 @@ function As(e, t) {
|
|
|
4146
4147
|
const { fingerprint: n, span: r, breadcrumbs: o, sdkProcessingMetadata: i } = t;
|
|
4147
4148
|
ds(e, t), r && ps(e, r), gs(e, n), fs(e, o), hs(e, i);
|
|
4148
4149
|
}
|
|
4149
|
-
function
|
|
4150
|
+
function Sn(e, t) {
|
|
4150
4151
|
const {
|
|
4151
4152
|
extra: n,
|
|
4152
4153
|
tags: r,
|
|
@@ -4157,15 +4158,15 @@ function In(e, t) {
|
|
|
4157
4158
|
breadcrumbs: l,
|
|
4158
4159
|
fingerprint: h,
|
|
4159
4160
|
eventProcessors: y,
|
|
4160
|
-
attachments:
|
|
4161
|
+
attachments: m,
|
|
4161
4162
|
propagationContext: b,
|
|
4162
4163
|
transactionName: I,
|
|
4163
4164
|
span: B
|
|
4164
4165
|
} = t;
|
|
4165
|
-
Me(e, "extra", n), Me(e, "tags", r), Me(e, "user", o), Me(e, "contexts", i), e.sdkProcessingMetadata =
|
|
4166
|
+
Me(e, "extra", n), Me(e, "tags", r), Me(e, "user", o), Me(e, "contexts", i), e.sdkProcessingMetadata = ct(e.sdkProcessingMetadata, u, 2), c && (e.level = c), I && (e.transactionName = I), B && (e.span = B), l.length && (e.breadcrumbs = [...e.breadcrumbs, ...l]), h.length && (e.fingerprint = [...e.fingerprint, ...h]), y.length && (e.eventProcessors = [...e.eventProcessors, ...y]), m.length && (e.attachments = [...e.attachments, ...m]), e.propagationContext = { ...e.propagationContext, ...b };
|
|
4166
4167
|
}
|
|
4167
4168
|
function Me(e, t, n) {
|
|
4168
|
-
e[t] =
|
|
4169
|
+
e[t] = ct(e[t], n, 1);
|
|
4169
4170
|
}
|
|
4170
4171
|
function ds(e, t) {
|
|
4171
4172
|
const { extra: n, tags: r, user: o, contexts: i, level: c, transactionName: u } = t, l = V(n);
|
|
@@ -4174,8 +4175,8 @@ function ds(e, t) {
|
|
|
4174
4175
|
h && Object.keys(h).length && (e.tags = { ...h, ...e.tags });
|
|
4175
4176
|
const y = V(o);
|
|
4176
4177
|
y && Object.keys(y).length && (e.user = { ...y, ...e.user });
|
|
4177
|
-
const
|
|
4178
|
-
|
|
4178
|
+
const m = V(i);
|
|
4179
|
+
m && Object.keys(m).length && (e.contexts = { ...m, ...e.contexts }), c && (e.level = c), u && e.type !== "transaction" && (e.transaction = u);
|
|
4179
4180
|
}
|
|
4180
4181
|
function fs(e, t) {
|
|
4181
4182
|
const n = [...e.breadcrumbs || [], ...t];
|
|
@@ -4195,7 +4196,7 @@ function ps(e, t) {
|
|
|
4195
4196
|
dynamicSamplingContext: jo(t),
|
|
4196
4197
|
...e.sdkProcessingMetadata
|
|
4197
4198
|
};
|
|
4198
|
-
const n =
|
|
4199
|
+
const n = Zn(t), r = Ut(n).description;
|
|
4199
4200
|
r && !e.transaction && e.type === "transaction" && (e.transaction = r);
|
|
4200
4201
|
}
|
|
4201
4202
|
function gs(e, t) {
|
|
@@ -4205,32 +4206,32 @@ function ys(e, t, n, r, o, i) {
|
|
|
4205
4206
|
const { normalizeDepth: c = 3, normalizeMaxBreadth: u = 1e3 } = e, l = {
|
|
4206
4207
|
...t,
|
|
4207
4208
|
event_id: t.event_id || n.event_id || te(),
|
|
4208
|
-
timestamp: t.timestamp ||
|
|
4209
|
+
timestamp: t.timestamp || at()
|
|
4209
4210
|
}, h = n.integrations || e.integrations.map((S) => S.name);
|
|
4210
4211
|
ms(l, e), Es(l, h), o && o.emit("applyFrameMetadata", t), t.type === void 0 && Cs(l, e.stackParser);
|
|
4211
4212
|
const y = Is(r, n.captureContext);
|
|
4212
4213
|
n.mechanism && _e(l, n.mechanism);
|
|
4213
|
-
const
|
|
4214
|
+
const m = o ? o.getEventProcessors() : [], b = mo().getScopeData();
|
|
4214
4215
|
if (i) {
|
|
4215
4216
|
const S = i.getScopeData();
|
|
4216
|
-
|
|
4217
|
+
Sn(b, S);
|
|
4217
4218
|
}
|
|
4218
4219
|
if (y) {
|
|
4219
4220
|
const S = y.getScopeData();
|
|
4220
|
-
|
|
4221
|
+
Sn(b, S);
|
|
4221
4222
|
}
|
|
4222
4223
|
const I = [...n.attachments || [], ...b.attachments];
|
|
4223
4224
|
I.length && (n.attachments = I), As(l, b);
|
|
4224
4225
|
const B = [
|
|
4225
|
-
...
|
|
4226
|
+
...m,
|
|
4226
4227
|
// Run scope event processors _after_ all other processors
|
|
4227
4228
|
...b.eventProcessors
|
|
4228
4229
|
];
|
|
4229
|
-
return
|
|
4230
|
+
return Qt(B, l, n).then((S) => (S && bs(S), typeof c == "number" && c > 0 ? vs(S, c, u) : S));
|
|
4230
4231
|
}
|
|
4231
4232
|
function ms(e, t) {
|
|
4232
4233
|
const { environment: n, release: r, dist: o, maxValueLength: i = 250 } = t;
|
|
4233
|
-
e.environment = e.environment || n ||
|
|
4234
|
+
e.environment = e.environment || n || $n, !e.release && r && (e.release = r), !e.dist && o && (e.dist = o), e.message && (e.message = Se(e.message, i));
|
|
4234
4235
|
const c = e.exception && e.exception.values && e.exception.values[0];
|
|
4235
4236
|
c && c.value && (c.value = Se(c.value, i));
|
|
4236
4237
|
const u = e.request;
|
|
@@ -4325,23 +4326,23 @@ function Qs(e, t) {
|
|
|
4325
4326
|
function ks(e, t, n) {
|
|
4326
4327
|
return t || `${_s(e)}?${Qs(e, n)}`;
|
|
4327
4328
|
}
|
|
4328
|
-
const
|
|
4329
|
+
const _n = [];
|
|
4329
4330
|
function Ps(e, t) {
|
|
4330
4331
|
const n = {};
|
|
4331
4332
|
return t.forEach((r) => {
|
|
4332
|
-
r &&
|
|
4333
|
+
r && or(e, r, n);
|
|
4333
4334
|
}), n;
|
|
4334
4335
|
}
|
|
4335
|
-
function
|
|
4336
|
+
function Qn(e, t) {
|
|
4336
4337
|
for (const n of t)
|
|
4337
4338
|
n && n.afterAllSetup && n.afterAllSetup(e);
|
|
4338
4339
|
}
|
|
4339
|
-
function
|
|
4340
|
+
function or(e, t, n) {
|
|
4340
4341
|
if (n[t.name]) {
|
|
4341
4342
|
U && N.log(`Integration skipped because it was already installed: ${t.name}`);
|
|
4342
4343
|
return;
|
|
4343
4344
|
}
|
|
4344
|
-
if (n[t.name] = t,
|
|
4345
|
+
if (n[t.name] = t, _n.indexOf(t.name) === -1 && typeof t.setupOnce == "function" && (t.setupOnce(), _n.push(t.name)), t.setup && typeof t.setup == "function" && t.setup(e), typeof t.preprocessEvent == "function") {
|
|
4345
4346
|
const r = t.preprocessEvent.bind(t);
|
|
4346
4347
|
e.on("preprocessEvent", (o, i) => r(o, i, e));
|
|
4347
4348
|
}
|
|
@@ -4357,7 +4358,7 @@ function ws(e, t, n) {
|
|
|
4357
4358
|
const r = [
|
|
4358
4359
|
{ type: "client_report" },
|
|
4359
4360
|
{
|
|
4360
|
-
timestamp:
|
|
4361
|
+
timestamp: at(),
|
|
4361
4362
|
discarded_events: e
|
|
4362
4363
|
}
|
|
4363
4364
|
];
|
|
@@ -4368,7 +4369,7 @@ class Y extends Error {
|
|
|
4368
4369
|
super(t), this.message = t, this.logLevel = n;
|
|
4369
4370
|
}
|
|
4370
4371
|
}
|
|
4371
|
-
const
|
|
4372
|
+
const kn = "Not capturing exception because it's already been captured.";
|
|
4372
4373
|
class Ts {
|
|
4373
4374
|
/** Options passed to the SDK. */
|
|
4374
4375
|
/** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
|
|
@@ -4396,7 +4397,7 @@ class Ts {
|
|
|
4396
4397
|
});
|
|
4397
4398
|
}
|
|
4398
4399
|
const r = ["enableTracing", "tracesSampleRate", "tracesSampler"].find((o) => o in t && t[o] == null);
|
|
4399
|
-
r &&
|
|
4400
|
+
r && rt(() => {
|
|
4400
4401
|
console.warn(
|
|
4401
4402
|
`[Sentry] Deprecation warning: \`${r}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`
|
|
4402
4403
|
);
|
|
@@ -4407,8 +4408,8 @@ class Ts {
|
|
|
4407
4408
|
*/
|
|
4408
4409
|
captureException(t, n, r) {
|
|
4409
4410
|
const o = te();
|
|
4410
|
-
if (
|
|
4411
|
-
return U && N.log(
|
|
4411
|
+
if (fn(t))
|
|
4412
|
+
return U && N.log(kn), o;
|
|
4412
4413
|
const i = {
|
|
4413
4414
|
event_id: o,
|
|
4414
4415
|
...n
|
|
@@ -4434,8 +4435,8 @@ class Ts {
|
|
|
4434
4435
|
*/
|
|
4435
4436
|
captureEvent(t, n, r) {
|
|
4436
4437
|
const o = te();
|
|
4437
|
-
if (n && n.originalException &&
|
|
4438
|
-
return U && N.log(
|
|
4438
|
+
if (n && n.originalException && fn(n.originalException))
|
|
4439
|
+
return U && N.log(kn), o;
|
|
4439
4440
|
const i = {
|
|
4440
4441
|
event_id: o,
|
|
4441
4442
|
...n
|
|
@@ -4446,7 +4447,7 @@ class Ts {
|
|
|
4446
4447
|
* @inheritDoc
|
|
4447
4448
|
*/
|
|
4448
4449
|
captureSession(t) {
|
|
4449
|
-
typeof t.release != "string" ? U && N.warn("Discarded session because of missing or non-string release") : (this.sendSession(t),
|
|
4450
|
+
typeof t.release != "string" ? U && N.warn("Discarded session because of missing or non-string release") : (this.sendSession(t), vt(t, { init: !1 }));
|
|
4450
4451
|
}
|
|
4451
4452
|
/**
|
|
4452
4453
|
* @inheritDoc
|
|
@@ -4517,7 +4518,7 @@ class Ts {
|
|
|
4517
4518
|
*/
|
|
4518
4519
|
addIntegration(t) {
|
|
4519
4520
|
const n = this._integrations[t.name];
|
|
4520
|
-
|
|
4521
|
+
or(this, t, this._integrations), n || Qn(this, [t]);
|
|
4521
4522
|
}
|
|
4522
4523
|
/**
|
|
4523
4524
|
* @inheritDoc
|
|
@@ -4573,7 +4574,7 @@ class Ts {
|
|
|
4573
4574
|
/** Setup integrations for this client. */
|
|
4574
4575
|
_setupIntegrations() {
|
|
4575
4576
|
const { integrations: t } = this._options;
|
|
4576
|
-
this._integrations = Ps(this, t),
|
|
4577
|
+
this._integrations = Ps(this, t), Qn(this, t);
|
|
4577
4578
|
}
|
|
4578
4579
|
/** Updates existing session based on the provided event */
|
|
4579
4580
|
_updateSessionFromEvent(t, n) {
|
|
@@ -4590,7 +4591,7 @@ class Ts {
|
|
|
4590
4591
|
}
|
|
4591
4592
|
}
|
|
4592
4593
|
const c = t.status === "ok";
|
|
4593
|
-
(c && t.errors === 0 || c && r) && (
|
|
4594
|
+
(c && t.errors === 0 || c && r) && (vt(t, {
|
|
4594
4595
|
...r && { status: "crashed" },
|
|
4595
4596
|
errors: t.errors || Number(o || r)
|
|
4596
4597
|
}), this.captureSession(t));
|
|
@@ -4631,7 +4632,7 @@ class Ts {
|
|
|
4631
4632
|
* @param currentScope A scope containing event metadata.
|
|
4632
4633
|
* @returns A new event with more information.
|
|
4633
4634
|
*/
|
|
4634
|
-
_prepareEvent(t, n, r =
|
|
4635
|
+
_prepareEvent(t, n, r = Vn(), o = yo()) {
|
|
4635
4636
|
const i = this.getOptions(), c = Object.keys(this._integrations);
|
|
4636
4637
|
return !n.integrations && c.length > 0 && (n.integrations = c), this.emit("preprocessEvent", t, n), t.type || o.setLastEventId(t.event_id || n.event_id), ys(i, t, n, r, this, o).then((u) => {
|
|
4637
4638
|
if (u === null)
|
|
@@ -4675,25 +4676,25 @@ class Ts {
|
|
|
4675
4676
|
* @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
|
|
4676
4677
|
*/
|
|
4677
4678
|
_processEvent(t, n, r) {
|
|
4678
|
-
const o = this.getOptions(), { sampleRate: i } = o, c =
|
|
4679
|
+
const o = this.getOptions(), { sampleRate: i } = o, c = ir(t), u = sr(t), l = t.type || "error", h = `before send for type \`${l}\``, y = typeof i > "u" ? void 0 : Jo(i);
|
|
4679
4680
|
if (u && typeof y == "number" && Math.random() > y)
|
|
4680
|
-
return this.recordDroppedEvent("sample_rate", "error", t),
|
|
4681
|
+
return this.recordDroppedEvent("sample_rate", "error", t), We(
|
|
4681
4682
|
new Y(
|
|
4682
4683
|
`Discarding event because it's not included in the random sample (sampling rate = ${i})`,
|
|
4683
4684
|
"log"
|
|
4684
4685
|
)
|
|
4685
4686
|
);
|
|
4686
|
-
const
|
|
4687
|
+
const m = l === "replay_event" ? "replay" : l, I = (t.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
|
|
4687
4688
|
return this._prepareEvent(t, n, r, I).then((B) => {
|
|
4688
4689
|
if (B === null)
|
|
4689
|
-
throw this.recordDroppedEvent("event_processor",
|
|
4690
|
+
throw this.recordDroppedEvent("event_processor", m, t), new Y("An event processor returned `null`, will not send event.", "log");
|
|
4690
4691
|
if (n.data && n.data.__sentry__ === !0)
|
|
4691
4692
|
return B;
|
|
4692
4693
|
const S = Rs(this, o, B, n);
|
|
4693
4694
|
return Ls(S, h);
|
|
4694
4695
|
}).then((B) => {
|
|
4695
4696
|
if (B === null) {
|
|
4696
|
-
if (this.recordDroppedEvent("before_send",
|
|
4697
|
+
if (this.recordDroppedEvent("before_send", m, t), c) {
|
|
4697
4698
|
const k = 1 + (t.spans || []).length;
|
|
4698
4699
|
this.recordDroppedEvent("before_send", "span", k);
|
|
4699
4700
|
}
|
|
@@ -4763,7 +4764,7 @@ Reason: ${B}`
|
|
|
4763
4764
|
return;
|
|
4764
4765
|
}
|
|
4765
4766
|
U && N.log("Sending outcomes:", t);
|
|
4766
|
-
const n = ws(t, this._options.tunnel &&
|
|
4767
|
+
const n = ws(t, this._options.tunnel && ut(this._dsn));
|
|
4767
4768
|
this.sendEnvelope(n);
|
|
4768
4769
|
}
|
|
4769
4770
|
/**
|
|
@@ -4772,7 +4773,7 @@ Reason: ${B}`
|
|
|
4772
4773
|
}
|
|
4773
4774
|
function Ls(e, t) {
|
|
4774
4775
|
const n = `${t} must return \`null\` or a valid event.`;
|
|
4775
|
-
if (
|
|
4776
|
+
if (st(e))
|
|
4776
4777
|
return e.then(
|
|
4777
4778
|
(r) => {
|
|
4778
4779
|
if (!Ee(r) && r !== null)
|
|
@@ -4789,9 +4790,9 @@ function Ls(e, t) {
|
|
|
4789
4790
|
}
|
|
4790
4791
|
function Rs(e, t, n, r) {
|
|
4791
4792
|
const { beforeSend: o, beforeSendTransaction: i, beforeSendSpan: c } = t;
|
|
4792
|
-
if (
|
|
4793
|
+
if (sr(n) && o)
|
|
4793
4794
|
return o(n, r);
|
|
4794
|
-
if (
|
|
4795
|
+
if (ir(n)) {
|
|
4795
4796
|
if (n.spans && c) {
|
|
4796
4797
|
const u = [];
|
|
4797
4798
|
for (const l of n.spans) {
|
|
@@ -4813,10 +4814,10 @@ function Rs(e, t, n, r) {
|
|
|
4813
4814
|
}
|
|
4814
4815
|
return n;
|
|
4815
4816
|
}
|
|
4816
|
-
function
|
|
4817
|
+
function sr(e) {
|
|
4817
4818
|
return e.type === void 0;
|
|
4818
4819
|
}
|
|
4819
|
-
function
|
|
4820
|
+
function ir(e) {
|
|
4820
4821
|
return e.type === "transaction";
|
|
4821
4822
|
}
|
|
4822
4823
|
function Os(e) {
|
|
@@ -4829,7 +4830,7 @@ function Os(e) {
|
|
|
4829
4830
|
}
|
|
4830
4831
|
function o(c) {
|
|
4831
4832
|
if (!n())
|
|
4832
|
-
return
|
|
4833
|
+
return We(new Y("Not adding Promise because buffer limit was reached."));
|
|
4833
4834
|
const u = c();
|
|
4834
4835
|
return t.indexOf(u) === -1 && t.push(u), u.then(() => r(u)).then(
|
|
4835
4836
|
null,
|
|
@@ -4845,8 +4846,8 @@ function Os(e) {
|
|
|
4845
4846
|
const y = setTimeout(() => {
|
|
4846
4847
|
c && c > 0 && u(!1);
|
|
4847
4848
|
}, c);
|
|
4848
|
-
t.forEach((
|
|
4849
|
-
he(
|
|
4849
|
+
t.forEach((m) => {
|
|
4850
|
+
he(m).then(() => {
|
|
4850
4851
|
--h || (clearTimeout(y), u(!0));
|
|
4851
4852
|
}, l);
|
|
4852
4853
|
});
|
|
@@ -4878,7 +4879,7 @@ function Us(e, { statusCode: t, headers: n }, r = Date.now()) {
|
|
|
4878
4879
|
}, i = n && n["x-sentry-rate-limits"], c = n && n["retry-after"];
|
|
4879
4880
|
if (i)
|
|
4880
4881
|
for (const u of i.trim().split(",")) {
|
|
4881
|
-
const [l, h, , , y] = u.split(":", 5),
|
|
4882
|
+
const [l, h, , , y] = u.split(":", 5), m = parseInt(l, 10), b = (isNaN(m) ? 60 : m) * 1e3;
|
|
4882
4883
|
if (!h)
|
|
4883
4884
|
o.all = r + b;
|
|
4884
4885
|
else
|
|
@@ -4896,32 +4897,32 @@ function Xs(e, t, n = Os(
|
|
|
4896
4897
|
const o = (c) => n.drain(c);
|
|
4897
4898
|
function i(c) {
|
|
4898
4899
|
const u = [];
|
|
4899
|
-
if (
|
|
4900
|
-
const I =
|
|
4900
|
+
if (vn(c, (m, b) => {
|
|
4901
|
+
const I = In(b);
|
|
4901
4902
|
if (xs(r, I)) {
|
|
4902
|
-
const B =
|
|
4903
|
+
const B = Pn(m, b);
|
|
4903
4904
|
e.recordDroppedEvent("ratelimit_backoff", I, B);
|
|
4904
4905
|
} else
|
|
4905
|
-
u.push(
|
|
4906
|
+
u.push(m);
|
|
4906
4907
|
}), u.length === 0)
|
|
4907
4908
|
return he({});
|
|
4908
|
-
const l = we(c[0], u), h = (
|
|
4909
|
-
|
|
4910
|
-
const B =
|
|
4911
|
-
e.recordDroppedEvent(
|
|
4909
|
+
const l = we(c[0], u), h = (m) => {
|
|
4910
|
+
vn(l, (b, I) => {
|
|
4911
|
+
const B = Pn(b, I);
|
|
4912
|
+
e.recordDroppedEvent(m, In(I), B);
|
|
4912
4913
|
});
|
|
4913
4914
|
}, y = () => t({ body: ns(l) }).then(
|
|
4914
|
-
(
|
|
4915
|
-
(
|
|
4916
|
-
throw h("network_error"),
|
|
4915
|
+
(m) => (m.statusCode !== void 0 && (m.statusCode < 200 || m.statusCode >= 300) && U && N.warn(`Sentry responded with status code ${m.statusCode} to sent event.`), r = Us(r, m), m),
|
|
4916
|
+
(m) => {
|
|
4917
|
+
throw h("network_error"), m;
|
|
4917
4918
|
}
|
|
4918
4919
|
);
|
|
4919
4920
|
return n.add(y).then(
|
|
4920
|
-
(
|
|
4921
|
-
(
|
|
4922
|
-
if (
|
|
4921
|
+
(m) => m,
|
|
4922
|
+
(m) => {
|
|
4923
|
+
if (m instanceof Y)
|
|
4923
4924
|
return U && N.error("Skipped sending event because buffer is full."), h("queue_overflow"), he({});
|
|
4924
|
-
throw
|
|
4925
|
+
throw m;
|
|
4925
4926
|
}
|
|
4926
4927
|
);
|
|
4927
4928
|
}
|
|
@@ -4930,7 +4931,7 @@ function Xs(e, t, n = Os(
|
|
|
4930
4931
|
flush: o
|
|
4931
4932
|
};
|
|
4932
4933
|
}
|
|
4933
|
-
function
|
|
4934
|
+
function Pn(e, t) {
|
|
4934
4935
|
if (!(t !== "event" && t !== "transaction"))
|
|
4935
4936
|
return Array.isArray(e) ? e[1] : void 0;
|
|
4936
4937
|
}
|
|
@@ -4952,7 +4953,7 @@ function Js() {
|
|
|
4952
4953
|
return "npm";
|
|
4953
4954
|
}
|
|
4954
4955
|
const xe = j, qs = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
|
|
4955
|
-
function
|
|
4956
|
+
function ar(e, t) {
|
|
4956
4957
|
const n = Ft(e, t), r = {
|
|
4957
4958
|
type: Ys(t),
|
|
4958
4959
|
value: Vs(t)
|
|
@@ -4961,12 +4962,12 @@ function sr(e, t) {
|
|
|
4961
4962
|
}
|
|
4962
4963
|
function zs(e, t, n, r) {
|
|
4963
4964
|
const o = xt(), i = o && o.getOptions().normalizeDepth, c = ri(t), u = {
|
|
4964
|
-
__serialized__:
|
|
4965
|
+
__serialized__: nr(t, i)
|
|
4965
4966
|
};
|
|
4966
4967
|
if (c)
|
|
4967
4968
|
return {
|
|
4968
4969
|
exception: {
|
|
4969
|
-
values: [
|
|
4970
|
+
values: [ar(e, c)]
|
|
4970
4971
|
},
|
|
4971
4972
|
extra: u
|
|
4972
4973
|
};
|
|
@@ -4974,7 +4975,7 @@ function zs(e, t, n, r) {
|
|
|
4974
4975
|
exception: {
|
|
4975
4976
|
values: [
|
|
4976
4977
|
{
|
|
4977
|
-
type:
|
|
4978
|
+
type: ot(t) ? t.constructor.name : r ? "UnhandledRejection" : "Error",
|
|
4978
4979
|
value: ti(t, { isUnhandledRejection: r })
|
|
4979
4980
|
}
|
|
4980
4981
|
]
|
|
@@ -4987,10 +4988,10 @@ function zs(e, t, n, r) {
|
|
|
4987
4988
|
}
|
|
4988
4989
|
return l;
|
|
4989
4990
|
}
|
|
4990
|
-
function
|
|
4991
|
+
function pt(e, t) {
|
|
4991
4992
|
return {
|
|
4992
4993
|
exception: {
|
|
4993
|
-
values: [
|
|
4994
|
+
values: [ar(e, t)]
|
|
4994
4995
|
}
|
|
4995
4996
|
};
|
|
4996
4997
|
}
|
|
@@ -5009,46 +5010,46 @@ function Gs(e) {
|
|
|
5009
5010
|
function Ws(e) {
|
|
5010
5011
|
return typeof e.framesToPop == "number" ? e.framesToPop : 0;
|
|
5011
5012
|
}
|
|
5012
|
-
function
|
|
5013
|
+
function cr(e) {
|
|
5013
5014
|
return typeof WebAssembly < "u" && typeof WebAssembly.Exception < "u" ? e instanceof WebAssembly.Exception : !1;
|
|
5014
5015
|
}
|
|
5015
5016
|
function Ys(e) {
|
|
5016
5017
|
const t = e && e.name;
|
|
5017
|
-
return !t &&
|
|
5018
|
+
return !t && cr(e) ? e.message && Array.isArray(e.message) && e.message.length == 2 ? e.message[0] : "WebAssembly.Exception" : t;
|
|
5018
5019
|
}
|
|
5019
5020
|
function Vs(e) {
|
|
5020
5021
|
const t = e && e.message;
|
|
5021
|
-
return t ? t.error && typeof t.error.message == "string" ? t.error.message :
|
|
5022
|
+
return t ? t.error && typeof t.error.message == "string" ? t.error.message : cr(e) && Array.isArray(e.message) && e.message.length == 2 ? e.message[1] : t : "No error message";
|
|
5022
5023
|
}
|
|
5023
5024
|
function Zs(e, t, n, r) {
|
|
5024
5025
|
const o = n && n.syntheticException || void 0, i = ei(e, t, o, r);
|
|
5025
5026
|
return _e(i), i.level = "error", n && n.event_id && (i.event_id = n.event_id), he(i);
|
|
5026
5027
|
}
|
|
5027
5028
|
function $s(e, t, n = "info", r, o) {
|
|
5028
|
-
const i = r && r.syntheticException || void 0, c =
|
|
5029
|
+
const i = r && r.syntheticException || void 0, c = kt(e, t, i, o);
|
|
5029
5030
|
return c.level = n, r && r.event_id && (c.event_id = r.event_id), he(c);
|
|
5030
5031
|
}
|
|
5031
5032
|
function ei(e, t, n, r, o) {
|
|
5032
5033
|
let i;
|
|
5033
|
-
if (
|
|
5034
|
-
return
|
|
5035
|
-
if (
|
|
5034
|
+
if (Jn(t) && t.error)
|
|
5035
|
+
return pt(e, t.error);
|
|
5036
|
+
if (un(t) || Wr(t)) {
|
|
5036
5037
|
const c = t;
|
|
5037
5038
|
if ("stack" in t)
|
|
5038
|
-
i =
|
|
5039
|
+
i = pt(e, t);
|
|
5039
5040
|
else {
|
|
5040
|
-
const u = c.name || (
|
|
5041
|
-
i =
|
|
5041
|
+
const u = c.name || (un(c) ? "DOMError" : "DOMException"), l = c.message ? `${u}: ${c.message}` : u;
|
|
5042
|
+
i = kt(e, l, n, r), dn(i, l);
|
|
5042
5043
|
}
|
|
5043
5044
|
return "code" in c && (i.tags = { ...i.tags, "DOMException.code": `${c.code}` }), i;
|
|
5044
5045
|
}
|
|
5045
|
-
return
|
|
5046
|
+
return jn(t) ? pt(e, t) : Ee(t) || ot(t) ? (i = zs(e, t, n, o), _e(i, {
|
|
5046
5047
|
synthetic: !0
|
|
5047
|
-
}), i) : (i =
|
|
5048
|
+
}), i) : (i = kt(e, t, n, r), dn(i, `${t}`), _e(i, {
|
|
5048
5049
|
synthetic: !0
|
|
5049
5050
|
}), i);
|
|
5050
5051
|
}
|
|
5051
|
-
function
|
|
5052
|
+
function kt(e, t, n, r) {
|
|
5052
5053
|
const o = {};
|
|
5053
5054
|
if (r && n) {
|
|
5054
5055
|
const i = Ft(e, n);
|
|
@@ -5067,7 +5068,7 @@ function Qt(e, t, n, r) {
|
|
|
5067
5068
|
}
|
|
5068
5069
|
function ti(e, { isUnhandledRejection: t }) {
|
|
5069
5070
|
const n = oo(e), r = "exception";
|
|
5070
|
-
return
|
|
5071
|
+
return Jn(e) ? `Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\`` : ot(e) ? `Event \`${ni(e)}\` (type=${e.type}) captured as ${r}` : `Object captured as ${r} with keys: ${n}`;
|
|
5071
5072
|
}
|
|
5072
5073
|
function ni(e) {
|
|
5073
5074
|
try {
|
|
@@ -5098,7 +5099,7 @@ function oi(e, {
|
|
|
5098
5099
|
version: t.sdk.version
|
|
5099
5100
|
}
|
|
5100
5101
|
},
|
|
5101
|
-
...!!n && !!r && { dsn:
|
|
5102
|
+
...!!n && !!r && { dsn: ut(r) }
|
|
5102
5103
|
}, i = si(e);
|
|
5103
5104
|
return we(o, [i]);
|
|
5104
5105
|
}
|
|
@@ -5179,7 +5180,7 @@ function ci(e) {
|
|
|
5179
5180
|
}
|
|
5180
5181
|
return n && (He[e] = n.bind(Ue));
|
|
5181
5182
|
}
|
|
5182
|
-
function
|
|
5183
|
+
function wn(e) {
|
|
5183
5184
|
He[e] = void 0;
|
|
5184
5185
|
}
|
|
5185
5186
|
function ui(e, t = ci("fetch")) {
|
|
@@ -5207,7 +5208,7 @@ function ui(e, t = ci("fetch")) {
|
|
|
5207
5208
|
...e.fetchOptions
|
|
5208
5209
|
};
|
|
5209
5210
|
if (!t)
|
|
5210
|
-
return
|
|
5211
|
+
return wn("fetch"), We("No fetch implementation available");
|
|
5211
5212
|
try {
|
|
5212
5213
|
return t(e.url, u).then((l) => (n -= c, r--, {
|
|
5213
5214
|
statusCode: l.status,
|
|
@@ -5217,13 +5218,13 @@ function ui(e, t = ci("fetch")) {
|
|
|
5217
5218
|
}
|
|
5218
5219
|
}));
|
|
5219
5220
|
} catch (l) {
|
|
5220
|
-
return
|
|
5221
|
+
return wn("fetch"), n -= c, r--, We(l);
|
|
5221
5222
|
}
|
|
5222
5223
|
}
|
|
5223
5224
|
return Xs(e, o);
|
|
5224
5225
|
}
|
|
5225
5226
|
const li = 30, Ai = 50;
|
|
5226
|
-
function
|
|
5227
|
+
function Pt(e, t, n, r) {
|
|
5227
5228
|
const o = {
|
|
5228
5229
|
filename: e,
|
|
5229
5230
|
function: t === "<anonymous>" ? be : t,
|
|
@@ -5236,7 +5237,7 @@ const di = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, fi = /^\s*at (?:(.+?\)(?: \
|
|
|
5236
5237
|
const t = di.exec(e);
|
|
5237
5238
|
if (t) {
|
|
5238
5239
|
const [, r, o, i] = t;
|
|
5239
|
-
return
|
|
5240
|
+
return Pt(r, be, +o, +i);
|
|
5240
5241
|
}
|
|
5241
5242
|
const n = fi.exec(e);
|
|
5242
5243
|
if (n) {
|
|
@@ -5244,8 +5245,8 @@ const di = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, fi = /^\s*at (?:(.+?\)(?: \
|
|
|
5244
5245
|
const c = hi.exec(n[2]);
|
|
5245
5246
|
c && (n[2] = c[1], n[3] = c[2], n[4] = c[3]);
|
|
5246
5247
|
}
|
|
5247
|
-
const [o, i] =
|
|
5248
|
-
return
|
|
5248
|
+
const [o, i] = ur(n[1] || be, n[2]);
|
|
5249
|
+
return Pt(i, o, n[3] ? +n[3] : void 0, n[4] ? +n[4] : void 0);
|
|
5249
5250
|
}
|
|
5250
5251
|
}, gi = [li, pi], yi = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i, mi = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, Ci = (e) => {
|
|
5251
5252
|
const t = yi.exec(e);
|
|
@@ -5255,63 +5256,80 @@ const di = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, fi = /^\s*at (?:(.+?\)(?: \
|
|
|
5255
5256
|
i && (t[1] = t[1] || "eval", t[3] = i[1], t[4] = i[2], t[5] = "");
|
|
5256
5257
|
}
|
|
5257
5258
|
let r = t[3], o = t[1] || be;
|
|
5258
|
-
return [o, r] =
|
|
5259
|
+
return [o, r] = ur(o, r), Pt(r, o, t[4] ? +t[4] : void 0, t[5] ? +t[5] : void 0);
|
|
5259
5260
|
}
|
|
5260
|
-
}, bi = [Ai, Ci], Ei = [gi, bi], vi = zr(...Ei),
|
|
5261
|
+
}, bi = [Ai, Ci], Ei = [gi, bi], vi = zr(...Ei), ur = (e, t) => {
|
|
5261
5262
|
const n = e.indexOf("safari-extension") !== -1, r = e.indexOf("safari-web-extension") !== -1;
|
|
5262
5263
|
return n || r ? [
|
|
5263
5264
|
e.indexOf("@") !== -1 ? e.split("@")[0] : be,
|
|
5264
5265
|
n ? `safari-extension:${t}` : `safari-web-extension:${t}`
|
|
5265
5266
|
] : [e, t];
|
|
5266
5267
|
}, Ii = "https://bbed26c9265c425abb56ff9d3728183e@sentry.chocodev.kz/302";
|
|
5267
|
-
let
|
|
5268
|
+
let wt = null;
|
|
5268
5269
|
function Bi(e) {
|
|
5269
5270
|
const t = new ii({
|
|
5270
5271
|
dsn: Ii,
|
|
5271
5272
|
transport: ui,
|
|
5272
5273
|
stackParser: vi,
|
|
5273
5274
|
integrations: [],
|
|
5274
|
-
release: "1.1.
|
|
5275
|
+
release: "1.1.48",
|
|
5275
5276
|
environment: e.environment || "production"
|
|
5276
5277
|
}), n = new ce();
|
|
5277
|
-
n.setClient(t), n.setTags(e), t.init(),
|
|
5278
|
+
n.setClient(t), n.setTags(e), t.init(), wt = n;
|
|
5278
5279
|
}
|
|
5279
5280
|
function se(e, t) {
|
|
5280
|
-
|
|
5281
|
+
wt && wt.captureException(
|
|
5281
5282
|
e,
|
|
5282
5283
|
t ? { captureContext: { extra: t } } : void 0
|
|
5283
5284
|
);
|
|
5284
5285
|
}
|
|
5285
|
-
function
|
|
5286
|
-
|
|
5286
|
+
function je(e, t) {
|
|
5287
|
+
Ct("webPayToken", e), t && Ct("webPayRefreshToken", t);
|
|
5287
5288
|
}
|
|
5288
|
-
function
|
|
5289
|
-
|
|
5289
|
+
function Tn() {
|
|
5290
|
+
Ge("webPayToken"), Ge("webPayRefreshToken");
|
|
5290
5291
|
}
|
|
5291
5292
|
async function Si(e) {
|
|
5292
|
-
const t =
|
|
5293
|
+
const t = Un("webPayRefreshToken");
|
|
5293
5294
|
if (t && e.config.clientId)
|
|
5294
5295
|
try {
|
|
5295
|
-
const
|
|
5296
|
+
const n = await Dr(
|
|
5296
5297
|
e.apiUrl,
|
|
5297
5298
|
e.config.clientId,
|
|
5298
5299
|
t
|
|
5299
5300
|
);
|
|
5300
|
-
|
|
5301
|
+
je(n.access_token, n.refresh_token), e.accessToken = n.access_token;
|
|
5301
5302
|
return;
|
|
5302
5303
|
} catch {
|
|
5303
|
-
|
|
5304
|
+
Ge("webPayRefreshToken");
|
|
5304
5305
|
}
|
|
5305
|
-
if (!e.config.
|
|
5306
|
+
if (!e.config.clientId) {
|
|
5306
5307
|
e.config.onError({ attributes: { message: e.t("errorMissingTrackClient") } });
|
|
5307
5308
|
return;
|
|
5308
5309
|
}
|
|
5309
|
-
|
|
5310
|
-
e.
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5310
|
+
if (!e.config.trackId && typeof e.config.onRequestNewTrackId == "function" && (e.config.trackId = await e.config.onRequestNewTrackId()), !e.config.trackId) {
|
|
5311
|
+
e.config.onError({ attributes: { message: e.t("errorMissingTrackClient") } });
|
|
5312
|
+
return;
|
|
5313
|
+
}
|
|
5314
|
+
try {
|
|
5315
|
+
const n = await tn(
|
|
5316
|
+
e.apiUrl,
|
|
5317
|
+
e.config.clientId,
|
|
5318
|
+
e.config.trackId
|
|
5319
|
+
);
|
|
5320
|
+
je(n.access_token, n.refresh_token), e.accessToken = n.access_token;
|
|
5321
|
+
} catch (n) {
|
|
5322
|
+
if (typeof e.config.onRequestNewTrackId == "function") {
|
|
5323
|
+
e.config.trackId = await e.config.onRequestNewTrackId();
|
|
5324
|
+
const r = await tn(
|
|
5325
|
+
e.apiUrl,
|
|
5326
|
+
e.config.clientId,
|
|
5327
|
+
e.config.trackId
|
|
5328
|
+
);
|
|
5329
|
+
je(r.access_token, r.refresh_token), e.accessToken = r.access_token;
|
|
5330
|
+
} else
|
|
5331
|
+
throw n;
|
|
5332
|
+
}
|
|
5315
5333
|
}
|
|
5316
5334
|
const _i = `<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5317
5335
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.89711 8.50443C10.4185 8.72365 10.6242 9.56386 10.7471 10.3459L10.7816 10.5699L10.8557 11.0301C11.0006 11.9088 11.303 13.7327 11.303 14.6845C11.303 14.9224 11.2806 15.105 11.2396 15.2053C11.1713 15.3599 10.9724 15.5082 10.6978 15.6319C10.0332 15.7846 9.33863 15.8671 8.62315 15.8671C8.54739 15.8671 8.47285 15.8637 8.39805 15.8616C8.10889 15.785 7.89156 15.657 7.77649 15.4821C7.42905 14.9542 7.40812 13.7781 7.40116 12.4037L7.40037 12.2443L7.39755 11.8324C7.38623 10.3774 7.37651 9.1229 7.94288 8.67272C8.16223 8.49957 8.47392 8.44225 8.89711 8.50443ZM5.58009 11.6722C5.90978 11.6548 6.12181 13.1684 6.16441 14.3162C6.19427 15.1152 6.10438 15.4439 5.96084 15.5619C5.79833 15.5113 5.63864 15.4565 5.48128 15.397C5.3763 15.219 5.29607 14.9389 5.2451 14.5721C5.08947 13.4193 5.22466 11.6925 5.58009 11.6722ZM13.8455 13.934C13.825 14.0391 13.796 14.1204 13.7602 14.1889C13.4783 14.4 13.1821 14.5938 12.872 14.7682C12.7733 14.7837 12.6856 14.7729 12.6427 14.7053C12.2318 14.0314 12.0775 11.9173 12.4752 11.7333C12.9936 11.4995 13.9224 13.5685 13.8455 13.934ZM8.50042 0C13.1296 0 16.8941 3.42166 16.9979 7.67934L17 7.82651V7.89454C16.9915 9.81778 16.2332 11.5773 14.9839 12.9392C14.9386 12.918 14.8559 12.8486 14.7062 12.6395C14.5512 12.4293 13.2148 10.5096 13.2148 8.30946C13.2148 7.87768 13.8816 7.20318 14.4717 6.61114C14.9128 6.16562 15.3306 5.74539 15.4845 5.4151C15.6804 4.98892 15.5433 4.69134 15.3265 4.59047C15.1302 4.50082 14.8355 4.56621 14.6287 4.90904C14.2893 5.46389 14.1805 5.56758 13.6855 5.93882C13.1984 6.30986 12.424 6.68338 12.424 6.19988C12.424 5.93882 12.8553 5.34757 13.0684 4.93314C13.286 4.51408 13.0515 4.21072 12.6022 4.21072C11.7198 4.21072 11.1341 5.2598 11.1341 5.62326C11.1341 5.98642 11.3229 6.03813 11.3229 6.46104C11.3229 6.88713 10.3548 7.4398 9.44281 7.4398C8.56481 7.4398 8.05566 7.27394 7.8447 6.80665L7.81777 6.74105L7.75678 6.57266C7.54046 5.98255 7.38528 5.55458 7.11514 5.10733C6.9717 4.87081 6.75038 4.70684 6.55897 4.56257C6.30881 4.38121 6.17902 4.21421 6.15193 4.08967C6.12696 3.96611 6.11352 3.73326 6.54117 3.19648C6.96793 2.66277 7.02775 2.25958 6.81418 2.05153C6.73678 1.97752 6.60482 1.93011 6.43535 1.93011C6.13562 1.93011 5.71912 2.07834 5.2899 2.48551C4.62267 3.12364 5.00146 3.72951 5.00146 3.99548C5.00146 4.26127 4.87922 4.41162 4.47882 4.77323C4.07547 5.13644 3.93627 5.44783 3.89014 6.69935C3.87247 7.3442 3.75079 7.71539 3.64156 8.04453C3.54718 8.33302 3.46038 8.60425 3.45569 8.99611C3.44822 9.43038 3.52566 9.71023 3.61604 10.0331C3.70477 10.3316 3.79902 10.6736 3.8594 11.2456C3.95544 12.1312 3.92205 12.8792 3.74744 13.6437L3.70084 13.8353L3.68995 13.8903C3.65419 14.0247 3.61168 14.1879 3.55423 14.249C1.4029 12.8228 0 10.4936 0 7.86072C0 3.51974 3.80561 0 8.50042 0Z" fill="#F14635"/>
|
|
@@ -5386,10 +5404,10 @@ const Xt = `<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="h
|
|
|
5386
5404
|
<path d="M19.7045 10.7313C15.0567 10.7313 11.2687 6.94328 11.2687 2.26866C11.2687 2.10746 11.1612 2 11 2C10.8388 2 10.7313 2.10746 10.7313 2.26866C10.7313 6.94328 6.94328 10.7313 2.26866 10.7313C2.10746 10.7313 2 10.8388 2 11C2 11.1612 2.10746 11.2687 2.26866 11.2687C6.94328 11.2687 10.7313 15.0567 10.7313 19.7313C10.7313 19.8925 10.8388 20 11 20C11.1612 20 11.2687 19.8925 11.2687 19.7313C11.2687 15.0567 15.0567 11.2687 19.7313 11.2687C19.8925 11.2687 20 11.1612 20 11C20 10.8388 19.8657 10.7313 19.7045 10.7313Z" fill="#2F2F2F"/>
|
|
5387
5405
|
</svg>
|
|
5388
5406
|
`, Oi = '<svg class="choco-widget-method-item-trash" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.16663 5.83317H15.8333" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 5.8335V15.0002C15 15.921 14.2542 16.6668 13.3333 16.6668H6.66667C5.74583 16.6668 5 15.921 5 15.0002V5.8335" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.5 3.12516H7.5" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.33329 9.1665V13.3332" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.6667 9.1665V13.3332" stroke="#CC3434" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>', Ni = '<svg class="choco-widget-method-item-check" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.3333 4.3335L5.99996 11.6668L2.66663 8.3335" stroke="#242424" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
5389
|
-
function
|
|
5407
|
+
function Ye(e) {
|
|
5390
5408
|
return Ri(e == null ? void 0 : e.iconType);
|
|
5391
5409
|
}
|
|
5392
|
-
function
|
|
5410
|
+
function lr(e, t, n, r = {}) {
|
|
5393
5411
|
const { editMode: o = !1 } = r;
|
|
5394
5412
|
return (o ? e.filter((c) => c.type === "card") : e).map((c) => {
|
|
5395
5413
|
const u = !o && !!t && t.type === c.type && t.cardId === c.cardId, l = JSON.stringify(c).replace(/'/g, "'");
|
|
@@ -5398,7 +5416,7 @@ function cr(e, t, n, r = {}) {
|
|
|
5398
5416
|
class="choco-widget-method-item choco-widget-method-item--edit"
|
|
5399
5417
|
role="listitem"
|
|
5400
5418
|
>
|
|
5401
|
-
<div class="choco-widget-method-item-icon-wrapper" aria-hidden="true">${
|
|
5419
|
+
<div class="choco-widget-method-item-icon-wrapper" aria-hidden="true">${Ye(c)}</div>
|
|
5402
5420
|
<div class="choco-widget-method-item-label">${c.label}</div>
|
|
5403
5421
|
<button
|
|
5404
5422
|
type="button"
|
|
@@ -5419,7 +5437,7 @@ function cr(e, t, n, r = {}) {
|
|
|
5419
5437
|
aria-label="${c.label}${u ? " (выбрано)" : ""}"
|
|
5420
5438
|
type="button"
|
|
5421
5439
|
>
|
|
5422
|
-
<div class="choco-widget-method-item-icon-wrapper ${c.type}" aria-hidden="true">${
|
|
5440
|
+
<div class="choco-widget-method-item-icon-wrapper ${c.type}" aria-hidden="true">${Ye(c)}</div>
|
|
5423
5441
|
<div class="choco-widget-method-item-label">${c.label}</div>
|
|
5424
5442
|
${u ? Ni : ""}
|
|
5425
5443
|
</button>
|
|
@@ -5528,7 +5546,7 @@ function Fi(e) {
|
|
|
5528
5546
|
useBalance: l,
|
|
5529
5547
|
bonuses: h,
|
|
5530
5548
|
useBonuses: y,
|
|
5531
|
-
coupon:
|
|
5549
|
+
coupon: m,
|
|
5532
5550
|
useCoupon: b,
|
|
5533
5551
|
couponDisabled: I,
|
|
5534
5552
|
cashbackFormatted: B,
|
|
@@ -5539,7 +5557,7 @@ function Fi(e) {
|
|
|
5539
5557
|
freedomAmountFormatted: R,
|
|
5540
5558
|
t: L,
|
|
5541
5559
|
currency: q
|
|
5542
|
-
} = e, D = (o == null ? void 0 : o.label) ?? L("selectMethod"), K =
|
|
5560
|
+
} = e, D = (o == null ? void 0 : o.label) ?? L("selectMethod"), K = Ye(o), z = lr(i, c), J = xi(u, l, h, y, m, b, I, L, q), M = Ui(B, L), v = (c == null ? void 0 : c.type) === "google_pay", g = (c == null ? void 0 : c.type) === "apple_pay", p = v || g;
|
|
5543
5561
|
return `
|
|
5544
5562
|
<div class="choco-widget-bottom-bar" role="region" aria-label="${L("paymentMethod")}">
|
|
5545
5563
|
${J}
|
|
@@ -5676,10 +5694,10 @@ function Xi() {
|
|
|
5676
5694
|
`;
|
|
5677
5695
|
}
|
|
5678
5696
|
function Hi(e, t, n, r = {}) {
|
|
5679
|
-
return
|
|
5697
|
+
return lr(e, t, n, r);
|
|
5680
5698
|
}
|
|
5681
5699
|
function ji(e) {
|
|
5682
|
-
return
|
|
5700
|
+
return Ye(e);
|
|
5683
5701
|
}
|
|
5684
5702
|
function Ji(e) {
|
|
5685
5703
|
if (typeof document > "u") return { mountTarget: null, isEmbedded: !1 };
|
|
@@ -5690,20 +5708,20 @@ function Ji(e) {
|
|
|
5690
5708
|
}
|
|
5691
5709
|
return { mountTarget: document.body, isEmbedded: !1 };
|
|
5692
5710
|
}
|
|
5693
|
-
function
|
|
5711
|
+
function Ar(e) {
|
|
5694
5712
|
if (typeof document > "u") return !1;
|
|
5695
5713
|
e.container || (e.container = document.createElement("div"), e.container.id = "choco-one-click-widget", e.container.className = "choco-one-click-widget");
|
|
5696
5714
|
const { mountTarget: t, isEmbedded: n } = Ji(e);
|
|
5697
5715
|
return t ? (e.container.parentElement !== t && t.appendChild(e.container), e.container.classList.toggle("choco-one-click-widget--embedded", n), !0) : !1;
|
|
5698
5716
|
}
|
|
5699
5717
|
function qi(e) {
|
|
5700
|
-
|
|
5718
|
+
Ar(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = Xi());
|
|
5701
5719
|
}
|
|
5702
5720
|
function zi(e) {
|
|
5703
|
-
var y,
|
|
5704
|
-
if (e._destroyed || !
|
|
5721
|
+
var y, m, b, I, B;
|
|
5722
|
+
if (e._destroyed || !Ar(e)) return;
|
|
5705
5723
|
e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.classList.remove("choco-one-click-widget--visible");
|
|
5706
|
-
const t = e.getAvailablePaymentMethods(), n = (y = e.checkoutContext) == null ? void 0 : y.data, r = e.config.currency || "KZT", o = (I = (b = (
|
|
5724
|
+
const t = e.getAvailablePaymentMethods(), n = (y = e.checkoutContext) == null ? void 0 : y.data, r = e.config.currency || "KZT", o = (I = (b = (m = n == null ? void 0 : n.balance) == null ? void 0 : m.data) == null ? void 0 : b.money) == null ? void 0 : I[r], i = !e.config.disableUseBalance && o > 0 ? $(o, e.config.locale, e.config.currency) : null, c = (B = n == null ? void 0 : n.cashback) == null ? void 0 : B.data, u = (c == null ? void 0 : c.cashbackAmount) > 0 ? $(c.cashbackAmount, e.config.locale, e.config.currency) : null, l = e._getPayableAmount(), h = l < e.config.amount;
|
|
5707
5725
|
e.container.innerHTML = Fi({
|
|
5708
5726
|
amountFormatted: $(l, e.config.locale, e.config.currency),
|
|
5709
5727
|
originalAmountFormatted: $(
|
|
@@ -5769,20 +5787,20 @@ function Qe(e) {
|
|
|
5769
5787
|
const c = JSON.parse(
|
|
5770
5788
|
i.currentTarget.getAttribute("data-method") || "{}"
|
|
5771
5789
|
);
|
|
5772
|
-
|
|
5790
|
+
pr(e, c);
|
|
5773
5791
|
});
|
|
5774
5792
|
});
|
|
5775
5793
|
}
|
|
5776
|
-
function
|
|
5794
|
+
function dr(e) {
|
|
5777
5795
|
var o, i, c;
|
|
5778
5796
|
const t = (o = e.container) == null ? void 0 : o.querySelector(".choco-widget-payment-method"), n = (i = e.container) == null ? void 0 : i.querySelector(".choco-widget-method-name"), r = (c = e.container) == null ? void 0 : c.querySelector(
|
|
5779
5797
|
".choco-widget-method-icon-wrapper"
|
|
5780
5798
|
);
|
|
5781
|
-
t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), n && e.selectedPaymentMethod && (n.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, n.textContent = e.selectedPaymentMethod.label), r && e.selectedPaymentMethod && (r.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, r.innerHTML = ji(e.selectedPaymentMethod)),
|
|
5799
|
+
t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), n && e.selectedPaymentMethod && (n.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, n.textContent = e.selectedPaymentMethod.label), r && e.selectedPaymentMethod && (r.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, r.innerHTML = ji(e.selectedPaymentMethod)), fr(e);
|
|
5782
5800
|
}
|
|
5783
|
-
function
|
|
5784
|
-
var
|
|
5785
|
-
const t = (
|
|
5801
|
+
function Je(e) {
|
|
5802
|
+
var m, b, I, B, Q, S;
|
|
5803
|
+
const t = (m = e.container) == null ? void 0 : m.querySelector(".choco-widget-pay-button"), n = (b = e.container) == null ? void 0 : b.querySelector(
|
|
5786
5804
|
".choco-widget-google-pay-amount"
|
|
5787
5805
|
), r = (I = e.container) == null ? void 0 : I.querySelector(
|
|
5788
5806
|
".choco-widget-google-pay-amount-label"
|
|
@@ -5810,9 +5828,9 @@ function je(e) {
|
|
|
5810
5828
|
".choco-widget-google-pay-amount-value-number"
|
|
5811
5829
|
)), i ? i.textContent = h : o && (o.textContent = `${e.t("instead")} ${h}`);
|
|
5812
5830
|
}
|
|
5813
|
-
function
|
|
5814
|
-
var l, h, y,
|
|
5815
|
-
const t = ((l = e.selectedPaymentMethod) == null ? void 0 : l.type) === "google_pay", n = ((h = e.selectedPaymentMethod) == null ? void 0 : h.type) === "apple_pay", r = t || n, o = (y = e.container) == null ? void 0 : y.querySelector(".choco-widget-pay-button"), i = (
|
|
5831
|
+
function fr(e) {
|
|
5832
|
+
var l, h, y, m, b, I, B, Q, S, P;
|
|
5833
|
+
const t = ((l = e.selectedPaymentMethod) == null ? void 0 : l.type) === "google_pay", n = ((h = e.selectedPaymentMethod) == null ? void 0 : h.type) === "apple_pay", r = t || n, o = (y = e.container) == null ? void 0 : y.querySelector(".choco-widget-pay-button"), i = (m = e.container) == null ? void 0 : m.querySelector(
|
|
5816
5834
|
".choco-widget-google-pay-amount"
|
|
5817
5835
|
), c = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), u = (I = e.container) == null ? void 0 : I.querySelector(".choco-widget-apple-pay-row");
|
|
5818
5836
|
if (o == null || o.classList.toggle("choco-widget-pay-button--hidden", r), i == null || i.classList.toggle(
|
|
@@ -5839,7 +5857,7 @@ function Ar(e) {
|
|
|
5839
5857
|
);
|
|
5840
5858
|
k && (k.innerHTML = ""), R && (R.innerHTML = "");
|
|
5841
5859
|
}
|
|
5842
|
-
|
|
5860
|
+
Je(e), ie(e);
|
|
5843
5861
|
}
|
|
5844
5862
|
async function Ki(e) {
|
|
5845
5863
|
var c, u, l, h, y;
|
|
@@ -5868,8 +5886,8 @@ async function Ki(e) {
|
|
|
5868
5886
|
buttonLocale: e.config.locale || "ru",
|
|
5869
5887
|
buttonSizeMode: "fill"
|
|
5870
5888
|
});
|
|
5871
|
-
i.classList.add("choco-widget-google-pay-button"), i.style.setProperty("width", "100%", "important"), i.style.setProperty("height", "52px", "important"), i.style.setProperty("min-height", "52px", "important"), i.style.setProperty("border-radius", "12px", "important"), i.style.setProperty("font-size", "16px", "important"), i.style.setProperty("font-weight", "bold", "important"), i.querySelectorAll("*").forEach((
|
|
5872
|
-
|
|
5889
|
+
i.classList.add("choco-widget-google-pay-button"), i.style.setProperty("width", "100%", "important"), i.style.setProperty("height", "52px", "important"), i.style.setProperty("min-height", "52px", "important"), i.style.setProperty("border-radius", "12px", "important"), i.style.setProperty("font-size", "16px", "important"), i.style.setProperty("font-weight", "bold", "important"), i.querySelectorAll("*").forEach((m) => {
|
|
5890
|
+
m.style.setProperty("border-radius", "12px", "important"), m.style.setProperty("font-weight", "bold", "important"), m.style.setProperty("font-size", "16px", "important");
|
|
5873
5891
|
}), t.appendChild(i), ie(e);
|
|
5874
5892
|
}
|
|
5875
5893
|
function Gi(e) {
|
|
@@ -5899,7 +5917,7 @@ function Gi(e) {
|
|
|
5899
5917
|
</span>
|
|
5900
5918
|
`, n.appendChild(r), n.appendChild(o), t.appendChild(n), ie(e);
|
|
5901
5919
|
}
|
|
5902
|
-
function
|
|
5920
|
+
function Ln(e) {
|
|
5903
5921
|
var o;
|
|
5904
5922
|
if (!e.selectedCoupon) return;
|
|
5905
5923
|
const t = e._isCouponDisabled();
|
|
@@ -5914,9 +5932,9 @@ function pe(e) {
|
|
|
5914
5932
|
e.loading = !0, ie(e);
|
|
5915
5933
|
}
|
|
5916
5934
|
function W(e) {
|
|
5917
|
-
var
|
|
5935
|
+
var m, b, I, B, Q, S, P, k;
|
|
5918
5936
|
e.loading = !1;
|
|
5919
|
-
const t = (
|
|
5937
|
+
const t = (m = e.container) == null ? void 0 : m.querySelector(".choco-widget-payment-method"), n = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-pay-button"), r = (I = e.container) == null ? void 0 : I.querySelector(
|
|
5920
5938
|
".choco-widget-google-pay-button-slot button"
|
|
5921
5939
|
), o = (B = e.container) == null ? void 0 : B.querySelector(
|
|
5922
5940
|
".choco-widget-apple-pay-button-slot button"
|
|
@@ -5937,10 +5955,10 @@ function ie(e) {
|
|
|
5937
5955
|
".choco-widget-google-pay-amount"
|
|
5938
5956
|
), u = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-google-pay-row"), l = (R = e.container) == null ? void 0 : R.querySelector(".choco-widget-apple-pay-row"), h = (L = e.container) == null ? void 0 : L.querySelector(
|
|
5939
5957
|
".choco-widget-balance-section"
|
|
5940
|
-
), y = e._isInteractionBlocked(),
|
|
5941
|
-
h == null || h.classList.toggle("disabled", y), t && (t.disabled =
|
|
5958
|
+
), y = e._isInteractionBlocked(), m = e.paymentMethodDisabled || y;
|
|
5959
|
+
h == null || h.classList.toggle("disabled", y), t && (t.disabled = m), n && (n.disabled = y, n.classList.toggle("choco-widget-pay-button--loading", e.loading)), r && (r.disabled = y), o && (o.disabled = y), i && (i.disabled = y), c == null || c.classList.toggle("choco-widget-wallet-blocked", y), c == null || c.setAttribute("aria-disabled", String(y)), u == null || u.classList.toggle("choco-widget-wallet-blocked", y), u == null || u.setAttribute("aria-disabled", String(y)), l == null || l.classList.toggle("choco-widget-wallet-blocked", y), l == null || l.setAttribute("aria-disabled", String(y));
|
|
5942
5960
|
}
|
|
5943
|
-
function
|
|
5961
|
+
function hr(e) {
|
|
5944
5962
|
var n;
|
|
5945
5963
|
if (e._isInteractionBlocked()) return;
|
|
5946
5964
|
const t = (n = e.container) == null ? void 0 : n.querySelector('[data-sheet="payment"]');
|
|
@@ -5950,7 +5968,7 @@ function ae(e) {
|
|
|
5950
5968
|
var n;
|
|
5951
5969
|
const t = (n = e.container) == null ? void 0 : n.querySelector('[data-sheet="payment"]');
|
|
5952
5970
|
if (t) {
|
|
5953
|
-
|
|
5971
|
+
Ve(e);
|
|
5954
5972
|
const r = t.querySelector(".choco-widget-sheet-content");
|
|
5955
5973
|
r && (r.style.transform = "", r.classList.remove("choco-widget-sheet-content--dragging")), t.classList.remove("choco-widget-payment-sheet--open"), e.isPaymentSheetOpen = !1, e.isPaymentSheetEditMode && (e.isPaymentSheetEditMode = !1, Qe(e), ke(e));
|
|
5956
5974
|
}
|
|
@@ -5962,7 +5980,7 @@ function ke(e) {
|
|
|
5962
5980
|
const n = t.querySelector(".choco-widget-sheet-title"), r = t.querySelector('[data-action="close-sheet"]'), o = t.querySelector('[data-action="edit-sheet"]'), i = t.querySelector('[data-action="previous-sheet"]'), u = e.getAvailablePaymentMethods().some((h) => h.type === "card");
|
|
5963
5981
|
e.isPaymentSheetEditMode ? (t.classList.add("choco-widget-payment-sheet--edit"), n && (n.textContent = e.t("editCards")), r && (r.style.display = "none"), o && (o.style.display = "none"), i && (i.style.display = "")) : (t.classList.remove("choco-widget-payment-sheet--edit"), t.classList.toggle("choco-widget-payment-sheet--no-cards", !u), n && (n.textContent = e.t("paymentMethods")), r && (r.style.display = ""), o && (o.style.display = u ? "" : "none"), i && (i.style.display = "none"));
|
|
5964
5982
|
}
|
|
5965
|
-
function
|
|
5983
|
+
function gt(e) {
|
|
5966
5984
|
if (!e.addCardActionUrl || !e.container) return;
|
|
5967
5985
|
const t = e.container.querySelector('[data-sheet="add-card"]'), n = e.container.querySelector(
|
|
5968
5986
|
"#choco-widget-add-card-iframe"
|
|
@@ -5994,7 +6012,7 @@ function Vi(e, t) {
|
|
|
5994
6012
|
const r = n.querySelector(".choco-widget-sheet-title"), o = n.querySelector('[data-action="edit-sheet"]'), i = n.querySelector('[data-action="previous-sheet"]');
|
|
5995
6013
|
r && (r.textContent = e.t("confirmDeleteCard")), o && (o.style.display = "none"), i && (i.style.display = "none");
|
|
5996
6014
|
}
|
|
5997
|
-
function
|
|
6015
|
+
function Ve(e) {
|
|
5998
6016
|
var n;
|
|
5999
6017
|
e._pendingDeleteMethod = null, Tt(e, !1);
|
|
6000
6018
|
const t = (n = e.container) == null ? void 0 : n.querySelector('[data-sheet="payment"]');
|
|
@@ -6016,20 +6034,20 @@ async function Zi(e, t) {
|
|
|
6016
6034
|
const n = t == null ? void 0 : t.cardId;
|
|
6017
6035
|
if (!(!n || (t == null ? void 0 : t.type) !== "card"))
|
|
6018
6036
|
try {
|
|
6019
|
-
await
|
|
6037
|
+
await Mr(e.apiUrl, e._getApiConfig(), n), e.checkoutContext = await bt(
|
|
6020
6038
|
e.apiUrl,
|
|
6021
6039
|
e._getApiConfig()
|
|
6022
|
-
), ((r = e.selectedPaymentMethod) == null ? void 0 : r.type) === "card" && ((o = e.selectedPaymentMethod) == null ? void 0 : o.cardId) === n && (e.selectedPaymentMethod =
|
|
6040
|
+
), ((r = e.selectedPaymentMethod) == null ? void 0 : r.type) === "card" && ((o = e.selectedPaymentMethod) == null ? void 0 : o.cardId) === n && (e.selectedPaymentMethod = mt(
|
|
6023
6041
|
e.checkoutContext.data,
|
|
6024
6042
|
e._getKaspiOptions()
|
|
6025
|
-
), e._emitPaymentMethodSelected(),
|
|
6043
|
+
), e._emitPaymentMethodSelected(), dr(e)), Qe(e), e.config.onSuccess({ message: e.t("cardDeleted") }), e.config.onCardDeleted && e.config.onCardDeleted({ cardId: n });
|
|
6026
6044
|
} catch (i) {
|
|
6027
6045
|
e.config.onError({
|
|
6028
6046
|
attributes: { message: (i == null ? void 0 : i.message) || e.t("paymentError") }
|
|
6029
6047
|
});
|
|
6030
6048
|
}
|
|
6031
6049
|
}
|
|
6032
|
-
function
|
|
6050
|
+
function pr(e, t) {
|
|
6033
6051
|
if (!e._isInteractionBlocked()) {
|
|
6034
6052
|
if (e.selectedPaymentMethod = t, e._emitPaymentMethodSelected(), t.type === "new_card") {
|
|
6035
6053
|
e._emitUserEvent("one_click_pay_method_resolved", { payment_method: t.type }), ae(e), e.handlePayment();
|
|
@@ -6037,10 +6055,10 @@ function fr(e, t) {
|
|
|
6037
6055
|
}
|
|
6038
6056
|
e._emitUserEvent("one_click_pay_method_resolved", {
|
|
6039
6057
|
payment_method: e._getPaymentMethodForUserEvent()
|
|
6040
|
-
}), Qe(e), ae(e),
|
|
6058
|
+
}), Qe(e), ae(e), dr(e);
|
|
6041
6059
|
}
|
|
6042
6060
|
}
|
|
6043
|
-
function
|
|
6061
|
+
function Rn(e, t) {
|
|
6044
6062
|
var r;
|
|
6045
6063
|
const n = t.type || ((r = t.data) == null ? void 0 : r.type);
|
|
6046
6064
|
if (!n) {
|
|
@@ -6049,10 +6067,10 @@ function Tn(e, t) {
|
|
|
6049
6067
|
}
|
|
6050
6068
|
switch (n) {
|
|
6051
6069
|
case "order.paid":
|
|
6052
|
-
e._orderStatusResolved = !0, de(e),
|
|
6070
|
+
e._orderStatusResolved = !0, de(e), yr(e, t);
|
|
6053
6071
|
break;
|
|
6054
6072
|
case "order.failed":
|
|
6055
|
-
e._orderStatusResolved = !0, de(e),
|
|
6073
|
+
e._orderStatusResolved = !0, de(e), mr(e, t);
|
|
6056
6074
|
break;
|
|
6057
6075
|
case "order.action_required":
|
|
6058
6076
|
$i(e, t);
|
|
@@ -6078,19 +6096,19 @@ function Be(e, t) {
|
|
|
6078
6096
|
}
|
|
6079
6097
|
o += 1;
|
|
6080
6098
|
try {
|
|
6081
|
-
const { data: c } = await
|
|
6099
|
+
const { data: c } = await Ur(
|
|
6082
6100
|
e.apiUrl,
|
|
6083
6101
|
e._getApiConfig(),
|
|
6084
6102
|
String(t)
|
|
6085
6103
|
), u = c == null ? void 0 : c.status, l = (c == null ? void 0 : c.payload) || {};
|
|
6086
6104
|
if (u === "success") {
|
|
6087
|
-
e._orderStatusResolved = !0, de(e),
|
|
6105
|
+
e._orderStatusResolved = !0, de(e), yr(e, {
|
|
6088
6106
|
id: String(l.id || t),
|
|
6089
6107
|
attributes: { amount: l.amount, paid_at: l.paid_at || "" }
|
|
6090
6108
|
});
|
|
6091
6109
|
return;
|
|
6092
6110
|
}
|
|
6093
|
-
u === "fail" && (e._orderStatusResolved = !0, de(e),
|
|
6111
|
+
u === "fail" && (e._orderStatusResolved = !0, de(e), mr(e, {
|
|
6094
6112
|
id: String(l.id || t),
|
|
6095
6113
|
attributes: { message: l.message || e.t("paymentError") }
|
|
6096
6114
|
}));
|
|
@@ -6104,15 +6122,15 @@ function Be(e, t) {
|
|
|
6104
6122
|
function Ht() {
|
|
6105
6123
|
return typeof document > "u" ? !1 : document.hidden || document.visibilityState === "hidden";
|
|
6106
6124
|
}
|
|
6107
|
-
function
|
|
6125
|
+
function gr(e, t) {
|
|
6108
6126
|
W(e), e.config.onSuccess(t);
|
|
6109
6127
|
}
|
|
6110
|
-
function
|
|
6128
|
+
function yt(e) {
|
|
6111
6129
|
if (!e._pendingSuccessPayload || Ht()) return;
|
|
6112
6130
|
const t = e._pendingSuccessPayload;
|
|
6113
|
-
e._pendingSuccessPayload = null,
|
|
6131
|
+
e._pendingSuccessPayload = null, gr(e, t);
|
|
6114
6132
|
}
|
|
6115
|
-
function
|
|
6133
|
+
function yr(e, t) {
|
|
6116
6134
|
var o, i;
|
|
6117
6135
|
e.isAddCardViewOpen && Ie(e);
|
|
6118
6136
|
const n = t.attributes || ((o = t.data) == null ? void 0 : o.attributes) || {}, r = { id: t.id || ((i = t.data) == null ? void 0 : i.id), attributes: n };
|
|
@@ -6120,9 +6138,9 @@ function pr(e, t) {
|
|
|
6120
6138
|
e._pendingSuccessPayload = r;
|
|
6121
6139
|
return;
|
|
6122
6140
|
}
|
|
6123
|
-
|
|
6141
|
+
gr(e, r);
|
|
6124
6142
|
}
|
|
6125
|
-
function
|
|
6143
|
+
function mr(e, t) {
|
|
6126
6144
|
var r, o;
|
|
6127
6145
|
e.isAddCardViewOpen && Ie(e), W(e);
|
|
6128
6146
|
const n = t.attributes || ((r = t.data) == null ? void 0 : r.attributes) || {};
|
|
@@ -6165,14 +6183,14 @@ async function ea(e) {
|
|
|
6165
6183
|
if (e._isBalanceFullyCoveringAmount()) {
|
|
6166
6184
|
pe(e);
|
|
6167
6185
|
try {
|
|
6168
|
-
const u = await
|
|
6186
|
+
const u = await nn(
|
|
6169
6187
|
e.apiUrl,
|
|
6170
6188
|
e._getApiConfig(),
|
|
6171
6189
|
e.deviceId,
|
|
6172
6190
|
e.selectedPaymentMethod,
|
|
6173
6191
|
t
|
|
6174
6192
|
);
|
|
6175
|
-
await
|
|
6193
|
+
await On(e);
|
|
6176
6194
|
const l = (u == null ? void 0 : u.id) ?? ((n = u == null ? void 0 : u.data) == null ? void 0 : n.id);
|
|
6177
6195
|
return l && Be(e, String(l)), u;
|
|
6178
6196
|
} catch (u) {
|
|
@@ -6195,22 +6213,22 @@ async function ea(e) {
|
|
|
6195
6213
|
}
|
|
6196
6214
|
pe(e);
|
|
6197
6215
|
try {
|
|
6198
|
-
const u = await
|
|
6216
|
+
const u = await nn(
|
|
6199
6217
|
e.apiUrl,
|
|
6200
6218
|
e._getApiConfig(),
|
|
6201
6219
|
e.deviceId,
|
|
6202
6220
|
e.selectedPaymentMethod,
|
|
6203
6221
|
t
|
|
6204
6222
|
);
|
|
6205
|
-
await
|
|
6223
|
+
await On(e);
|
|
6206
6224
|
const l = (u == null ? void 0 : u.id) ?? ((r = u == null ? void 0 : u.data) == null ? void 0 : r.id);
|
|
6207
6225
|
if (l && Be(e, String(l)), ((o = e.selectedPaymentMethod) == null ? void 0 : o.type) === "kaspi_pay") {
|
|
6208
|
-
const h = (u == null ? void 0 : u.attributes) || ((i = u == null ? void 0 : u.data) == null ? void 0 : i.attributes) || {}, y = h.action_link || h.action_url,
|
|
6226
|
+
const h = (u == null ? void 0 : u.attributes) || ((i = u == null ? void 0 : u.data) == null ? void 0 : i.attributes) || {}, y = h.action_link || h.action_url, m = h.action_url_type || h.action_type || "redirect";
|
|
6209
6227
|
if (y)
|
|
6210
6228
|
return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
|
|
6211
6229
|
action_link: y,
|
|
6212
6230
|
action_url: y,
|
|
6213
|
-
action_type:
|
|
6231
|
+
action_type: m,
|
|
6214
6232
|
event: u
|
|
6215
6233
|
}), u) : (window.location.href = y, u);
|
|
6216
6234
|
}
|
|
@@ -6219,11 +6237,11 @@ async function ea(e) {
|
|
|
6219
6237
|
throw W(e), se(u, { paymentMethod: ((c = e.selectedPaymentMethod) == null ? void 0 : c.type) || "card" }), e.config.onError({ message: e._resolveErrorMessage(u) }), u;
|
|
6220
6238
|
}
|
|
6221
6239
|
}
|
|
6222
|
-
async function
|
|
6240
|
+
async function On(e) {
|
|
6223
6241
|
var t, n;
|
|
6224
6242
|
if (!(((t = e.selectedPaymentMethod) == null ? void 0 : t.type) !== "card" || !((n = e.selectedPaymentMethod) != null && n.cardId)))
|
|
6225
6243
|
try {
|
|
6226
|
-
await
|
|
6244
|
+
await xr(
|
|
6227
6245
|
e.apiUrl,
|
|
6228
6246
|
e._getApiConfig(),
|
|
6229
6247
|
e.selectedPaymentMethod.cardId
|
|
@@ -6235,7 +6253,7 @@ async function Ln(e) {
|
|
|
6235
6253
|
async function ta(e, t) {
|
|
6236
6254
|
pe(e), e.waitingForNewCardAction = !0, e._setNewCardActionTimeout();
|
|
6237
6255
|
try {
|
|
6238
|
-
await
|
|
6256
|
+
await Fr(
|
|
6239
6257
|
e.apiUrl,
|
|
6240
6258
|
e._getApiConfig(),
|
|
6241
6259
|
e.deviceId,
|
|
@@ -6275,11 +6293,24 @@ async function na(e, t) {
|
|
|
6275
6293
|
me = o, o.onvalidatemerchant = async (i) => {
|
|
6276
6294
|
var c, u;
|
|
6277
6295
|
try {
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6296
|
+
let l;
|
|
6297
|
+
try {
|
|
6298
|
+
l = await rn(
|
|
6299
|
+
e.apiUrl,
|
|
6300
|
+
e._getApiConfig(),
|
|
6301
|
+
i.validationURL
|
|
6302
|
+
);
|
|
6303
|
+
} catch (m) {
|
|
6304
|
+
if (m.status === 401)
|
|
6305
|
+
await e._obtainTokenByRefreshOrTrackId(), l = await rn(
|
|
6306
|
+
e.apiUrl,
|
|
6307
|
+
e._getApiConfig(),
|
|
6308
|
+
i.validationURL
|
|
6309
|
+
);
|
|
6310
|
+
else
|
|
6311
|
+
throw m;
|
|
6312
|
+
}
|
|
6313
|
+
const h = ((u = (c = l == null ? void 0 : l.data) == null ? void 0 : c.attributes) == null ? void 0 : u.session) || l, y = JSON.parse(atob(h));
|
|
6283
6314
|
o.completeMerchantValidation(y);
|
|
6284
6315
|
} catch (l) {
|
|
6285
6316
|
console.error("Apple Pay session error:", l), se(l, { paymentMethod: "apple_pay", phase: "merchant_validation" }), o.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
|
|
@@ -6337,7 +6368,7 @@ async function ra(e, t) {
|
|
|
6337
6368
|
await oa(e, t, { gateway: c, gatewayMerchantId: u });
|
|
6338
6369
|
return;
|
|
6339
6370
|
}
|
|
6340
|
-
const
|
|
6371
|
+
const m = Number(e._getCheckoutAmount()).toFixed(2);
|
|
6341
6372
|
try {
|
|
6342
6373
|
await e._loadGooglePaySdk();
|
|
6343
6374
|
} catch (D) {
|
|
@@ -6369,7 +6400,7 @@ async function ra(e, t) {
|
|
|
6369
6400
|
transactionInfo: {
|
|
6370
6401
|
totalPriceStatus: "FINAL",
|
|
6371
6402
|
totalPriceLabel: "Итого",
|
|
6372
|
-
totalPrice:
|
|
6403
|
+
totalPrice: m,
|
|
6373
6404
|
currencyCode: e.config.currency,
|
|
6374
6405
|
countryCode: e.config.currency === "GEL" ? "GE" : "KZ"
|
|
6375
6406
|
},
|
|
@@ -6390,7 +6421,7 @@ async function ra(e, t) {
|
|
|
6390
6421
|
pe(e);
|
|
6391
6422
|
const K = await Q.loadPaymentData(B), z = (L = (R = K == null ? void 0 : K.paymentMethodData) == null ? void 0 : R.tokenizationData) == null ? void 0 : L.token;
|
|
6392
6423
|
if (!z) throw new Error(e.t("errorGooglePayPayment"));
|
|
6393
|
-
const J = JSON.parse(z), M = await
|
|
6424
|
+
const J = JSON.parse(z), M = await Fn(
|
|
6394
6425
|
e.apiUrl,
|
|
6395
6426
|
e._getApiConfig(),
|
|
6396
6427
|
e.deviceId,
|
|
@@ -6418,7 +6449,7 @@ async function oa(e, t, n) {
|
|
|
6418
6449
|
amount: Number(e._getCheckoutAmount()),
|
|
6419
6450
|
gateway: n.gateway,
|
|
6420
6451
|
gatewayMerchantId: n.gatewayMerchantId
|
|
6421
|
-
}), i = JSON.parse(o), c = await
|
|
6452
|
+
}), i = JSON.parse(o), c = await Fn(
|
|
6422
6453
|
e.apiUrl,
|
|
6423
6454
|
e._getApiConfig(),
|
|
6424
6455
|
e.deviceId,
|
|
@@ -6435,17 +6466,17 @@ async function oa(e, t, n) {
|
|
|
6435
6466
|
}
|
|
6436
6467
|
}
|
|
6437
6468
|
function sa(e) {
|
|
6438
|
-
var c, u, l, h, y,
|
|
6469
|
+
var c, u, l, h, y, m, b, I, B, Q, S, P;
|
|
6439
6470
|
const t = e.container;
|
|
6440
6471
|
(c = t.querySelector('[data-action="freedom-card"]')) == null || c.addEventListener("click", () => {
|
|
6441
6472
|
e.config.onFreedomLink && e.config.onFreedomLink();
|
|
6442
|
-
}), (u = t.querySelector('[data-action="pay"]')) == null || u.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () =>
|
|
6443
|
-
e._pendingDeleteMethod ?
|
|
6473
|
+
}), (u = t.querySelector('[data-action="pay"]')) == null || u.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () => hr(e)), t.querySelectorAll('[data-action="close"]').forEach((k) => k.addEventListener("click", () => e.close())), (h = t.querySelector('[data-action="close-sheet"]')) == null || h.addEventListener("click", () => {
|
|
6474
|
+
e._pendingDeleteMethod ? Ve(e) : ae(e);
|
|
6444
6475
|
}), (y = t.querySelector('[data-action="edit-sheet"]')) == null || y.addEventListener("click", () => {
|
|
6445
6476
|
e.isPaymentSheetEditMode = !0, Qe(e), ke(e);
|
|
6446
|
-
}), (
|
|
6477
|
+
}), (m = t.querySelector('[data-action="previous-sheet"]')) == null || m.addEventListener("click", () => {
|
|
6447
6478
|
e.isPaymentSheetEditMode = !1, Qe(e), ke(e);
|
|
6448
|
-
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => Ie(e)), (I = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || I.addEventListener("click", () =>
|
|
6479
|
+
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => Ie(e)), (I = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || I.addEventListener("click", () => Ve(e)), (B = t.querySelector('[data-action="confirm-delete-submit"]')) == null || B.addEventListener("click", () => {
|
|
6449
6480
|
if (e._pendingDeleteMethod) {
|
|
6450
6481
|
const k = e._pendingDeleteMethod;
|
|
6451
6482
|
Tt(e, !0), Zi(e, k).then(() => ae(e)).finally(() => Tt(e, !1));
|
|
@@ -6455,7 +6486,7 @@ function sa(e) {
|
|
|
6455
6486
|
const L = JSON.parse(
|
|
6456
6487
|
R.currentTarget.getAttribute("data-method") || "{}"
|
|
6457
6488
|
);
|
|
6458
|
-
|
|
6489
|
+
pr(e, L);
|
|
6459
6490
|
});
|
|
6460
6491
|
});
|
|
6461
6492
|
const n = t.querySelector('[data-sheet="payment"]');
|
|
@@ -6464,20 +6495,20 @@ function sa(e) {
|
|
|
6464
6495
|
}), aa(e, n));
|
|
6465
6496
|
const r = t.querySelector('[data-action="toggle-balance"]');
|
|
6466
6497
|
r && ((Q = r.querySelector("input[type='checkbox']")) == null || Q.addEventListener("change", (k) => {
|
|
6467
|
-
e.useBalance = k.target.checked,
|
|
6498
|
+
e.useBalance = k.target.checked, Ln(e), e._updatePayButtonAmount();
|
|
6468
6499
|
}));
|
|
6469
6500
|
const o = t.querySelector('[data-action="toggle-bonuses"]');
|
|
6470
6501
|
o && ((S = o.querySelector("input[type='checkbox']")) == null || S.addEventListener("change", (k) => {
|
|
6471
|
-
e.useBonuses = k.target.checked, e.config.onAppliedBonus(e.useBonuses),
|
|
6502
|
+
e.useBonuses = k.target.checked, e.config.onAppliedBonus(e.useBonuses), Ln(e), e._updatePayButtonAmount();
|
|
6472
6503
|
}));
|
|
6473
6504
|
const i = t.querySelector('[data-action="toggle-coupon"]');
|
|
6474
6505
|
i && ((P = i.querySelector("input[type='checkbox']")) == null || P.addEventListener("change", (k) => {
|
|
6475
6506
|
e.useCoupon = k.target.checked, e._updatePayButtonAmount();
|
|
6476
|
-
})), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown),
|
|
6507
|
+
})), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), fr(e);
|
|
6477
6508
|
}
|
|
6478
6509
|
function ia(e, t) {
|
|
6479
6510
|
var n, r;
|
|
6480
|
-
e.isOpen && (t.key === "Escape" && (t.preventDefault(), e._pendingDeleteMethod ?
|
|
6511
|
+
e.isOpen && (t.key === "Escape" && (t.preventDefault(), e._pendingDeleteMethod ? Ve(e) : e.isAddCardViewOpen ? Ie(e) : e.isPaymentSheetOpen ? ae(e) : e.close()), t.key === "Enter" && ((r = (n = t.target) == null ? void 0 : n.dataset) == null ? void 0 : r.action) === "pay" && (t.preventDefault(), e.handlePayment()));
|
|
6481
6512
|
}
|
|
6482
6513
|
function aa(e, t) {
|
|
6483
6514
|
const n = t.querySelector('[data-action="sheet-drag-handle"]'), r = t.querySelector(".choco-widget-sheet-content");
|
|
@@ -6493,10 +6524,10 @@ function aa(e, t) {
|
|
|
6493
6524
|
const y = Math.max(0, c - i);
|
|
6494
6525
|
if (r.classList.remove("choco-widget-sheet-content--dragging"), y >= o) {
|
|
6495
6526
|
r.style.transform = "translateY(100%)";
|
|
6496
|
-
const
|
|
6497
|
-
r.removeEventListener("transitionend",
|
|
6527
|
+
const m = () => {
|
|
6528
|
+
r.removeEventListener("transitionend", m), r.style.transform = "", ae(e);
|
|
6498
6529
|
};
|
|
6499
|
-
r.addEventListener("transitionend",
|
|
6530
|
+
r.addEventListener("transitionend", m);
|
|
6500
6531
|
} else
|
|
6501
6532
|
r.style.transform = "";
|
|
6502
6533
|
};
|
|
@@ -6507,20 +6538,20 @@ function aa(e, t) {
|
|
|
6507
6538
|
class Ce {
|
|
6508
6539
|
// ─── Статические методы / logout ─────────────────────────────────────────────
|
|
6509
6540
|
static _getAuthStorageValue(t) {
|
|
6510
|
-
return
|
|
6541
|
+
return Un(t);
|
|
6511
6542
|
}
|
|
6512
6543
|
static _setAuthStorageValue(t, n) {
|
|
6513
|
-
|
|
6544
|
+
Ct(t, n);
|
|
6514
6545
|
}
|
|
6515
6546
|
static _removeAuthStorageValue(t) {
|
|
6516
|
-
|
|
6547
|
+
Ge(t);
|
|
6517
6548
|
}
|
|
6518
6549
|
static async logout() {
|
|
6519
|
-
|
|
6550
|
+
Tn();
|
|
6520
6551
|
}
|
|
6521
6552
|
// ─── Конструктор ──────────────────────────────────────────────────────────────
|
|
6522
6553
|
constructor(t) {
|
|
6523
|
-
this.config = jr(t), this.accessToken = null, this.deviceId =
|
|
6554
|
+
this.config = jr(t), this.accessToken = null, this.deviceId = Nn(), this.apiUrl = vr(this.config.environment), this.translations = br, this.checkoutContext = null, this.centrifuge = null, this.selectedPaymentMethod = null, this.selectedCoupon = null, this.useCoupon = !1, this.container = null, this.isOpen = !1, this.isPaymentSheetOpen = !1, this.isPaymentSheetEditMode = !1, this.loading = !1, this.disabled = !1, this.paymentMethodDisabled = !1, this.useBalance = !1, this.useBonuses = !1, this.addCardActionUrl = null, this.isAddCardViewOpen = !1, this.waitingForNewCardAction = !1, this.newCardActionRequiredTimeoutId = null, this._googlePayScriptPromise = null, this._googlePayButtonRenderVersion = 0, this._orderStatusPollingId = null, this._orderStatusResolved = !1, this._pendingDeleteMethod = null, this._pendingSuccessPayload = null, this._lifecycleListenersAttached = !1, this._destroyed = !1, this._boundAddCardMessage = null, this._boundKeyDown = (n) => ia(this, n), this._boundVisibilityChange = () => this._onVisibilityChange(), this._boundWindowFocus = () => this._onWindowFocus(), this._boundPageShow = () => this._onPageShow(), Bi({
|
|
6524
6555
|
clientId: String(this.config.clientId),
|
|
6525
6556
|
terminalId: String(this.config.terminalId),
|
|
6526
6557
|
environment: this.config.environment
|
|
@@ -6571,7 +6602,7 @@ class Ce {
|
|
|
6571
6602
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
6572
6603
|
}
|
|
6573
6604
|
_getPaymentBreakdown() {
|
|
6574
|
-
const t = this.config.amount, n = this._getBalanceAmount(), r = this.useBalance ? Math.min(n, t) : 0, o = t - r, i = this.useBalance && r >= t, c = this.useBonuses ? this._getAvailableBonus() : 0, u = Math.max(o - c, 0), l = this._getCouponDiscount(), h = Math.max(u - l, 0), y = this.useBalance ? t : h,
|
|
6605
|
+
const t = this.config.amount, n = this._getBalanceAmount(), r = this.useBalance ? Math.min(n, t) : 0, o = t - r, i = this.useBalance && r >= t, c = this.useBonuses ? this._getAvailableBonus() : 0, u = Math.max(o - c, 0), l = this._getCouponDiscount(), h = Math.max(u - l, 0), y = this.useBalance ? t : h, m = this.useBalance && !i, I = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
|
|
6575
6606
|
id: this.selectedCoupon.voucher_id,
|
|
6576
6607
|
template_id: this.selectedCoupon.template_id,
|
|
6577
6608
|
type: this.selectedCoupon.type
|
|
@@ -6581,7 +6612,7 @@ class Ce {
|
|
|
6581
6612
|
checkoutOptions: {
|
|
6582
6613
|
checkoutAmount: y,
|
|
6583
6614
|
forceBalanceMethod: i,
|
|
6584
|
-
useBalance:
|
|
6615
|
+
useBalance: m,
|
|
6585
6616
|
voucher: I
|
|
6586
6617
|
}
|
|
6587
6618
|
};
|
|
@@ -6618,10 +6649,10 @@ class Ce {
|
|
|
6618
6649
|
sa(this);
|
|
6619
6650
|
}
|
|
6620
6651
|
_updatePayButtonAmount() {
|
|
6621
|
-
|
|
6652
|
+
Je(this);
|
|
6622
6653
|
}
|
|
6623
6654
|
_showAddCardView() {
|
|
6624
|
-
|
|
6655
|
+
gt(this);
|
|
6625
6656
|
}
|
|
6626
6657
|
_closeAddCardView() {
|
|
6627
6658
|
Ie(this);
|
|
@@ -6639,10 +6670,10 @@ class Ce {
|
|
|
6639
6670
|
}
|
|
6640
6671
|
// ─── Хранение токенов ────────────────────────────────────────────────────────
|
|
6641
6672
|
_saveTokensToStorage(t, n) {
|
|
6642
|
-
|
|
6673
|
+
je(t, n);
|
|
6643
6674
|
}
|
|
6644
6675
|
_clearAuthStorage() {
|
|
6645
|
-
|
|
6676
|
+
Tn();
|
|
6646
6677
|
}
|
|
6647
6678
|
_getAuthStorageValue(t) {
|
|
6648
6679
|
return Ce._getAuthStorageValue(t);
|
|
@@ -6683,13 +6714,13 @@ class Ce {
|
|
|
6683
6714
|
this._lifecycleListenersAttached && (document.removeEventListener("visibilitychange", this._boundVisibilityChange), window.removeEventListener("focus", this._boundWindowFocus), window.removeEventListener("pageshow", this._boundPageShow), this._lifecycleListenersAttached = !1);
|
|
6684
6715
|
}
|
|
6685
6716
|
_onVisibilityChange() {
|
|
6686
|
-
Ht() ||
|
|
6717
|
+
Ht() || yt(this);
|
|
6687
6718
|
}
|
|
6688
6719
|
_onWindowFocus() {
|
|
6689
|
-
|
|
6720
|
+
yt(this);
|
|
6690
6721
|
}
|
|
6691
6722
|
_onPageShow() {
|
|
6692
|
-
|
|
6723
|
+
yt(this);
|
|
6693
6724
|
}
|
|
6694
6725
|
// ─── Авторизация (приватная) ──────────────────────────────────────────────────
|
|
6695
6726
|
async _obtainTokenByRefreshOrTrackId() {
|
|
@@ -6697,13 +6728,13 @@ class Ce {
|
|
|
6697
6728
|
}
|
|
6698
6729
|
async _fetchCheckoutContextWithRetry() {
|
|
6699
6730
|
try {
|
|
6700
|
-
this.checkoutContext = await
|
|
6731
|
+
this.checkoutContext = await bt(
|
|
6701
6732
|
this.apiUrl,
|
|
6702
6733
|
this._getApiConfig()
|
|
6703
6734
|
);
|
|
6704
6735
|
} catch (t) {
|
|
6705
6736
|
if (t.status === 401)
|
|
6706
|
-
this._removeAuthStorageValue("webPayToken"), await this._obtainTokenByRefreshOrTrackId(), this.checkoutContext = await
|
|
6737
|
+
this._removeAuthStorageValue("webPayToken"), await this._obtainTokenByRefreshOrTrackId(), this.checkoutContext = await bt(
|
|
6707
6738
|
this.apiUrl,
|
|
6708
6739
|
this._getApiConfig()
|
|
6709
6740
|
);
|
|
@@ -6713,7 +6744,7 @@ class Ce {
|
|
|
6713
6744
|
}
|
|
6714
6745
|
async _fetchCoupons() {
|
|
6715
6746
|
try {
|
|
6716
|
-
const t = await
|
|
6747
|
+
const t = await Xr(this.apiUrl, this._getApiConfig()), r = (Array.isArray(t) ? t : Array.isArray(t == null ? void 0 : t.data) ? t.data : []).filter((o) => Number(o.reward_amount) > 0).sort((o, i) => o.sort_weight - i.sort_weight);
|
|
6717
6748
|
this.selectedCoupon = r.length > 0 ? r[0] : null, this.useCoupon = !1;
|
|
6718
6749
|
} catch {
|
|
6719
6750
|
this.selectedCoupon = null, this.useCoupon = !1;
|
|
@@ -6751,9 +6782,9 @@ class Ce {
|
|
|
6751
6782
|
if (this._destroyed || (await this._fetchCoupons(), this._destroyed)) return !1;
|
|
6752
6783
|
const r = $t(
|
|
6753
6784
|
(n = (t = this.checkoutContext) == null ? void 0 : t.data) == null ? void 0 : n.socket_connections,
|
|
6754
|
-
(o) =>
|
|
6785
|
+
(o) => Rn(this, o)
|
|
6755
6786
|
);
|
|
6756
|
-
return r && (this.centrifuge = r.centrifuge), this.selectedPaymentMethod =
|
|
6787
|
+
return r && (this.centrifuge = r.centrifuge), this.selectedPaymentMethod = mt(
|
|
6757
6788
|
this.checkoutContext.data,
|
|
6758
6789
|
this._getKaspiOptions()
|
|
6759
6790
|
), this._emitPaymentMethodSelected(), this._render(), !0;
|
|
@@ -6774,7 +6805,7 @@ class Ce {
|
|
|
6774
6805
|
}
|
|
6775
6806
|
getAvailablePaymentMethods() {
|
|
6776
6807
|
var t;
|
|
6777
|
-
return (t = this.checkoutContext) != null && t.data ?
|
|
6808
|
+
return (t = this.checkoutContext) != null && t.data ? Or(
|
|
6778
6809
|
this.checkoutContext.data,
|
|
6779
6810
|
(n) => this.t(n),
|
|
6780
6811
|
this._getKaspiOptions()
|
|
@@ -6807,7 +6838,7 @@ class Ce {
|
|
|
6807
6838
|
}
|
|
6808
6839
|
}
|
|
6809
6840
|
openPaymentSheet() {
|
|
6810
|
-
|
|
6841
|
+
hr(this);
|
|
6811
6842
|
}
|
|
6812
6843
|
closePaymentSheet() {
|
|
6813
6844
|
ae(this);
|
|
@@ -6822,15 +6853,15 @@ class Ce {
|
|
|
6822
6853
|
const i = (n = this.container) == null ? void 0 : n.querySelector('[data-sheet="payment"]');
|
|
6823
6854
|
i && (i.classList.add("choco-widget-payment-sheet--open"), this.isPaymentSheetOpen = !0);
|
|
6824
6855
|
}
|
|
6825
|
-
o &&
|
|
6856
|
+
o && gt(this);
|
|
6826
6857
|
return;
|
|
6827
6858
|
}
|
|
6828
|
-
|
|
6859
|
+
Je(this);
|
|
6829
6860
|
}
|
|
6830
6861
|
async updateAvailableBonus(t) {
|
|
6831
6862
|
if (typeof t != "number" || !Number.isFinite(t) || t < 0)
|
|
6832
6863
|
throw new Error("availableBonus must be a non-negative number");
|
|
6833
|
-
this.config.bonuses && (this.config.bonuses.availableBonus = t),
|
|
6864
|
+
this.config.bonuses && (this.config.bonuses.availableBonus = t), Je(this);
|
|
6834
6865
|
}
|
|
6835
6866
|
async updateLocale(t) {
|
|
6836
6867
|
if (typeof t != "string" || !this.translations[t])
|
|
@@ -6841,7 +6872,7 @@ class Ce {
|
|
|
6841
6872
|
const o = this.container.querySelector('[data-sheet="payment"]');
|
|
6842
6873
|
o && (o.classList.add("choco-widget-payment-sheet--open"), this.isPaymentSheetOpen = !0);
|
|
6843
6874
|
}
|
|
6844
|
-
r &&
|
|
6875
|
+
r && gt(this);
|
|
6845
6876
|
}
|
|
6846
6877
|
async setLoading(t) {
|
|
6847
6878
|
this.loading = !!t, ie(this);
|
|
@@ -6876,9 +6907,9 @@ class Ce {
|
|
|
6876
6907
|
await this._fetchCoupons(), this.centrifuge && (this.centrifuge.disconnect(), this.centrifuge = null);
|
|
6877
6908
|
const o = $t(
|
|
6878
6909
|
(r = (n = this.checkoutContext) == null ? void 0 : n.data) == null ? void 0 : r.socket_connections,
|
|
6879
|
-
(i) =>
|
|
6910
|
+
(i) => Rn(this, i)
|
|
6880
6911
|
);
|
|
6881
|
-
return o && (this.centrifuge = o.centrifuge), this.selectedPaymentMethod =
|
|
6912
|
+
return o && (this.centrifuge = o.centrifuge), this.selectedPaymentMethod = mt(
|
|
6882
6913
|
this.checkoutContext.data,
|
|
6883
6914
|
this._getKaspiOptions()
|
|
6884
6915
|
), this._emitPaymentMethodSelected(), this.paymentMethodDisabled = !1, this._render(), !0;
|