@embarkai/ui-kit 0.4.1 → 0.4.2

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.
@@ -573,8 +573,8 @@ var SHARE_VAULT_URL, TSS_URL;
573
573
  var init_server_backup = __esm({
574
574
  "src/iframe/lib/backup/server-backup.ts"() {
575
575
  init_crypto_utils();
576
- SHARE_VAULT_URL = typeof window.__EMBARK_SERVICES__ !== "undefined" && window.__EMBARK_SERVICES__?.shareVaultUrl || "https://api.lumiapassport.com/vault";
577
- TSS_URL = typeof window.__EMBARK_SERVICES__ !== "undefined" && window.__EMBARK_SERVICES__?.tssUrl || "https://api.lumiapassport.com/tss";
576
+ SHARE_VAULT_URL = "https://api.lumiapassport.com/vault";
577
+ TSS_URL = "https://api.lumiapassport.com/tss";
578
578
  }
579
579
  });
580
580
 
@@ -1308,6 +1308,9 @@ var ready_indicator_default = '<div class="ready-indicator">\n <div class="stat
1308
1308
  // src/iframe/templates/html/sign-eip712-tx.html
1309
1309
  var sign_eip712_tx_default = '<div\n style="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n background: #000000;\n "\n>\n <div\n style="\n display: flex;\n flex-direction: column;\n gap: var(--iframe-gap);\n align-items: center;\n background: var(--iframe-modal-bg);\n border-radius: 20px;\n padding: 20px;\n max-width: 320px;\n width: calc(100% - 40px);\n max-height: 90vh;\n overflow-y: auto;\n "\n >\n <!-- Header -->\n <div style="display: flex; align-items: center; gap: var(--iframe-gap); justify-content: center">\n {{#if metadataLogo}}\n <img\n src="{{metadataLogo}}"\n alt="{{metadataName}}"\n style="width: 48px; height: 48px; border-radius: 24px; object-fit: cover"\n />\n {{else}}\n <span\n style="\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: 24px;\n background-color: var(--iframe-button-bg);\n color: var(--iframe-button-text);\n font-size: 14px;\n font-weight: 600;\n "\n >\u{1F510}</span\n >\n {{/if}}\n\n <!-- ------------------------------------------------------------ -->\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n stroke="var(--iframe-text-secondary)"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n >\n <path d="M5 12h14" />\n <path d="m12 5 7 7-7 7" />\n </svg>\n <!-- ------------------------------------------------------------ -->\n\n {{#if userAvatar}}\n <img\n src="{{userAvatar}}"\n alt="{{userName}}"\n style="width: 48px; height: 48px; border-radius: 24px; object-fit: cover"\n />\n {{else}}\n <span\n style="\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: 24px;\n background-color: var(--iframe-button-bg);\n color: var(--iframe-button-text);\n font-size: 14px;\n font-weight: 600;\n "\n >U</span\n >\n {{/if}}\n </div>\n\n <div style="display: flex; align-items: center; gap: var(--iframe-gap); justify-content: center">\n <span\n style="\n width: fit-content;\n font-size: var(--iframe-h2-fz);\n font-weight: var(--iframe-heading-fw);\n line-height: 150%;\n text-align: center;\n "\n >Signature Request</span\n >\n </div>\n\n <div class="domain-info verified">\n <span style="display: block; width: 100%; font-size: 12px; text-align: center; font-family: monospace">\n {{#if isVerifiedOrigin}}\n <span>\u2713</span>\n {{/if}} {{origin}}</span\n >\n </div>\n\n <!-- EIP712 Message Content -->\n <div class="eip712-content">\n <details class="eip712-details">\n <summary>Advanced details</summary>\n\n <div class="section-title">\u{1F4DD} Message</div>\n <div class="eip712-section">\n <div class="section-subtitle">{{primaryType}}</div>\n {{messageFields}}\n </div>\n\n <div class="section-title" style="margin-top: 16px">\u{1F50D} Domain</div>\n <div class="eip712-section">{{domainFields}}</div>\n\n <div class="section-title" style="margin-top: 16px">\u{1F4CB} Full Message</div>\n <pre class="eip712-raw"><code>{{fullMessageJson}}</code></pre>\n </details>\n </div>\n\n <!-- Trust App Option -->\n <div class="trust-app-section">\n <label class="trust-app-label">\n <input type="checkbox" class="trust-app-checkbox" />\n <span>Trust this application and skip confirmation for future signatures</span>\n </label>\n </div>\n\n <!-- Action Buttons -->\n <div class="actions">\n <button class="cancel-btn">Reject</button>\n <button class="confirm-btn">Sign</button>\n </div>\n\n <!-- Footer Notice -->\n <div class="footer-notice">\n <p class="footer-note">Only sign messages from applications you trust.</p>\n </div>\n </div>\n</div>\n';
1310
1310
 
1311
+ // src/iframe/templates/html/passkey-confirm.html
1312
+ var passkey_confirm_default = '<div\n style="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n background: #000000;\n "\n>\n <div\n style="\n display: flex;\n flex-direction: column;\n gap: var(--iframe-gap);\n align-items: center;\n background: var(--iframe-modal-bg);\n border-radius: 20px;\n padding: 20px;\n max-width: 320px;\n width: calc(100% - 40px);\n max-height: 90vh;\n overflow-y: auto;\n "\n >\n <!-- Icon -->\n <span\n style="\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: 24px;\n background-color: var(--iframe-button-bg);\n color: var(--iframe-button-text);\n font-size: 14px;\n font-weight: 600;\n "\n >\u{1F511}</span\n >\n\n <!-- Title -->\n <div style="display: flex; align-items: center; gap: var(--iframe-gap); justify-content: center">\n <span\n style="\n width: fit-content;\n font-size: var(--iframe-h1-fz);\n font-weight: var(--iframe-heading-fw);\n line-height: 150%;\n text-align: center;\n "\n >{{title}}</span\n >\n </div>\n\n <!-- Description -->\n <span\n class="passkey-status"\n style="\n display: block;\n text-align: center;\n font-size: 10px;\n color: var(--iframe-text-secondary);\n "\n >{{description}}</span\n >\n\n <!-- Action buttons -->\n <div class="passkey-actions" style="display: flex; gap: var(--iframe-gap); width: 100%; align-items: center">\n <button class="cancel-btn">Reject</button>\n <button class="confirm-btn">Confirm</button>\n </div>\n\n <!-- Footer notice -->\n <span\n style="\n display: block;\n padding: var(--iframe-gap);\n text-align: center;\n font-size: 10px;\n color: var(--iframe-text-secondary);\n "\n >\n Your passkey will be used to securely encrypt the backup.\n </span>\n </div>\n</div>';
1313
+
1311
1314
  // src/iframe/templates/template-loader.ts
1312
1315
  var TemplateLoader = class {
1313
1316
  /** Get template by name */
@@ -1333,6 +1336,8 @@ var TemplateLoader = class {
1333
1336
  return sign_eip712_tx_default;
1334
1337
  case "confirm-tx":
1335
1338
  return confirm_tx_default;
1339
+ case "passkey-confirm":
1340
+ return passkey_confirm_default;
1336
1341
  default:
1337
1342
  return null;
1338
1343
  }
@@ -2999,229 +3004,1837 @@ var DKGManager = class extends TokenRefreshApiClient {
2999
3004
  sessionId
3000
3005
  };
3001
3006
  }
3002
- /**
3003
- * Derive Ethereum address from uncompressed public key
3004
- */
3005
- deriveAddress(publicKeyBase64) {
3006
- const b64decoded = atob(publicKeyBase64);
3007
- const bytes = new Uint8Array(b64decoded.length);
3008
- for (let i = 0; i < b64decoded.length; i++) {
3009
- bytes[i] = b64decoded.charCodeAt(i);
3010
- }
3011
- const pubkeyBytes = bytes.slice(1);
3012
- const pubkeyHex = Array.from(pubkeyBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
3013
- const hash = keccak256(`0x${pubkeyHex}`);
3014
- const addr = hash.slice(-40);
3015
- return this.toChecksumAddress(`0x${addr}`);
3007
+ /**
3008
+ * Derive Ethereum address from uncompressed public key
3009
+ */
3010
+ deriveAddress(publicKeyBase64) {
3011
+ const b64decoded = atob(publicKeyBase64);
3012
+ const bytes = new Uint8Array(b64decoded.length);
3013
+ for (let i = 0; i < b64decoded.length; i++) {
3014
+ bytes[i] = b64decoded.charCodeAt(i);
3015
+ }
3016
+ const pubkeyBytes = bytes.slice(1);
3017
+ const pubkeyHex = Array.from(pubkeyBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
3018
+ const hash = keccak256(`0x${pubkeyHex}`);
3019
+ const addr = hash.slice(-40);
3020
+ return this.toChecksumAddress(`0x${addr}`);
3021
+ }
3022
+ /**
3023
+ * Apply EIP-55 checksum to address
3024
+ */
3025
+ toChecksumAddress(address) {
3026
+ const addr = address.toLowerCase().replace("0x", "");
3027
+ const encoder3 = new TextEncoder();
3028
+ const addrBytes = encoder3.encode(addr);
3029
+ const hash = keccak256(addrBytes).replace("0x", "");
3030
+ let checksumAddress = "0x";
3031
+ for (let i = 0; i < addr.length; i++) {
3032
+ checksumAddress += parseInt(hash[i], 16) >= 8 ? addr[i].toUpperCase() : addr[i];
3033
+ }
3034
+ return checksumAddress;
3035
+ }
3036
+ /**
3037
+ * Generate secure domain label for DKG
3038
+ */
3039
+ generateDomainLabel(userId) {
3040
+ const timestamp = Date.now();
3041
+ const randomBytes = new Uint8Array(16);
3042
+ crypto.getRandomValues(randomBytes);
3043
+ const randomHex = Array.from(randomBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
3044
+ return `dkls23:2of2:aa:${userId}:${timestamp}:${randomHex}`;
3045
+ }
3046
+ /**
3047
+ * Extract server message from response
3048
+ */
3049
+ extractServerMessage(response) {
3050
+ return response?.msgNext || response?.msg_next || response?.msg || null;
3051
+ }
3052
+ };
3053
+
3054
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
3055
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
3056
+ var freeGlobal_default = freeGlobal;
3057
+
3058
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
3059
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
3060
+ var root = freeGlobal_default || freeSelf || Function("return this")();
3061
+ var root_default = root;
3062
+
3063
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
3064
+ var Symbol2 = root_default.Symbol;
3065
+ var Symbol_default = Symbol2;
3066
+
3067
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
3068
+ var objectProto = Object.prototype;
3069
+ var hasOwnProperty = objectProto.hasOwnProperty;
3070
+ var nativeObjectToString = objectProto.toString;
3071
+ var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
3072
+ function getRawTag(value) {
3073
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
3074
+ try {
3075
+ value[symToStringTag] = void 0;
3076
+ var unmasked = true;
3077
+ } catch (e) {
3078
+ }
3079
+ var result = nativeObjectToString.call(value);
3080
+ if (unmasked) {
3081
+ if (isOwn) {
3082
+ value[symToStringTag] = tag;
3083
+ } else {
3084
+ delete value[symToStringTag];
3085
+ }
3086
+ }
3087
+ return result;
3088
+ }
3089
+ var getRawTag_default = getRawTag;
3090
+
3091
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
3092
+ var objectProto2 = Object.prototype;
3093
+ var nativeObjectToString2 = objectProto2.toString;
3094
+ function objectToString(value) {
3095
+ return nativeObjectToString2.call(value);
3096
+ }
3097
+ var objectToString_default = objectToString;
3098
+
3099
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
3100
+ var nullTag = "[object Null]";
3101
+ var undefinedTag = "[object Undefined]";
3102
+ var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
3103
+ function baseGetTag(value) {
3104
+ if (value == null) {
3105
+ return value === void 0 ? undefinedTag : nullTag;
3106
+ }
3107
+ return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
3108
+ }
3109
+ var baseGetTag_default = baseGetTag;
3110
+
3111
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
3112
+ function isObjectLike(value) {
3113
+ return value != null && typeof value == "object";
3114
+ }
3115
+ var isObjectLike_default = isObjectLike;
3116
+
3117
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js
3118
+ var symbolTag = "[object Symbol]";
3119
+ function isSymbol(value) {
3120
+ return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
3121
+ }
3122
+ var isSymbol_default = isSymbol;
3123
+
3124
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js
3125
+ function arrayMap(array, iteratee) {
3126
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
3127
+ while (++index < length) {
3128
+ result[index] = iteratee(array[index], index, array);
3129
+ }
3130
+ return result;
3131
+ }
3132
+ var arrayMap_default = arrayMap;
3133
+
3134
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
3135
+ var isArray = Array.isArray;
3136
+ var isArray_default = isArray;
3137
+
3138
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js
3139
+ var INFINITY = 1 / 0;
3140
+ var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
3141
+ var symbolToString = symbolProto ? symbolProto.toString : void 0;
3142
+ function baseToString(value) {
3143
+ if (typeof value == "string") {
3144
+ return value;
3145
+ }
3146
+ if (isArray_default(value)) {
3147
+ return arrayMap_default(value, baseToString) + "";
3148
+ }
3149
+ if (isSymbol_default(value)) {
3150
+ return symbolToString ? symbolToString.call(value) : "";
3151
+ }
3152
+ var result = value + "";
3153
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
3154
+ }
3155
+ var baseToString_default = baseToString;
3156
+
3157
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js
3158
+ function isObject(value) {
3159
+ var type = typeof value;
3160
+ return value != null && (type == "object" || type == "function");
3161
+ }
3162
+ var isObject_default = isObject;
3163
+
3164
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js
3165
+ function identity(value) {
3166
+ return value;
3167
+ }
3168
+ var identity_default = identity;
3169
+
3170
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js
3171
+ var asyncTag = "[object AsyncFunction]";
3172
+ var funcTag = "[object Function]";
3173
+ var genTag = "[object GeneratorFunction]";
3174
+ var proxyTag = "[object Proxy]";
3175
+ function isFunction(value) {
3176
+ if (!isObject_default(value)) {
3177
+ return false;
3178
+ }
3179
+ var tag = baseGetTag_default(value);
3180
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
3181
+ }
3182
+ var isFunction_default = isFunction;
3183
+
3184
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js
3185
+ var coreJsData = root_default["__core-js_shared__"];
3186
+ var coreJsData_default = coreJsData;
3187
+
3188
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js
3189
+ var maskSrcKey = (function() {
3190
+ var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
3191
+ return uid ? "Symbol(src)_1." + uid : "";
3192
+ })();
3193
+ function isMasked(func) {
3194
+ return !!maskSrcKey && maskSrcKey in func;
3195
+ }
3196
+ var isMasked_default = isMasked;
3197
+
3198
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js
3199
+ var funcProto = Function.prototype;
3200
+ var funcToString = funcProto.toString;
3201
+ function toSource(func) {
3202
+ if (func != null) {
3203
+ try {
3204
+ return funcToString.call(func);
3205
+ } catch (e) {
3206
+ }
3207
+ try {
3208
+ return func + "";
3209
+ } catch (e) {
3210
+ }
3211
+ }
3212
+ return "";
3213
+ }
3214
+ var toSource_default = toSource;
3215
+
3216
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js
3217
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
3218
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
3219
+ var funcProto2 = Function.prototype;
3220
+ var objectProto3 = Object.prototype;
3221
+ var funcToString2 = funcProto2.toString;
3222
+ var hasOwnProperty2 = objectProto3.hasOwnProperty;
3223
+ var reIsNative = RegExp(
3224
+ "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
3225
+ );
3226
+ function baseIsNative(value) {
3227
+ if (!isObject_default(value) || isMasked_default(value)) {
3228
+ return false;
3229
+ }
3230
+ var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
3231
+ return pattern.test(toSource_default(value));
3232
+ }
3233
+ var baseIsNative_default = baseIsNative;
3234
+
3235
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js
3236
+ function getValue(object, key) {
3237
+ return object == null ? void 0 : object[key];
3238
+ }
3239
+ var getValue_default = getValue;
3240
+
3241
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js
3242
+ function getNative(object, key) {
3243
+ var value = getValue_default(object, key);
3244
+ return baseIsNative_default(value) ? value : void 0;
3245
+ }
3246
+ var getNative_default = getNative;
3247
+
3248
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js
3249
+ var WeakMap = getNative_default(root_default, "WeakMap");
3250
+ var WeakMap_default = WeakMap;
3251
+
3252
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js
3253
+ var objectCreate = Object.create;
3254
+ var baseCreate = /* @__PURE__ */ (function() {
3255
+ function object() {
3256
+ }
3257
+ return function(proto) {
3258
+ if (!isObject_default(proto)) {
3259
+ return {};
3260
+ }
3261
+ if (objectCreate) {
3262
+ return objectCreate(proto);
3263
+ }
3264
+ object.prototype = proto;
3265
+ var result = new object();
3266
+ object.prototype = void 0;
3267
+ return result;
3268
+ };
3269
+ })();
3270
+ var baseCreate_default = baseCreate;
3271
+
3272
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js
3273
+ function apply(func, thisArg, args) {
3274
+ switch (args.length) {
3275
+ case 0:
3276
+ return func.call(thisArg);
3277
+ case 1:
3278
+ return func.call(thisArg, args[0]);
3279
+ case 2:
3280
+ return func.call(thisArg, args[0], args[1]);
3281
+ case 3:
3282
+ return func.call(thisArg, args[0], args[1], args[2]);
3283
+ }
3284
+ return func.apply(thisArg, args);
3285
+ }
3286
+ var apply_default = apply;
3287
+
3288
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js
3289
+ function copyArray(source, array) {
3290
+ var index = -1, length = source.length;
3291
+ array || (array = Array(length));
3292
+ while (++index < length) {
3293
+ array[index] = source[index];
3294
+ }
3295
+ return array;
3296
+ }
3297
+ var copyArray_default = copyArray;
3298
+
3299
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js
3300
+ var HOT_COUNT = 800;
3301
+ var HOT_SPAN = 16;
3302
+ var nativeNow = Date.now;
3303
+ function shortOut(func) {
3304
+ var count = 0, lastCalled = 0;
3305
+ return function() {
3306
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
3307
+ lastCalled = stamp;
3308
+ if (remaining > 0) {
3309
+ if (++count >= HOT_COUNT) {
3310
+ return arguments[0];
3311
+ }
3312
+ } else {
3313
+ count = 0;
3314
+ }
3315
+ return func.apply(void 0, arguments);
3316
+ };
3317
+ }
3318
+ var shortOut_default = shortOut;
3319
+
3320
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js
3321
+ function constant(value) {
3322
+ return function() {
3323
+ return value;
3324
+ };
3325
+ }
3326
+ var constant_default = constant;
3327
+
3328
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js
3329
+ var defineProperty = (function() {
3330
+ try {
3331
+ var func = getNative_default(Object, "defineProperty");
3332
+ func({}, "", {});
3333
+ return func;
3334
+ } catch (e) {
3335
+ }
3336
+ })();
3337
+ var defineProperty_default = defineProperty;
3338
+
3339
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js
3340
+ var baseSetToString = !defineProperty_default ? identity_default : function(func, string) {
3341
+ return defineProperty_default(func, "toString", {
3342
+ "configurable": true,
3343
+ "enumerable": false,
3344
+ "value": constant_default(string),
3345
+ "writable": true
3346
+ });
3347
+ };
3348
+ var baseSetToString_default = baseSetToString;
3349
+
3350
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js
3351
+ var setToString = shortOut_default(baseSetToString_default);
3352
+ var setToString_default = setToString;
3353
+
3354
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js
3355
+ function arrayEach(array, iteratee) {
3356
+ var index = -1, length = array == null ? 0 : array.length;
3357
+ while (++index < length) {
3358
+ if (iteratee(array[index], index, array) === false) {
3359
+ break;
3360
+ }
3361
+ }
3362
+ return array;
3363
+ }
3364
+ var arrayEach_default = arrayEach;
3365
+
3366
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js
3367
+ var MAX_SAFE_INTEGER = 9007199254740991;
3368
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
3369
+ function isIndex(value, length) {
3370
+ var type = typeof value;
3371
+ length = length == null ? MAX_SAFE_INTEGER : length;
3372
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
3373
+ }
3374
+ var isIndex_default = isIndex;
3375
+
3376
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js
3377
+ function baseAssignValue(object, key, value) {
3378
+ if (key == "__proto__" && defineProperty_default) {
3379
+ defineProperty_default(object, key, {
3380
+ "configurable": true,
3381
+ "enumerable": true,
3382
+ "value": value,
3383
+ "writable": true
3384
+ });
3385
+ } else {
3386
+ object[key] = value;
3387
+ }
3388
+ }
3389
+ var baseAssignValue_default = baseAssignValue;
3390
+
3391
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js
3392
+ function eq(value, other) {
3393
+ return value === other || value !== value && other !== other;
3394
+ }
3395
+ var eq_default = eq;
3396
+
3397
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js
3398
+ var objectProto4 = Object.prototype;
3399
+ var hasOwnProperty3 = objectProto4.hasOwnProperty;
3400
+ function assignValue(object, key, value) {
3401
+ var objValue = object[key];
3402
+ if (!(hasOwnProperty3.call(object, key) && eq_default(objValue, value)) || value === void 0 && !(key in object)) {
3403
+ baseAssignValue_default(object, key, value);
3404
+ }
3405
+ }
3406
+ var assignValue_default = assignValue;
3407
+
3408
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js
3409
+ function copyObject(source, props, object, customizer) {
3410
+ var isNew = !object;
3411
+ object || (object = {});
3412
+ var index = -1, length = props.length;
3413
+ while (++index < length) {
3414
+ var key = props[index];
3415
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
3416
+ if (newValue === void 0) {
3417
+ newValue = source[key];
3418
+ }
3419
+ if (isNew) {
3420
+ baseAssignValue_default(object, key, newValue);
3421
+ } else {
3422
+ assignValue_default(object, key, newValue);
3423
+ }
3424
+ }
3425
+ return object;
3426
+ }
3427
+ var copyObject_default = copyObject;
3428
+
3429
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js
3430
+ var nativeMax = Math.max;
3431
+ function overRest(func, start, transform) {
3432
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
3433
+ return function() {
3434
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
3435
+ while (++index < length) {
3436
+ array[index] = args[start + index];
3437
+ }
3438
+ index = -1;
3439
+ var otherArgs = Array(start + 1);
3440
+ while (++index < start) {
3441
+ otherArgs[index] = args[index];
3442
+ }
3443
+ otherArgs[start] = transform(array);
3444
+ return apply_default(func, this, otherArgs);
3445
+ };
3446
+ }
3447
+ var overRest_default = overRest;
3448
+
3449
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js
3450
+ var MAX_SAFE_INTEGER2 = 9007199254740991;
3451
+ function isLength(value) {
3452
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
3453
+ }
3454
+ var isLength_default = isLength;
3455
+
3456
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js
3457
+ function isArrayLike(value) {
3458
+ return value != null && isLength_default(value.length) && !isFunction_default(value);
3459
+ }
3460
+ var isArrayLike_default = isArrayLike;
3461
+
3462
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js
3463
+ var objectProto5 = Object.prototype;
3464
+ function isPrototype(value) {
3465
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto5;
3466
+ return value === proto;
3467
+ }
3468
+ var isPrototype_default = isPrototype;
3469
+
3470
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js
3471
+ function baseTimes(n, iteratee) {
3472
+ var index = -1, result = Array(n);
3473
+ while (++index < n) {
3474
+ result[index] = iteratee(index);
3475
+ }
3476
+ return result;
3477
+ }
3478
+ var baseTimes_default = baseTimes;
3479
+
3480
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js
3481
+ var argsTag = "[object Arguments]";
3482
+ function baseIsArguments(value) {
3483
+ return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
3484
+ }
3485
+ var baseIsArguments_default = baseIsArguments;
3486
+
3487
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
3488
+ var objectProto6 = Object.prototype;
3489
+ var hasOwnProperty4 = objectProto6.hasOwnProperty;
3490
+ var propertyIsEnumerable = objectProto6.propertyIsEnumerable;
3491
+ var isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
3492
+ return arguments;
3493
+ })()) ? baseIsArguments_default : function(value) {
3494
+ return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
3495
+ };
3496
+ var isArguments_default = isArguments;
3497
+
3498
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js
3499
+ function stubFalse() {
3500
+ return false;
3501
+ }
3502
+ var stubFalse_default = stubFalse;
3503
+
3504
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js
3505
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
3506
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
3507
+ var moduleExports = freeModule && freeModule.exports === freeExports;
3508
+ var Buffer2 = moduleExports ? root_default.Buffer : void 0;
3509
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
3510
+ var isBuffer = nativeIsBuffer || stubFalse_default;
3511
+ var isBuffer_default = isBuffer;
3512
+
3513
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsTypedArray.js
3514
+ var argsTag2 = "[object Arguments]";
3515
+ var arrayTag = "[object Array]";
3516
+ var boolTag = "[object Boolean]";
3517
+ var dateTag = "[object Date]";
3518
+ var errorTag = "[object Error]";
3519
+ var funcTag2 = "[object Function]";
3520
+ var mapTag = "[object Map]";
3521
+ var numberTag = "[object Number]";
3522
+ var objectTag = "[object Object]";
3523
+ var regexpTag = "[object RegExp]";
3524
+ var setTag = "[object Set]";
3525
+ var stringTag = "[object String]";
3526
+ var weakMapTag = "[object WeakMap]";
3527
+ var arrayBufferTag = "[object ArrayBuffer]";
3528
+ var dataViewTag = "[object DataView]";
3529
+ var float32Tag = "[object Float32Array]";
3530
+ var float64Tag = "[object Float64Array]";
3531
+ var int8Tag = "[object Int8Array]";
3532
+ var int16Tag = "[object Int16Array]";
3533
+ var int32Tag = "[object Int32Array]";
3534
+ var uint8Tag = "[object Uint8Array]";
3535
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
3536
+ var uint16Tag = "[object Uint16Array]";
3537
+ var uint32Tag = "[object Uint32Array]";
3538
+ var typedArrayTags = {};
3539
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
3540
+ typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
3541
+ function baseIsTypedArray(value) {
3542
+ return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags[baseGetTag_default(value)];
3543
+ }
3544
+ var baseIsTypedArray_default = baseIsTypedArray;
3545
+
3546
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js
3547
+ function baseUnary(func) {
3548
+ return function(value) {
3549
+ return func(value);
3550
+ };
3551
+ }
3552
+ var baseUnary_default = baseUnary;
3553
+
3554
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js
3555
+ var freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
3556
+ var freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
3557
+ var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
3558
+ var freeProcess = moduleExports2 && freeGlobal_default.process;
3559
+ var nodeUtil = (function() {
3560
+ try {
3561
+ var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
3562
+ if (types) {
3563
+ return types;
3564
+ }
3565
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
3566
+ } catch (e) {
3567
+ }
3568
+ })();
3569
+ var nodeUtil_default = nodeUtil;
3570
+
3571
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isTypedArray.js
3572
+ var nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
3573
+ var isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
3574
+ var isTypedArray_default = isTypedArray;
3575
+
3576
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js
3577
+ var objectProto7 = Object.prototype;
3578
+ var hasOwnProperty5 = objectProto7.hasOwnProperty;
3579
+ function arrayLikeKeys(value, inherited) {
3580
+ var isArr = isArray_default(value), isArg = !isArr && isArguments_default(value), isBuff = !isArr && !isArg && isBuffer_default(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes_default(value.length, String) : [], length = result.length;
3581
+ for (var key in value) {
3582
+ if ((inherited || hasOwnProperty5.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
3583
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
3584
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
3585
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
3586
+ isIndex_default(key, length)))) {
3587
+ result.push(key);
3588
+ }
3589
+ }
3590
+ return result;
3591
+ }
3592
+ var arrayLikeKeys_default = arrayLikeKeys;
3593
+
3594
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js
3595
+ function overArg(func, transform) {
3596
+ return function(arg) {
3597
+ return func(transform(arg));
3598
+ };
3599
+ }
3600
+ var overArg_default = overArg;
3601
+
3602
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js
3603
+ var nativeKeys = overArg_default(Object.keys, Object);
3604
+ var nativeKeys_default = nativeKeys;
3605
+
3606
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeys.js
3607
+ var objectProto8 = Object.prototype;
3608
+ var hasOwnProperty6 = objectProto8.hasOwnProperty;
3609
+ function baseKeys(object) {
3610
+ if (!isPrototype_default(object)) {
3611
+ return nativeKeys_default(object);
3612
+ }
3613
+ var result = [];
3614
+ for (var key in Object(object)) {
3615
+ if (hasOwnProperty6.call(object, key) && key != "constructor") {
3616
+ result.push(key);
3617
+ }
3618
+ }
3619
+ return result;
3620
+ }
3621
+ var baseKeys_default = baseKeys;
3622
+
3623
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js
3624
+ function keys(object) {
3625
+ return isArrayLike_default(object) ? arrayLikeKeys_default(object) : baseKeys_default(object);
3626
+ }
3627
+ var keys_default = keys;
3628
+
3629
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js
3630
+ function nativeKeysIn(object) {
3631
+ var result = [];
3632
+ if (object != null) {
3633
+ for (var key in Object(object)) {
3634
+ result.push(key);
3635
+ }
3636
+ }
3637
+ return result;
3638
+ }
3639
+ var nativeKeysIn_default = nativeKeysIn;
3640
+
3641
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js
3642
+ var objectProto9 = Object.prototype;
3643
+ var hasOwnProperty7 = objectProto9.hasOwnProperty;
3644
+ function baseKeysIn(object) {
3645
+ if (!isObject_default(object)) {
3646
+ return nativeKeysIn_default(object);
3647
+ }
3648
+ var isProto = isPrototype_default(object), result = [];
3649
+ for (var key in object) {
3650
+ if (!(key == "constructor" && (isProto || !hasOwnProperty7.call(object, key)))) {
3651
+ result.push(key);
3652
+ }
3653
+ }
3654
+ return result;
3655
+ }
3656
+ var baseKeysIn_default = baseKeysIn;
3657
+
3658
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js
3659
+ function keysIn(object) {
3660
+ return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object);
3661
+ }
3662
+ var keysIn_default = keysIn;
3663
+
3664
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js
3665
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
3666
+ var reIsPlainProp = /^\w*$/;
3667
+ function isKey(value, object) {
3668
+ if (isArray_default(value)) {
3669
+ return false;
3670
+ }
3671
+ var type = typeof value;
3672
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol_default(value)) {
3673
+ return true;
3674
+ }
3675
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
3676
+ }
3677
+ var isKey_default = isKey;
3678
+
3679
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js
3680
+ var nativeCreate = getNative_default(Object, "create");
3681
+ var nativeCreate_default = nativeCreate;
3682
+
3683
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js
3684
+ function hashClear() {
3685
+ this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
3686
+ this.size = 0;
3687
+ }
3688
+ var hashClear_default = hashClear;
3689
+
3690
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js
3691
+ function hashDelete(key) {
3692
+ var result = this.has(key) && delete this.__data__[key];
3693
+ this.size -= result ? 1 : 0;
3694
+ return result;
3695
+ }
3696
+ var hashDelete_default = hashDelete;
3697
+
3698
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js
3699
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
3700
+ var objectProto10 = Object.prototype;
3701
+ var hasOwnProperty8 = objectProto10.hasOwnProperty;
3702
+ function hashGet(key) {
3703
+ var data = this.__data__;
3704
+ if (nativeCreate_default) {
3705
+ var result = data[key];
3706
+ return result === HASH_UNDEFINED ? void 0 : result;
3707
+ }
3708
+ return hasOwnProperty8.call(data, key) ? data[key] : void 0;
3709
+ }
3710
+ var hashGet_default = hashGet;
3711
+
3712
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js
3713
+ var objectProto11 = Object.prototype;
3714
+ var hasOwnProperty9 = objectProto11.hasOwnProperty;
3715
+ function hashHas(key) {
3716
+ var data = this.__data__;
3717
+ return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty9.call(data, key);
3718
+ }
3719
+ var hashHas_default = hashHas;
3720
+
3721
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js
3722
+ var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
3723
+ function hashSet(key, value) {
3724
+ var data = this.__data__;
3725
+ this.size += this.has(key) ? 0 : 1;
3726
+ data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
3727
+ return this;
3728
+ }
3729
+ var hashSet_default = hashSet;
3730
+
3731
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js
3732
+ function Hash2(entries) {
3733
+ var index = -1, length = entries == null ? 0 : entries.length;
3734
+ this.clear();
3735
+ while (++index < length) {
3736
+ var entry = entries[index];
3737
+ this.set(entry[0], entry[1]);
3738
+ }
3739
+ }
3740
+ Hash2.prototype.clear = hashClear_default;
3741
+ Hash2.prototype["delete"] = hashDelete_default;
3742
+ Hash2.prototype.get = hashGet_default;
3743
+ Hash2.prototype.has = hashHas_default;
3744
+ Hash2.prototype.set = hashSet_default;
3745
+ var Hash_default = Hash2;
3746
+
3747
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js
3748
+ function listCacheClear() {
3749
+ this.__data__ = [];
3750
+ this.size = 0;
3751
+ }
3752
+ var listCacheClear_default = listCacheClear;
3753
+
3754
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js
3755
+ function assocIndexOf(array, key) {
3756
+ var length = array.length;
3757
+ while (length--) {
3758
+ if (eq_default(array[length][0], key)) {
3759
+ return length;
3760
+ }
3761
+ }
3762
+ return -1;
3763
+ }
3764
+ var assocIndexOf_default = assocIndexOf;
3765
+
3766
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js
3767
+ var arrayProto = Array.prototype;
3768
+ var splice = arrayProto.splice;
3769
+ function listCacheDelete(key) {
3770
+ var data = this.__data__, index = assocIndexOf_default(data, key);
3771
+ if (index < 0) {
3772
+ return false;
3773
+ }
3774
+ var lastIndex = data.length - 1;
3775
+ if (index == lastIndex) {
3776
+ data.pop();
3777
+ } else {
3778
+ splice.call(data, index, 1);
3779
+ }
3780
+ --this.size;
3781
+ return true;
3782
+ }
3783
+ var listCacheDelete_default = listCacheDelete;
3784
+
3785
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js
3786
+ function listCacheGet(key) {
3787
+ var data = this.__data__, index = assocIndexOf_default(data, key);
3788
+ return index < 0 ? void 0 : data[index][1];
3789
+ }
3790
+ var listCacheGet_default = listCacheGet;
3791
+
3792
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js
3793
+ function listCacheHas(key) {
3794
+ return assocIndexOf_default(this.__data__, key) > -1;
3795
+ }
3796
+ var listCacheHas_default = listCacheHas;
3797
+
3798
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js
3799
+ function listCacheSet(key, value) {
3800
+ var data = this.__data__, index = assocIndexOf_default(data, key);
3801
+ if (index < 0) {
3802
+ ++this.size;
3803
+ data.push([key, value]);
3804
+ } else {
3805
+ data[index][1] = value;
3806
+ }
3807
+ return this;
3808
+ }
3809
+ var listCacheSet_default = listCacheSet;
3810
+
3811
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js
3812
+ function ListCache(entries) {
3813
+ var index = -1, length = entries == null ? 0 : entries.length;
3814
+ this.clear();
3815
+ while (++index < length) {
3816
+ var entry = entries[index];
3817
+ this.set(entry[0], entry[1]);
3818
+ }
3819
+ }
3820
+ ListCache.prototype.clear = listCacheClear_default;
3821
+ ListCache.prototype["delete"] = listCacheDelete_default;
3822
+ ListCache.prototype.get = listCacheGet_default;
3823
+ ListCache.prototype.has = listCacheHas_default;
3824
+ ListCache.prototype.set = listCacheSet_default;
3825
+ var ListCache_default = ListCache;
3826
+
3827
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js
3828
+ var Map2 = getNative_default(root_default, "Map");
3829
+ var Map_default = Map2;
3830
+
3831
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js
3832
+ function mapCacheClear() {
3833
+ this.size = 0;
3834
+ this.__data__ = {
3835
+ "hash": new Hash_default(),
3836
+ "map": new (Map_default || ListCache_default)(),
3837
+ "string": new Hash_default()
3838
+ };
3839
+ }
3840
+ var mapCacheClear_default = mapCacheClear;
3841
+
3842
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js
3843
+ function isKeyable(value) {
3844
+ var type = typeof value;
3845
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
3846
+ }
3847
+ var isKeyable_default = isKeyable;
3848
+
3849
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js
3850
+ function getMapData(map, key) {
3851
+ var data = map.__data__;
3852
+ return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
3853
+ }
3854
+ var getMapData_default = getMapData;
3855
+
3856
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js
3857
+ function mapCacheDelete(key) {
3858
+ var result = getMapData_default(this, key)["delete"](key);
3859
+ this.size -= result ? 1 : 0;
3860
+ return result;
3861
+ }
3862
+ var mapCacheDelete_default = mapCacheDelete;
3863
+
3864
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js
3865
+ function mapCacheGet(key) {
3866
+ return getMapData_default(this, key).get(key);
3867
+ }
3868
+ var mapCacheGet_default = mapCacheGet;
3869
+
3870
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js
3871
+ function mapCacheHas(key) {
3872
+ return getMapData_default(this, key).has(key);
3873
+ }
3874
+ var mapCacheHas_default = mapCacheHas;
3875
+
3876
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js
3877
+ function mapCacheSet(key, value) {
3878
+ var data = getMapData_default(this, key), size2 = data.size;
3879
+ data.set(key, value);
3880
+ this.size += data.size == size2 ? 0 : 1;
3881
+ return this;
3882
+ }
3883
+ var mapCacheSet_default = mapCacheSet;
3884
+
3885
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js
3886
+ function MapCache(entries) {
3887
+ var index = -1, length = entries == null ? 0 : entries.length;
3888
+ this.clear();
3889
+ while (++index < length) {
3890
+ var entry = entries[index];
3891
+ this.set(entry[0], entry[1]);
3892
+ }
3893
+ }
3894
+ MapCache.prototype.clear = mapCacheClear_default;
3895
+ MapCache.prototype["delete"] = mapCacheDelete_default;
3896
+ MapCache.prototype.get = mapCacheGet_default;
3897
+ MapCache.prototype.has = mapCacheHas_default;
3898
+ MapCache.prototype.set = mapCacheSet_default;
3899
+ var MapCache_default = MapCache;
3900
+
3901
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js
3902
+ var FUNC_ERROR_TEXT = "Expected a function";
3903
+ function memoize(func, resolver) {
3904
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
3905
+ throw new TypeError(FUNC_ERROR_TEXT);
3906
+ }
3907
+ var memoized = function() {
3908
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
3909
+ if (cache.has(key)) {
3910
+ return cache.get(key);
3911
+ }
3912
+ var result = func.apply(this, args);
3913
+ memoized.cache = cache.set(key, result) || cache;
3914
+ return result;
3915
+ };
3916
+ memoized.cache = new (memoize.Cache || MapCache_default)();
3917
+ return memoized;
3918
+ }
3919
+ memoize.Cache = MapCache_default;
3920
+ var memoize_default = memoize;
3921
+
3922
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js
3923
+ var MAX_MEMOIZE_SIZE = 500;
3924
+ function memoizeCapped(func) {
3925
+ var result = memoize_default(func, function(key) {
3926
+ if (cache.size === MAX_MEMOIZE_SIZE) {
3927
+ cache.clear();
3928
+ }
3929
+ return key;
3930
+ });
3931
+ var cache = result.cache;
3932
+ return result;
3933
+ }
3934
+ var memoizeCapped_default = memoizeCapped;
3935
+
3936
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js
3937
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
3938
+ var reEscapeChar = /\\(\\)?/g;
3939
+ var stringToPath = memoizeCapped_default(function(string) {
3940
+ var result = [];
3941
+ if (string.charCodeAt(0) === 46) {
3942
+ result.push("");
3943
+ }
3944
+ string.replace(rePropName, function(match, number, quote, subString) {
3945
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
3946
+ });
3947
+ return result;
3948
+ });
3949
+ var stringToPath_default = stringToPath;
3950
+
3951
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js
3952
+ function toString2(value) {
3953
+ return value == null ? "" : baseToString_default(value);
3954
+ }
3955
+ var toString_default = toString2;
3956
+
3957
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js
3958
+ function castPath(value, object) {
3959
+ if (isArray_default(value)) {
3960
+ return value;
3961
+ }
3962
+ return isKey_default(value, object) ? [value] : stringToPath_default(toString_default(value));
3963
+ }
3964
+ var castPath_default = castPath;
3965
+
3966
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js
3967
+ var INFINITY2 = 1 / 0;
3968
+ function toKey(value) {
3969
+ if (typeof value == "string" || isSymbol_default(value)) {
3970
+ return value;
3971
+ }
3972
+ var result = value + "";
3973
+ return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
3974
+ }
3975
+ var toKey_default = toKey;
3976
+
3977
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js
3978
+ function baseGet(object, path) {
3979
+ path = castPath_default(path, object);
3980
+ var index = 0, length = path.length;
3981
+ while (object != null && index < length) {
3982
+ object = object[toKey_default(path[index++])];
3983
+ }
3984
+ return index && index == length ? object : void 0;
3985
+ }
3986
+ var baseGet_default = baseGet;
3987
+
3988
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js
3989
+ function arrayPush(array, values) {
3990
+ var index = -1, length = values.length, offset = array.length;
3991
+ while (++index < length) {
3992
+ array[offset + index] = values[index];
3993
+ }
3994
+ return array;
3995
+ }
3996
+ var arrayPush_default = arrayPush;
3997
+
3998
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js
3999
+ var spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
4000
+ function isFlattenable(value) {
4001
+ return isArray_default(value) || isArguments_default(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
4002
+ }
4003
+ var isFlattenable_default = isFlattenable;
4004
+
4005
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js
4006
+ function baseFlatten(array, depth, predicate, isStrict, result) {
4007
+ var index = -1, length = array.length;
4008
+ predicate || (predicate = isFlattenable_default);
4009
+ result || (result = []);
4010
+ while (++index < length) {
4011
+ var value = array[index];
4012
+ if (depth > 0 && predicate(value)) {
4013
+ if (depth > 1) {
4014
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
4015
+ } else {
4016
+ arrayPush_default(result, value);
4017
+ }
4018
+ } else if (!isStrict) {
4019
+ result[result.length] = value;
4020
+ }
4021
+ }
4022
+ return result;
4023
+ }
4024
+ var baseFlatten_default = baseFlatten;
4025
+
4026
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js
4027
+ function flatten(array) {
4028
+ var length = array == null ? 0 : array.length;
4029
+ return length ? baseFlatten_default(array, 1) : [];
4030
+ }
4031
+ var flatten_default = flatten;
4032
+
4033
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js
4034
+ function flatRest(func) {
4035
+ return setToString_default(overRest_default(func, void 0, flatten_default), func + "");
4036
+ }
4037
+ var flatRest_default = flatRest;
4038
+
4039
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getPrototype.js
4040
+ var getPrototype = overArg_default(Object.getPrototypeOf, Object);
4041
+ var getPrototype_default = getPrototype;
4042
+
4043
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isPlainObject.js
4044
+ var objectTag2 = "[object Object]";
4045
+ var funcProto3 = Function.prototype;
4046
+ var objectProto12 = Object.prototype;
4047
+ var funcToString3 = funcProto3.toString;
4048
+ var hasOwnProperty10 = objectProto12.hasOwnProperty;
4049
+ var objectCtorString = funcToString3.call(Object);
4050
+ function isPlainObject(value) {
4051
+ if (!isObjectLike_default(value) || baseGetTag_default(value) != objectTag2) {
4052
+ return false;
4053
+ }
4054
+ var proto = getPrototype_default(value);
4055
+ if (proto === null) {
4056
+ return true;
4057
+ }
4058
+ var Ctor = hasOwnProperty10.call(proto, "constructor") && proto.constructor;
4059
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
4060
+ }
4061
+ var isPlainObject_default = isPlainObject;
4062
+
4063
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js
4064
+ function baseSlice(array, start, end) {
4065
+ var index = -1, length = array.length;
4066
+ if (start < 0) {
4067
+ start = -start > length ? 0 : length + start;
4068
+ }
4069
+ end = end > length ? length : end;
4070
+ if (end < 0) {
4071
+ end += length;
4072
+ }
4073
+ length = start > end ? 0 : end - start >>> 0;
4074
+ start >>>= 0;
4075
+ var result = Array(length);
4076
+ while (++index < length) {
4077
+ result[index] = array[index + start];
4078
+ }
4079
+ return result;
4080
+ }
4081
+ var baseSlice_default = baseSlice;
4082
+
4083
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js
4084
+ function stackClear() {
4085
+ this.__data__ = new ListCache_default();
4086
+ this.size = 0;
4087
+ }
4088
+ var stackClear_default = stackClear;
4089
+
4090
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js
4091
+ function stackDelete(key) {
4092
+ var data = this.__data__, result = data["delete"](key);
4093
+ this.size = data.size;
4094
+ return result;
4095
+ }
4096
+ var stackDelete_default = stackDelete;
4097
+
4098
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js
4099
+ function stackGet(key) {
4100
+ return this.__data__.get(key);
4101
+ }
4102
+ var stackGet_default = stackGet;
4103
+
4104
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js
4105
+ function stackHas(key) {
4106
+ return this.__data__.has(key);
4107
+ }
4108
+ var stackHas_default = stackHas;
4109
+
4110
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js
4111
+ var LARGE_ARRAY_SIZE = 200;
4112
+ function stackSet(key, value) {
4113
+ var data = this.__data__;
4114
+ if (data instanceof ListCache_default) {
4115
+ var pairs = data.__data__;
4116
+ if (!Map_default || pairs.length < LARGE_ARRAY_SIZE - 1) {
4117
+ pairs.push([key, value]);
4118
+ this.size = ++data.size;
4119
+ return this;
4120
+ }
4121
+ data = this.__data__ = new MapCache_default(pairs);
4122
+ }
4123
+ data.set(key, value);
4124
+ this.size = data.size;
4125
+ return this;
4126
+ }
4127
+ var stackSet_default = stackSet;
4128
+
4129
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js
4130
+ function Stack(entries) {
4131
+ var data = this.__data__ = new ListCache_default(entries);
4132
+ this.size = data.size;
4133
+ }
4134
+ Stack.prototype.clear = stackClear_default;
4135
+ Stack.prototype["delete"] = stackDelete_default;
4136
+ Stack.prototype.get = stackGet_default;
4137
+ Stack.prototype.has = stackHas_default;
4138
+ Stack.prototype.set = stackSet_default;
4139
+ var Stack_default = Stack;
4140
+
4141
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js
4142
+ function baseAssign(object, source) {
4143
+ return object && copyObject_default(source, keys_default(source), object);
4144
+ }
4145
+ var baseAssign_default = baseAssign;
4146
+
4147
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js
4148
+ function baseAssignIn(object, source) {
4149
+ return object && copyObject_default(source, keysIn_default(source), object);
4150
+ }
4151
+ var baseAssignIn_default = baseAssignIn;
4152
+
4153
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js
4154
+ var freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
4155
+ var freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
4156
+ var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
4157
+ var Buffer3 = moduleExports3 ? root_default.Buffer : void 0;
4158
+ var allocUnsafe = Buffer3 ? Buffer3.allocUnsafe : void 0;
4159
+ function cloneBuffer(buffer, isDeep) {
4160
+ if (isDeep) {
4161
+ return buffer.slice();
4162
+ }
4163
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
4164
+ buffer.copy(result);
4165
+ return result;
4166
+ }
4167
+ var cloneBuffer_default = cloneBuffer;
4168
+
4169
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js
4170
+ function arrayFilter(array, predicate) {
4171
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
4172
+ while (++index < length) {
4173
+ var value = array[index];
4174
+ if (predicate(value, index, array)) {
4175
+ result[resIndex++] = value;
4176
+ }
4177
+ }
4178
+ return result;
4179
+ }
4180
+ var arrayFilter_default = arrayFilter;
4181
+
4182
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js
4183
+ function stubArray() {
4184
+ return [];
4185
+ }
4186
+ var stubArray_default = stubArray;
4187
+
4188
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js
4189
+ var objectProto13 = Object.prototype;
4190
+ var propertyIsEnumerable2 = objectProto13.propertyIsEnumerable;
4191
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
4192
+ var getSymbols = !nativeGetSymbols ? stubArray_default : function(object) {
4193
+ if (object == null) {
4194
+ return [];
4195
+ }
4196
+ object = Object(object);
4197
+ return arrayFilter_default(nativeGetSymbols(object), function(symbol) {
4198
+ return propertyIsEnumerable2.call(object, symbol);
4199
+ });
4200
+ };
4201
+ var getSymbols_default = getSymbols;
4202
+
4203
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js
4204
+ function copySymbols(source, object) {
4205
+ return copyObject_default(source, getSymbols_default(source), object);
4206
+ }
4207
+ var copySymbols_default = copySymbols;
4208
+
4209
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js
4210
+ var nativeGetSymbols2 = Object.getOwnPropertySymbols;
4211
+ var getSymbolsIn = !nativeGetSymbols2 ? stubArray_default : function(object) {
4212
+ var result = [];
4213
+ while (object) {
4214
+ arrayPush_default(result, getSymbols_default(object));
4215
+ object = getPrototype_default(object);
4216
+ }
4217
+ return result;
4218
+ };
4219
+ var getSymbolsIn_default = getSymbolsIn;
4220
+
4221
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js
4222
+ function copySymbolsIn(source, object) {
4223
+ return copyObject_default(source, getSymbolsIn_default(source), object);
4224
+ }
4225
+ var copySymbolsIn_default = copySymbolsIn;
4226
+
4227
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js
4228
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
4229
+ var result = keysFunc(object);
4230
+ return isArray_default(object) ? result : arrayPush_default(result, symbolsFunc(object));
4231
+ }
4232
+ var baseGetAllKeys_default = baseGetAllKeys;
4233
+
4234
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js
4235
+ function getAllKeys(object) {
4236
+ return baseGetAllKeys_default(object, keys_default, getSymbols_default);
4237
+ }
4238
+ var getAllKeys_default = getAllKeys;
4239
+
4240
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js
4241
+ function getAllKeysIn(object) {
4242
+ return baseGetAllKeys_default(object, keysIn_default, getSymbolsIn_default);
4243
+ }
4244
+ var getAllKeysIn_default = getAllKeysIn;
4245
+
4246
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js
4247
+ var DataView2 = getNative_default(root_default, "DataView");
4248
+ var DataView_default = DataView2;
4249
+
4250
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Promise.js
4251
+ var Promise2 = getNative_default(root_default, "Promise");
4252
+ var Promise_default = Promise2;
4253
+
4254
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js
4255
+ var Set2 = getNative_default(root_default, "Set");
4256
+ var Set_default = Set2;
4257
+
4258
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getTag.js
4259
+ var mapTag2 = "[object Map]";
4260
+ var objectTag3 = "[object Object]";
4261
+ var promiseTag = "[object Promise]";
4262
+ var setTag2 = "[object Set]";
4263
+ var weakMapTag2 = "[object WeakMap]";
4264
+ var dataViewTag2 = "[object DataView]";
4265
+ var dataViewCtorString = toSource_default(DataView_default);
4266
+ var mapCtorString = toSource_default(Map_default);
4267
+ var promiseCtorString = toSource_default(Promise_default);
4268
+ var setCtorString = toSource_default(Set_default);
4269
+ var weakMapCtorString = toSource_default(WeakMap_default);
4270
+ var getTag = baseGetTag_default;
4271
+ if (DataView_default && getTag(new DataView_default(new ArrayBuffer(1))) != dataViewTag2 || Map_default && getTag(new Map_default()) != mapTag2 || Promise_default && getTag(Promise_default.resolve()) != promiseTag || Set_default && getTag(new Set_default()) != setTag2 || WeakMap_default && getTag(new WeakMap_default()) != weakMapTag2) {
4272
+ getTag = function(value) {
4273
+ var result = baseGetTag_default(value), Ctor = result == objectTag3 ? value.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : "";
4274
+ if (ctorString) {
4275
+ switch (ctorString) {
4276
+ case dataViewCtorString:
4277
+ return dataViewTag2;
4278
+ case mapCtorString:
4279
+ return mapTag2;
4280
+ case promiseCtorString:
4281
+ return promiseTag;
4282
+ case setCtorString:
4283
+ return setTag2;
4284
+ case weakMapCtorString:
4285
+ return weakMapTag2;
4286
+ }
4287
+ }
4288
+ return result;
4289
+ };
4290
+ }
4291
+ var getTag_default = getTag;
4292
+
4293
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js
4294
+ var objectProto14 = Object.prototype;
4295
+ var hasOwnProperty11 = objectProto14.hasOwnProperty;
4296
+ function initCloneArray(array) {
4297
+ var length = array.length, result = new array.constructor(length);
4298
+ if (length && typeof array[0] == "string" && hasOwnProperty11.call(array, "index")) {
4299
+ result.index = array.index;
4300
+ result.input = array.input;
4301
+ }
4302
+ return result;
4303
+ }
4304
+ var initCloneArray_default = initCloneArray;
4305
+
4306
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js
4307
+ var Uint8Array2 = root_default.Uint8Array;
4308
+ var Uint8Array_default = Uint8Array2;
4309
+
4310
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js
4311
+ function cloneArrayBuffer(arrayBuffer) {
4312
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
4313
+ new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
4314
+ return result;
4315
+ }
4316
+ var cloneArrayBuffer_default = cloneArrayBuffer;
4317
+
4318
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js
4319
+ function cloneDataView(dataView, isDeep) {
4320
+ var buffer = isDeep ? cloneArrayBuffer_default(dataView.buffer) : dataView.buffer;
4321
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
4322
+ }
4323
+ var cloneDataView_default = cloneDataView;
4324
+
4325
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js
4326
+ var reFlags = /\w*$/;
4327
+ function cloneRegExp(regexp) {
4328
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
4329
+ result.lastIndex = regexp.lastIndex;
4330
+ return result;
4331
+ }
4332
+ var cloneRegExp_default = cloneRegExp;
4333
+
4334
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js
4335
+ var symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0;
4336
+ var symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
4337
+ function cloneSymbol(symbol) {
4338
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
4339
+ }
4340
+ var cloneSymbol_default = cloneSymbol;
4341
+
4342
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js
4343
+ function cloneTypedArray(typedArray, isDeep) {
4344
+ var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
4345
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
4346
+ }
4347
+ var cloneTypedArray_default = cloneTypedArray;
4348
+
4349
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js
4350
+ var boolTag2 = "[object Boolean]";
4351
+ var dateTag2 = "[object Date]";
4352
+ var mapTag3 = "[object Map]";
4353
+ var numberTag2 = "[object Number]";
4354
+ var regexpTag2 = "[object RegExp]";
4355
+ var setTag3 = "[object Set]";
4356
+ var stringTag2 = "[object String]";
4357
+ var symbolTag2 = "[object Symbol]";
4358
+ var arrayBufferTag2 = "[object ArrayBuffer]";
4359
+ var dataViewTag3 = "[object DataView]";
4360
+ var float32Tag2 = "[object Float32Array]";
4361
+ var float64Tag2 = "[object Float64Array]";
4362
+ var int8Tag2 = "[object Int8Array]";
4363
+ var int16Tag2 = "[object Int16Array]";
4364
+ var int32Tag2 = "[object Int32Array]";
4365
+ var uint8Tag2 = "[object Uint8Array]";
4366
+ var uint8ClampedTag2 = "[object Uint8ClampedArray]";
4367
+ var uint16Tag2 = "[object Uint16Array]";
4368
+ var uint32Tag2 = "[object Uint32Array]";
4369
+ function initCloneByTag(object, tag, isDeep) {
4370
+ var Ctor = object.constructor;
4371
+ switch (tag) {
4372
+ case arrayBufferTag2:
4373
+ return cloneArrayBuffer_default(object);
4374
+ case boolTag2:
4375
+ case dateTag2:
4376
+ return new Ctor(+object);
4377
+ case dataViewTag3:
4378
+ return cloneDataView_default(object, isDeep);
4379
+ case float32Tag2:
4380
+ case float64Tag2:
4381
+ case int8Tag2:
4382
+ case int16Tag2:
4383
+ case int32Tag2:
4384
+ case uint8Tag2:
4385
+ case uint8ClampedTag2:
4386
+ case uint16Tag2:
4387
+ case uint32Tag2:
4388
+ return cloneTypedArray_default(object, isDeep);
4389
+ case mapTag3:
4390
+ return new Ctor();
4391
+ case numberTag2:
4392
+ case stringTag2:
4393
+ return new Ctor(object);
4394
+ case regexpTag2:
4395
+ return cloneRegExp_default(object);
4396
+ case setTag3:
4397
+ return new Ctor();
4398
+ case symbolTag2:
4399
+ return cloneSymbol_default(object);
4400
+ }
4401
+ }
4402
+ var initCloneByTag_default = initCloneByTag;
4403
+
4404
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js
4405
+ function initCloneObject(object) {
4406
+ return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {};
4407
+ }
4408
+ var initCloneObject_default = initCloneObject;
4409
+
4410
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js
4411
+ var mapTag4 = "[object Map]";
4412
+ function baseIsMap(value) {
4413
+ return isObjectLike_default(value) && getTag_default(value) == mapTag4;
4414
+ }
4415
+ var baseIsMap_default = baseIsMap;
4416
+
4417
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js
4418
+ var nodeIsMap = nodeUtil_default && nodeUtil_default.isMap;
4419
+ var isMap = nodeIsMap ? baseUnary_default(nodeIsMap) : baseIsMap_default;
4420
+ var isMap_default = isMap;
4421
+
4422
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js
4423
+ var setTag4 = "[object Set]";
4424
+ function baseIsSet(value) {
4425
+ return isObjectLike_default(value) && getTag_default(value) == setTag4;
4426
+ }
4427
+ var baseIsSet_default = baseIsSet;
4428
+
4429
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js
4430
+ var nodeIsSet = nodeUtil_default && nodeUtil_default.isSet;
4431
+ var isSet = nodeIsSet ? baseUnary_default(nodeIsSet) : baseIsSet_default;
4432
+ var isSet_default = isSet;
4433
+
4434
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js
4435
+ var CLONE_DEEP_FLAG = 1;
4436
+ var CLONE_FLAT_FLAG = 2;
4437
+ var CLONE_SYMBOLS_FLAG = 4;
4438
+ var argsTag3 = "[object Arguments]";
4439
+ var arrayTag2 = "[object Array]";
4440
+ var boolTag3 = "[object Boolean]";
4441
+ var dateTag3 = "[object Date]";
4442
+ var errorTag2 = "[object Error]";
4443
+ var funcTag3 = "[object Function]";
4444
+ var genTag2 = "[object GeneratorFunction]";
4445
+ var mapTag5 = "[object Map]";
4446
+ var numberTag3 = "[object Number]";
4447
+ var objectTag4 = "[object Object]";
4448
+ var regexpTag3 = "[object RegExp]";
4449
+ var setTag5 = "[object Set]";
4450
+ var stringTag3 = "[object String]";
4451
+ var symbolTag3 = "[object Symbol]";
4452
+ var weakMapTag3 = "[object WeakMap]";
4453
+ var arrayBufferTag3 = "[object ArrayBuffer]";
4454
+ var dataViewTag4 = "[object DataView]";
4455
+ var float32Tag3 = "[object Float32Array]";
4456
+ var float64Tag3 = "[object Float64Array]";
4457
+ var int8Tag3 = "[object Int8Array]";
4458
+ var int16Tag3 = "[object Int16Array]";
4459
+ var int32Tag3 = "[object Int32Array]";
4460
+ var uint8Tag3 = "[object Uint8Array]";
4461
+ var uint8ClampedTag3 = "[object Uint8ClampedArray]";
4462
+ var uint16Tag3 = "[object Uint16Array]";
4463
+ var uint32Tag3 = "[object Uint32Array]";
4464
+ var cloneableTags = {};
4465
+ cloneableTags[argsTag3] = cloneableTags[arrayTag2] = cloneableTags[arrayBufferTag3] = cloneableTags[dataViewTag4] = cloneableTags[boolTag3] = cloneableTags[dateTag3] = cloneableTags[float32Tag3] = cloneableTags[float64Tag3] = cloneableTags[int8Tag3] = cloneableTags[int16Tag3] = cloneableTags[int32Tag3] = cloneableTags[mapTag5] = cloneableTags[numberTag3] = cloneableTags[objectTag4] = cloneableTags[regexpTag3] = cloneableTags[setTag5] = cloneableTags[stringTag3] = cloneableTags[symbolTag3] = cloneableTags[uint8Tag3] = cloneableTags[uint8ClampedTag3] = cloneableTags[uint16Tag3] = cloneableTags[uint32Tag3] = true;
4466
+ cloneableTags[errorTag2] = cloneableTags[funcTag3] = cloneableTags[weakMapTag3] = false;
4467
+ function baseClone(value, bitmask, customizer, key, object, stack) {
4468
+ var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
4469
+ if (customizer) {
4470
+ result = object ? customizer(value, key, object, stack) : customizer(value);
4471
+ }
4472
+ if (result !== void 0) {
4473
+ return result;
4474
+ }
4475
+ if (!isObject_default(value)) {
4476
+ return value;
3016
4477
  }
3017
- /**
3018
- * Apply EIP-55 checksum to address
3019
- */
3020
- toChecksumAddress(address) {
3021
- const addr = address.toLowerCase().replace("0x", "");
3022
- const encoder3 = new TextEncoder();
3023
- const addrBytes = encoder3.encode(addr);
3024
- const hash = keccak256(addrBytes).replace("0x", "");
3025
- let checksumAddress = "0x";
3026
- for (let i = 0; i < addr.length; i++) {
3027
- checksumAddress += parseInt(hash[i], 16) >= 8 ? addr[i].toUpperCase() : addr[i];
4478
+ var isArr = isArray_default(value);
4479
+ if (isArr) {
4480
+ result = initCloneArray_default(value);
4481
+ if (!isDeep) {
4482
+ return copyArray_default(value, result);
4483
+ }
4484
+ } else {
4485
+ var tag = getTag_default(value), isFunc = tag == funcTag3 || tag == genTag2;
4486
+ if (isBuffer_default(value)) {
4487
+ return cloneBuffer_default(value, isDeep);
4488
+ }
4489
+ if (tag == objectTag4 || tag == argsTag3 || isFunc && !object) {
4490
+ result = isFlat || isFunc ? {} : initCloneObject_default(value);
4491
+ if (!isDeep) {
4492
+ return isFlat ? copySymbolsIn_default(value, baseAssignIn_default(result, value)) : copySymbols_default(value, baseAssign_default(result, value));
4493
+ }
4494
+ } else {
4495
+ if (!cloneableTags[tag]) {
4496
+ return object ? value : {};
4497
+ }
4498
+ result = initCloneByTag_default(value, tag, isDeep);
3028
4499
  }
3029
- return checksumAddress;
3030
4500
  }
3031
- /**
3032
- * Generate secure domain label for DKG
3033
- */
3034
- generateDomainLabel(userId) {
3035
- const timestamp = Date.now();
3036
- const randomBytes = new Uint8Array(16);
3037
- crypto.getRandomValues(randomBytes);
3038
- const randomHex = Array.from(randomBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
3039
- return `dkls23:2of2:aa:${userId}:${timestamp}:${randomHex}`;
4501
+ stack || (stack = new Stack_default());
4502
+ var stacked = stack.get(value);
4503
+ if (stacked) {
4504
+ return stacked;
3040
4505
  }
3041
- /**
3042
- * Extract server message from response
3043
- */
3044
- extractServerMessage(response) {
3045
- return response?.msgNext || response?.msg_next || response?.msg || null;
4506
+ stack.set(value, result);
4507
+ if (isSet_default(value)) {
4508
+ value.forEach(function(subValue) {
4509
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
4510
+ });
4511
+ } else if (isMap_default(value)) {
4512
+ value.forEach(function(subValue, key2) {
4513
+ result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
4514
+ });
3046
4515
  }
3047
- };
4516
+ var keysFunc = isFull ? isFlat ? getAllKeysIn_default : getAllKeys_default : isFlat ? keysIn_default : keys_default;
4517
+ var props = isArr ? void 0 : keysFunc(value);
4518
+ arrayEach_default(props || value, function(subValue, key2) {
4519
+ if (props) {
4520
+ key2 = subValue;
4521
+ subValue = value[key2];
4522
+ }
4523
+ assignValue_default(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
4524
+ });
4525
+ return result;
4526
+ }
4527
+ var baseClone_default = baseClone;
3048
4528
 
3049
- // src/iframe/lib/onramp/utils.ts
3050
- function omit(object, ...keys) {
3051
- const result = { ...object };
3052
- for (const key of keys) {
3053
- delete result[key];
4529
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js
4530
+ function last(array) {
4531
+ var length = array == null ? 0 : array.length;
4532
+ return length ? array[length - 1] : void 0;
4533
+ }
4534
+ var last_default = last;
4535
+
4536
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_parent.js
4537
+ function parent(object, path) {
4538
+ return path.length < 2 ? object : baseGet_default(object, baseSlice_default(path, 0, -1));
4539
+ }
4540
+ var parent_default = parent;
4541
+
4542
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnset.js
4543
+ function baseUnset(object, path) {
4544
+ path = castPath_default(path, object);
4545
+ object = parent_default(object, path);
4546
+ return object == null || delete object[toKey_default(last_default(path))];
4547
+ }
4548
+ var baseUnset_default = baseUnset;
4549
+
4550
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_customOmitClone.js
4551
+ function customOmitClone(value) {
4552
+ return isPlainObject_default(value) ? void 0 : value;
4553
+ }
4554
+ var customOmitClone_default = customOmitClone;
4555
+
4556
+ // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/omit.js
4557
+ var CLONE_DEEP_FLAG2 = 1;
4558
+ var CLONE_FLAT_FLAG2 = 2;
4559
+ var CLONE_SYMBOLS_FLAG2 = 4;
4560
+ var omit = flatRest_default(function(object, paths) {
4561
+ var result = {};
4562
+ if (object == null) {
4563
+ return result;
4564
+ }
4565
+ var isDeep = false;
4566
+ paths = arrayMap_default(paths, function(path) {
4567
+ path = castPath_default(path, object);
4568
+ isDeep || (isDeep = path.length > 1);
4569
+ return path;
4570
+ });
4571
+ copyObject_default(object, getAllKeysIn_default(object), result);
4572
+ if (isDeep) {
4573
+ result = baseClone_default(result, CLONE_DEEP_FLAG2 | CLONE_FLAT_FLAG2 | CLONE_SYMBOLS_FLAG2, customOmitClone_default);
4574
+ }
4575
+ var length = paths.length;
4576
+ while (length--) {
4577
+ baseUnset_default(result, paths[length]);
3054
4578
  }
3055
4579
  return result;
3056
- }
4580
+ });
4581
+ var omit_default = omit;
3057
4582
 
3058
4583
  // src/iframe/lib/onramp/binance.ts
3059
4584
  var API_DOMAIN = "https://api.lumiapassport.com/on-ramp";
3060
4585
  var BinanceOnrampAPI = class {
3061
- constructor(sendResponseFn) {
4586
+ constructor(sendResponseFn, broadcastFn) {
4587
+ this.sseAbortController = null;
3062
4588
  this.sendResponseFn = sendResponseFn;
4589
+ this.broadcastFn = broadcastFn;
4590
+ }
4591
+ connectSseTxTracing(walletAddress, accessToken, origin) {
4592
+ this.disconnectSse();
4593
+ const controller = new AbortController();
4594
+ this.sseAbortController = controller;
4595
+ const url = `${API_DOMAIN}/sse/onramp/events?walletAddress=${encodeURIComponent(walletAddress)}`;
4596
+ const start = async () => {
4597
+ try {
4598
+ const response = await fetch(url, {
4599
+ headers: { Authorization: `Bearer ${accessToken}` },
4600
+ signal: controller.signal
4601
+ });
4602
+ if (!response.ok || !response.body) {
4603
+ throw new Error(`SSE connection failed: ${response.status}`);
4604
+ }
4605
+ const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
4606
+ let buffer = "";
4607
+ while (true) {
4608
+ const { done, value } = await reader.read();
4609
+ if (done) break;
4610
+ buffer += value;
4611
+ const parts = buffer.split("\n\n");
4612
+ buffer = parts.pop() || "";
4613
+ for (const part of parts) {
4614
+ if (part.startsWith("event: ping")) continue;
4615
+ const match = part.match(/^data: (.+)$/m);
4616
+ if (match) {
4617
+ try {
4618
+ const data = JSON.parse(match[1]);
4619
+ this.broadcastFn("IFRAME_SSE_EVENT", data, origin);
4620
+ } catch {
4621
+ console.warn("[BINANCE SSE] Failed to parse event data");
4622
+ }
4623
+ }
4624
+ }
4625
+ }
4626
+ } catch (error) {
4627
+ if (error?.name === "AbortError") return;
4628
+ console.error("[BINANCE SSE] Connection error, reconnecting in 2s...", error);
4629
+ setTimeout(() => {
4630
+ if (!controller.signal.aborted) {
4631
+ start();
4632
+ }
4633
+ }, 2e3);
4634
+ }
4635
+ };
4636
+ start();
3063
4637
  }
3064
- async checkIsLumaiAvailableQuery(accessToken) {
3065
- const response = await fetch(`${API_DOMAIN}/api/binance/pairs`, {
3066
- method: "POST",
3067
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
3068
- });
3069
- const data = await response.json();
3070
- if (!data.success) {
3071
- throw new Error(`${data.code}: ${data.message}`);
4638
+ disconnectSse() {
4639
+ if (this.sseAbortController) {
4640
+ this.sseAbortController.abort();
4641
+ this.sseAbortController = null;
3072
4642
  }
3073
- if (!data.data?.cryptoCurrencies?.includes("LUMIA")) {
3074
- console.error("Lumia is not available in Binance pairs API");
3075
- throw new Error("Lumia is not available in API");
4643
+ }
4644
+ // QUERIES & MUTATIONS
4645
+ async getTradingPairsQuery(accessToken) {
4646
+ try {
4647
+ const response = await fetch(`${API_DOMAIN}/api/binance/pairs`, {
4648
+ method: "POST",
4649
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
4650
+ });
4651
+ const tradingPairs = await response.json();
4652
+ return tradingPairs;
4653
+ } catch (error) {
4654
+ throw error;
3076
4655
  }
3077
- return !!data.data.cryptoCurrencies.includes("LUMIA");
3078
4656
  }
3079
- async getLumiaNetworkQuery(accessToken) {
3080
- const response = await fetch(`${API_DOMAIN}/api/binance/networks`, {
3081
- method: "POST",
3082
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
3083
- });
3084
- const data = await response.json();
3085
- if (!data?.success) {
3086
- throw new Error(`${data.code}: ${data.message}`);
4657
+ async getSupportedNetworksQuery(accessToken) {
4658
+ try {
4659
+ const response = await fetch(`${API_DOMAIN}/api/binance/networks`, {
4660
+ method: "POST",
4661
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
4662
+ });
4663
+ const networksData = await response.json();
4664
+ return networksData;
4665
+ } catch (error) {
4666
+ throw error;
3087
4667
  }
3088
- return data.data;
3089
4668
  }
3090
4669
  async getPaymentMethodsQuery(payload, accessToken) {
3091
- const response = await fetch(`${API_DOMAIN}/api/binance/modes`, {
3092
- method: "POST",
3093
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
3094
- body: JSON.stringify(payload)
3095
- });
3096
- const data = await response.json();
3097
- if (!data.success) {
3098
- throw new Error(`${data.code}: ${data.message}`);
3099
- }
3100
- if (!data.data.paymentMethods.length) {
3101
- throw new Error("No payment methods available yet");
4670
+ try {
4671
+ const response = await fetch(`${API_DOMAIN}/api/binance/modes`, {
4672
+ method: "POST",
4673
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
4674
+ body: JSON.stringify(payload)
4675
+ });
4676
+ const paymentMethods = await response.json();
4677
+ return paymentMethods;
4678
+ } catch (error) {
4679
+ throw error;
3102
4680
  }
3103
- return data.data.paymentMethods;
3104
4681
  }
3105
4682
  async getQuoteQuery(payload, accessToken) {
3106
- const response = await fetch(`${API_DOMAIN}/api/binance/quote`, {
3107
- method: "POST",
3108
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
3109
- body: JSON.stringify(payload)
3110
- });
3111
- const data = await response.json();
3112
- if (!data.success) {
3113
- throw new Error(`${data.code}: ${data.message}`);
4683
+ try {
4684
+ const response = await fetch(`${API_DOMAIN}/api/binance/quote`, {
4685
+ method: "POST",
4686
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
4687
+ body: JSON.stringify(payload)
4688
+ });
4689
+ const quote = await response.json();
4690
+ return quote;
4691
+ } catch (error) {
4692
+ throw error;
3114
4693
  }
3115
- return data.data;
3116
4694
  }
3117
4695
  async createPreorderMutation(payload, accessToken) {
3118
- const response = await fetch(`${API_DOMAIN}/api/binance/pre-order`, {
3119
- method: "POST",
3120
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
3121
- body: JSON.stringify(payload)
3122
- });
3123
- const data = await response.json();
3124
- if (!data.success) {
3125
- throw new Error(`${data.code}: ${data.message}`);
4696
+ try {
4697
+ const response = await fetch(`${API_DOMAIN}/api/binance/pre-order`, {
4698
+ method: "POST",
4699
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
4700
+ body: JSON.stringify(payload)
4701
+ });
4702
+ const preorder = await response.json();
4703
+ return preorder;
4704
+ } catch (error) {
4705
+ throw error;
3126
4706
  }
3127
- return data.data;
3128
4707
  }
4708
+ async getTransactionList(params, accessToken) {
4709
+ try {
4710
+ const txStatus = Array.isArray(params.txStatuses) ? (params.txStatuses || []).join(",") : null;
4711
+ const apiUrl = new URL(`${API_DOMAIN}/api/binance/transactions`);
4712
+ apiUrl.searchParams.append("walletAddress", params.walletAddress);
4713
+ if (!!txStatus?.length) apiUrl.searchParams.append("txStatus", txStatus);
4714
+ if (!!params.page) apiUrl.searchParams.append("page", params.page.toString());
4715
+ if (!!params.pageSize) apiUrl.searchParams.append("pageSize", params.pageSize.toString());
4716
+ const response = await fetch(apiUrl.toString(), {
4717
+ method: "GET",
4718
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
4719
+ });
4720
+ const transactions = await response.json();
4721
+ return transactions;
4722
+ } catch (error) {
4723
+ throw error;
4724
+ }
4725
+ }
4726
+ // IFRAME MESSAGING
3129
4727
  async handleMessage(message, origin) {
3130
4728
  const { type, messageId, data } = message;
3131
- const { accessToken } = message.data;
3132
- console.log("[ BINANCE Received message ]", type, message);
4729
+ const accessToken = data.accessToken || "";
4730
+ const payload = omit_default(data, ["accessToken"]);
4731
+ console.info("[ BINANCE Received message ]", type, payload);
3133
4732
  switch (type) {
3134
- case "BINANCE_CHECK_IS_LUMIA_AVAILABLE_QUERY":
3135
- const isLumiaAvalableRes = await this.checkIsLumaiAvailableQuery(accessToken);
3136
- this.sendResponseFn(messageId, isLumiaAvalableRes, origin);
4733
+ case "BINANCE_GET_TRADING_PAIRS_NETWORK_QUERY":
4734
+ const tradingPairsResponse = await this.getTradingPairsQuery(accessToken);
4735
+ this.sendResponseFn(messageId, tradingPairsResponse, origin);
3137
4736
  break;
3138
- case "BINANCE_GET_LUMIA_NETWORK_QUERY":
3139
- const lumiaNetworkResponse = await this.getLumiaNetworkQuery(accessToken);
3140
- this.sendResponseFn(messageId, lumiaNetworkResponse, origin);
4737
+ case "BINANCE_GET_SUPPORTED_NETWORKS_QUERY":
4738
+ const supportedNetworksResponse = await this.getSupportedNetworksQuery(accessToken);
4739
+ this.sendResponseFn(messageId, supportedNetworksResponse, origin);
3141
4740
  break;
3142
4741
  case "BINANCE_GET_PAYMENT_METHODS_QUERY":
3143
- const paymentMethodsResponse = await this.getPaymentMethodsQuery(
3144
- this.ensurePayload(data, "methods"),
3145
- accessToken
3146
- );
4742
+ const paymentMethodsResponse = await this.getPaymentMethodsQuery(payload, accessToken);
3147
4743
  this.sendResponseFn(messageId, paymentMethodsResponse, origin);
3148
4744
  break;
3149
4745
  case "BINANCE_GET_QUOTE_QUERY":
3150
- const quoteResponse = await this.getQuoteQuery(this.ensurePayload(data, "quote"), accessToken);
4746
+ const quoteResponse = await this.getQuoteQuery(payload, accessToken);
3151
4747
  this.sendResponseFn(messageId, quoteResponse, origin);
3152
4748
  break;
3153
4749
  case "BINANCE_CREATE_PREORDER_MUTATION":
3154
- const preorderResponse = await this.createPreorderMutation(this.ensurePayload(data, "preorder"), accessToken);
4750
+ const preorderResponse = await this.createPreorderMutation(payload, accessToken);
3155
4751
  this.sendResponseFn(messageId, preorderResponse, origin);
3156
4752
  break;
4753
+ case "BINANCE_GET_TRANSACTION_LIST_QUERY":
4754
+ const txListResponse = await this.getTransactionList(payload, accessToken);
4755
+ this.sendResponseFn(messageId, txListResponse, origin);
4756
+ break;
4757
+ case "BINANCE_CONNECT_TX_TRACING":
4758
+ this.connectSseTxTracing(payload.walletAddress, accessToken, origin);
4759
+ this.sendResponseFn(messageId, { connected: true }, origin);
4760
+ break;
4761
+ case "BINANCE_DISCONNECT_TX_TRACING":
4762
+ this.disconnectSse();
4763
+ this.sendResponseFn(messageId, { disconnected: true }, origin);
4764
+ break;
3157
4765
  default:
3158
4766
  throw new Error(`[ BINANCE ]: Unknown message type: ${type}`);
3159
4767
  }
3160
4768
  }
3161
- ensurePayload(data, type) {
3162
- if (!data || typeof data !== "object") {
3163
- throw new Error(`Invalid payload: expected object, got ${typeof data}`);
3164
- }
3165
- const payload = omit(data, "accessToken");
3166
- switch (type) {
3167
- case "methods":
3168
- if (typeof payload.totalAmount !== "string") {
3169
- throw new Error("Invalid payload: totalAmount must be a string");
3170
- }
3171
- return { totalAmount: payload.totalAmount };
3172
- case "quote":
3173
- if (typeof payload.network !== "string") {
3174
- throw new Error("Invalid payload: network must be a string");
3175
- }
3176
- if (typeof payload.walletAddress !== "string") {
3177
- throw new Error("Invalid payload: walletAddress must be a string");
3178
- }
3179
- if (typeof payload.requestedAmount !== "string") {
3180
- throw new Error("Invalid payload: requestedAmount must be a string");
3181
- }
3182
- return {
3183
- network: payload.network,
3184
- walletAddress: payload.walletAddress,
3185
- requestedAmount: payload.requestedAmount,
3186
- ...payload.payMethodCode && typeof payload.payMethodCode === "string" ? { payMethodCode: payload.payMethodCode } : {},
3187
- ...payload.payMethodSubCode && typeof payload.payMethodSubCode === "string" ? { payMethodSubCode: payload.payMethodSubCode } : {}
3188
- };
3189
- case "preorder":
3190
- if (typeof payload.requestedAmount !== "string") {
3191
- throw new Error("Invalid payload: requestedAmount must be a string");
3192
- }
3193
- if (typeof payload.address !== "string") {
3194
- throw new Error("Invalid payload: address must be a string");
3195
- }
3196
- if (typeof payload.network !== "string") {
3197
- throw new Error("Invalid payload: network must be a string");
3198
- }
3199
- return {
3200
- requestedAmount: payload.requestedAmount,
3201
- address: payload.address,
3202
- network: payload.network,
3203
- ...payload.payMethodCode && typeof payload.payMethodCode === "string" ? { payMethodCode: payload.payMethodCode } : {},
3204
- ...payload.payMethodSubCode && typeof payload.payMethodSubCode === "string" ? { payMethodSubCode: payload.payMethodSubCode } : {},
3205
- ...payload.redirectUrl && typeof payload.redirectUrl === "string" ? { redirectUrl: payload.redirectUrl } : {},
3206
- ...payload.failRedirectUrl && typeof payload.failRedirectUrl === "string" ? { failRedirectUrl: payload.failRedirectUrl } : {}
3207
- };
3208
- default:
3209
- throw new Error(`Unknown payload type: ${type}`);
3210
- }
3211
- }
3212
4769
  };
3213
4770
 
3214
4771
  // src/iframe/lib/onramp/finchpay.ts
3215
- var API_DOMAIN2 = "http://localhost:8000/api";
4772
+ var API_DOMAIN2 = "https://api.lumiapassport.com/on-ramp";
3216
4773
  var FinchPayRampAPI = class {
3217
- constructor(sendResponseFn) {
4774
+ constructor(sendResponseFn, broadcastFn) {
4775
+ this.sseAbortController = null;
3218
4776
  this.sendResponseFn = sendResponseFn;
4777
+ this.broadcastFn = broadcastFn;
4778
+ }
4779
+ connectSseTxTracing(walletAddress, accessToken, origin) {
4780
+ this.disconnectSse();
4781
+ const controller = new AbortController();
4782
+ this.sseAbortController = controller;
4783
+ const url = `${API_DOMAIN2}/sse/onramp/events?walletAddress=${encodeURIComponent(walletAddress)}`;
4784
+ const start = async () => {
4785
+ try {
4786
+ const response = await fetch(url, {
4787
+ headers: { Authorization: `Bearer ${accessToken}` },
4788
+ signal: controller.signal
4789
+ });
4790
+ if (!response.ok || !response.body) {
4791
+ throw new Error(`FINCHPAY SSE connection failed: ${response.status}`);
4792
+ }
4793
+ const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
4794
+ let buffer = "";
4795
+ while (true) {
4796
+ const { done, value } = await reader.read();
4797
+ if (done) break;
4798
+ buffer += value;
4799
+ const parts = buffer.split("\n\n");
4800
+ buffer = parts.pop() || "";
4801
+ for (const part of parts) {
4802
+ if (part.startsWith("event: ping")) continue;
4803
+ const match = part.match(/^data: (.+)$/m);
4804
+ if (match) {
4805
+ try {
4806
+ const data = JSON.parse(match[1]);
4807
+ this.broadcastFn("IFRAME_SSE_EVENT", data, origin);
4808
+ } catch {
4809
+ console.warn("[FINCHPAY SSE] Failed to parse event data");
4810
+ }
4811
+ }
4812
+ }
4813
+ }
4814
+ } catch (error) {
4815
+ if (error?.name === "AbortError") return;
4816
+ console.error("[FINCHPAY SSE] Connection error, reconnecting in 2s...", error);
4817
+ setTimeout(() => {
4818
+ if (!controller.signal.aborted) {
4819
+ start();
4820
+ }
4821
+ }, 2e3);
4822
+ }
4823
+ };
4824
+ start();
4825
+ }
4826
+ disconnectSse() {
4827
+ if (this.sseAbortController) {
4828
+ this.sseAbortController.abort();
4829
+ this.sseAbortController = null;
4830
+ }
3219
4831
  }
4832
+ // QUERIES & MUTATIONS
3220
4833
  async getCurrencies(accessToken) {
3221
4834
  try {
3222
4835
  const response = await fetch(`${API_DOMAIN2}/finchpay/currencies`, {
3223
4836
  method: "GET",
3224
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
4837
+ headers: { ...accessToken && { Authorization: `Bearer ${accessToken}` } }
3225
4838
  });
3226
4839
  const data = await response.json();
3227
4840
  if (!data.success) {
@@ -3236,8 +4849,11 @@ var FinchPayRampAPI = class {
3236
4849
  async getLimits(payload, accessToken) {
3237
4850
  const response = await fetch(`${API_DOMAIN2}/finchpay/limits`, {
3238
4851
  method: "POST",
3239
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
3240
- body: JSON.stringify(payload)
4852
+ body: JSON.stringify(payload),
4853
+ headers: {
4854
+ "Content-Type": "application/json",
4855
+ ...accessToken && { Authorization: `Bearer ${accessToken}` }
4856
+ }
3241
4857
  });
3242
4858
  const data = await response.json();
3243
4859
  if (!data.success) {
@@ -3249,8 +4865,11 @@ var FinchPayRampAPI = class {
3249
4865
  async getLimitsSummary(payload, accessToken) {
3250
4866
  const response = await fetch(`${API_DOMAIN2}/finchpay/limits/summary`, {
3251
4867
  method: "POST",
3252
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
3253
- body: JSON.stringify(payload)
4868
+ body: JSON.stringify(payload),
4869
+ headers: {
4870
+ "Content-Type": "application/json",
4871
+ ...accessToken && { Authorization: `Bearer ${accessToken}` }
4872
+ }
3254
4873
  });
3255
4874
  const data = await response.json();
3256
4875
  if (!data.success) {
@@ -3262,8 +4881,11 @@ var FinchPayRampAPI = class {
3262
4881
  async getEstimates(payload, accessToken) {
3263
4882
  const response = await fetch(`${API_DOMAIN2}/finchpay/estimates`, {
3264
4883
  method: "POST",
3265
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
3266
- body: JSON.stringify(payload)
4884
+ body: JSON.stringify(payload),
4885
+ headers: {
4886
+ "Content-Type": "application/json",
4887
+ ...accessToken && { Authorization: `Bearer ${accessToken}` }
4888
+ }
3267
4889
  });
3268
4890
  const data = await response.json();
3269
4891
  if (!data.success) {
@@ -3276,7 +4898,10 @@ var FinchPayRampAPI = class {
3276
4898
  try {
3277
4899
  const response = await fetch(`${API_DOMAIN2}/finchpay/transaction/${transactionId}`, {
3278
4900
  method: "GET",
3279
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
4901
+ headers: {
4902
+ "Content-Type": "application/json",
4903
+ ...accessToken && { Authorization: `Bearer ${accessToken}` }
4904
+ }
3280
4905
  });
3281
4906
  const data = await response.json();
3282
4907
  if (!data.success) {
@@ -3288,11 +4913,15 @@ var FinchPayRampAPI = class {
3288
4913
  throw error;
3289
4914
  }
3290
4915
  }
3291
- async getWidgetUrl(accessToken) {
4916
+ async getWidgetUrl(payload, accessToken) {
3292
4917
  try {
3293
4918
  const response = await fetch(`${API_DOMAIN2}/finchpay/widget-url`, {
3294
- method: "GET",
3295
- headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
4919
+ method: "POST",
4920
+ body: JSON.stringify(payload),
4921
+ headers: {
4922
+ "Content-Type": "application/json",
4923
+ ...accessToken && { Authorization: `Bearer ${accessToken}` }
4924
+ }
3296
4925
  });
3297
4926
  const data = await response.json();
3298
4927
  if (!data.success) {
@@ -3304,26 +4933,44 @@ var FinchPayRampAPI = class {
3304
4933
  throw error;
3305
4934
  }
3306
4935
  }
4936
+ async getTransactionList(params, accessToken) {
4937
+ try {
4938
+ const txStatus = Array.isArray(params.txStatuses) ? (params.txStatuses || []).join(",") : null;
4939
+ const apiUrl = new URL(`${API_DOMAIN2}/finchpay/tx-trace`);
4940
+ apiUrl.searchParams.append("walletAddress", params.walletAddress);
4941
+ if (!!txStatus?.length) apiUrl.searchParams.append("txStatus", txStatus);
4942
+ if (!!params.page) apiUrl.searchParams.append("page", params.page.toString());
4943
+ if (!!params.pageSize) apiUrl.searchParams.append("pageSize", params.pageSize.toString());
4944
+ const response = await fetch(apiUrl.toString(), {
4945
+ method: "GET",
4946
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } }
4947
+ });
4948
+ const transactions = await response.json();
4949
+ return transactions;
4950
+ } catch (error) {
4951
+ throw error;
4952
+ }
4953
+ }
3307
4954
  // IFRAME MESSAGING
3308
4955
  async handleMessage(message, origin) {
3309
4956
  const { type, messageId, data } = message;
3310
- const { accessToken } = message.data;
3311
- console.log("[FINCHPAY iframe]: Received message", type, message);
4957
+ const accessToken = data.accessToken || "";
4958
+ console.info("[ FINCHPAY Received message ]", type, data);
3312
4959
  switch (type) {
3313
4960
  case "FINCHPAY_GET_CURRENCIES_QUERY":
3314
4961
  const isLumiaAvalableRes = await this.getCurrencies(accessToken);
3315
4962
  this.sendResponseFn(messageId, isLumiaAvalableRes, origin);
3316
4963
  break;
3317
4964
  case "FINCHPAY_GET_LIMITS_QUERY":
3318
- const limitsResponse = await this.getLimits(data, accessToken);
4965
+ const limitsResponse = await this.getLimits(data.payload, accessToken);
3319
4966
  this.sendResponseFn(messageId, limitsResponse, origin);
3320
4967
  break;
3321
4968
  case "FINCHPAY_GET_LIMITS_SUMMARY_QUERY":
3322
- const limitsSummaryResponse = await this.getLimitsSummary(data, accessToken);
4969
+ const limitsSummaryResponse = await this.getLimitsSummary(data.payload, accessToken);
3323
4970
  this.sendResponseFn(messageId, limitsSummaryResponse, origin);
3324
4971
  break;
3325
4972
  case "FINCHPAY_GET_ESTIMATES_QUERY":
3326
- const paymentMethodsResponse = await this.getEstimates(data, accessToken);
4973
+ const paymentMethodsResponse = await this.getEstimates(data.payload, accessToken);
3327
4974
  this.sendResponseFn(messageId, paymentMethodsResponse, origin);
3328
4975
  break;
3329
4976
  case "FINCHPAY_GET_TRANSACTION_STATUS_QUERY":
@@ -3331,15 +4978,36 @@ var FinchPayRampAPI = class {
3331
4978
  this.sendResponseFn(messageId, transactionStatusResponse, origin);
3332
4979
  break;
3333
4980
  case "FINCHPAY_GET_WIDGET_URL_QUERY":
3334
- const widgetUrlResponse = await this.getWidgetUrl(accessToken);
4981
+ const widgetUrlResponse = await this.getWidgetUrl(data.payload, accessToken);
3335
4982
  this.sendResponseFn(messageId, widgetUrlResponse, origin);
3336
4983
  break;
4984
+ case "FINCHPAY_GET_TRANSACTION_LIST_QUERY":
4985
+ const txListResponse = await this.getTransactionList(data.payload, accessToken);
4986
+ this.sendResponseFn(messageId, txListResponse, origin);
4987
+ break;
4988
+ case "FINCHPAY_CONNECT_TX_TRACING":
4989
+ this.connectSseTxTracing(data.payload.walletAddress, accessToken, origin);
4990
+ this.sendResponseFn(messageId, { connected: true }, origin);
4991
+ break;
4992
+ case "FINCHPAY_DISCONNECT_TX_TRACING":
4993
+ this.disconnectSse();
4994
+ this.sendResponseFn(messageId, { disconnected: true }, origin);
4995
+ break;
3337
4996
  default:
3338
4997
  throw new Error(`[FINCHPAY]: Unknown message type: ${type}`);
3339
4998
  }
3340
4999
  }
3341
5000
  };
3342
5001
 
5002
+ // src/iframe/lib/onramp/utils.ts
5003
+ function omit2(object, ...keys2) {
5004
+ const result = { ...object };
5005
+ for (const key of keys2) {
5006
+ delete result[key];
5007
+ }
5008
+ return result;
5009
+ }
5010
+
3343
5011
  // src/iframe/lib/onramp/rampnow.ts
3344
5012
  var API_DOMAIN3 = "https://api.lumiapassport.com/on-ramp";
3345
5013
  var RampnowOnrampAPI = class {
@@ -3370,7 +5038,7 @@ var RampnowOnrampAPI = class {
3370
5038
  if (typeof payload !== "object" || payload === null || typeof payload?.paymentMode !== "string" || typeof payload?.srcAmount !== "number" || typeof payload?.walletAddress !== "string") {
3371
5039
  throw new Error("Invalid Ramp order quote payload");
3372
5040
  }
3373
- return omit(payload, "accessToken");
5041
+ return omit2(payload, "accessToken");
3374
5042
  }
3375
5043
  // UNUSED due to Rampnow APP redirect order flow
3376
5044
  // async ctreateChekoutOrderMutation(payload: CreateCheckoutOrderMutationPayload) {
@@ -4594,7 +6262,7 @@ var SigningManager = class extends TokenRefreshApiClient {
4594
6262
  };
4595
6263
 
4596
6264
  // src/iframe/main.ts
4597
- var IFRAME_VERSION = "0.4.1";
6265
+ var IFRAME_VERSION = "0.4.2";
4598
6266
  var IframeWallet = class {
4599
6267
  constructor() {
4600
6268
  console.log("=".repeat(60));
@@ -4610,7 +6278,19 @@ var IframeWallet = class {
4610
6278
  this.optedOutApps = new OptedOutAppsManager();
4611
6279
  this.backupManager = new BackupManager();
4612
6280
  this.finchpay = new FinchPayRampAPI(this.messenger.sendResponse.bind(this.messenger));
4613
- this.binance = new BinanceOnrampAPI(this.messenger.sendResponse.bind(this.messenger));
6281
+ this.binance = new BinanceOnrampAPI(
6282
+ this.messenger.sendResponse.bind(this.messenger),
6283
+ (type, data, targetOrigin) => {
6284
+ window.parent.postMessage(
6285
+ {
6286
+ type,
6287
+ data,
6288
+ timestamp: Date.now()
6289
+ },
6290
+ targetOrigin
6291
+ );
6292
+ }
6293
+ );
4614
6294
  this.rampnow = new RampnowOnrampAPI(this.messenger.sendResponse.bind(this.messenger));
4615
6295
  }
4616
6296
  async initialize() {
@@ -5054,7 +6734,8 @@ var IframeWallet = class {
5054
6734
  return;
5055
6735
  }
5056
6736
  try {
5057
- const result = await this.backupManager.createBackup(userId, backupRequest, accessToken);
6737
+ const backupOp = () => this.backupManager.createBackup(userId, backupRequest, accessToken);
6738
+ const result = !backupRequest.password && this.isSafari() ? await this.withPasskeyConfirmation("backup", backupOp) : await backupOp();
5058
6739
  this.messenger.sendResponse(
5059
6740
  messageId,
5060
6741
  {
@@ -5111,6 +6792,59 @@ var IframeWallet = class {
5111
6792
  );
5112
6793
  console.log(`[iframe] \u2705 GET_CLOUD_PROVIDERS: Providers retrieved`);
5113
6794
  }
6795
+ /**
6796
+ * Safari/WebKit requires focused document + user gesture for WebAuthn in cross-origin iframe.
6797
+ * Shows a modal with a button so the user click provides both.
6798
+ */
6799
+ /**
6800
+ * Safari/WebKit requires focused document + user gesture for WebAuthn in cross-origin iframe.
6801
+ * Shows a confirmation modal, waits for click, then runs the passkey operation.
6802
+ * Hides iframe after operation completes (success or failure).
6803
+ */
6804
+ async withPasskeyConfirmation(action, operation) {
6805
+ this.showIframe();
6806
+ const title = action === "restore" ? "Restore Backup" : "Create Backup";
6807
+ const description = action === "restore" ? "Authenticate with your passkey to restore your wallet backup." : "Authenticate with your passkey to encrypt your wallet backup.";
6808
+ const template = TemplateLoader.getTemplate("passkey-confirm");
6809
+ const html = TemplateEngine.render(template, { title, description });
6810
+ const overlay = document.createElement("div");
6811
+ overlay.innerHTML = html;
6812
+ document.body.appendChild(overlay);
6813
+ const confirmed = await new Promise((resolve) => {
6814
+ overlay.querySelector(".confirm-btn").addEventListener("click", (e) => {
6815
+ if (e.isTrusted) resolve(true);
6816
+ });
6817
+ overlay.querySelector(".cancel-btn").addEventListener("click", () => resolve(false));
6818
+ });
6819
+ if (!confirmed) {
6820
+ overlay.remove();
6821
+ this.hideIframe();
6822
+ throw new Error("User cancelled passkey authentication");
6823
+ }
6824
+ const actions = overlay.querySelector(".passkey-actions");
6825
+ const status = overlay.querySelector(".passkey-status");
6826
+ actions.innerHTML = '<div class="spinner" style="margin:0 auto"></div>';
6827
+ status.textContent = "Waiting for passkey...";
6828
+ try {
6829
+ return await operation();
6830
+ } finally {
6831
+ overlay.remove();
6832
+ this.hideIframe();
6833
+ }
6834
+ }
6835
+ showIframe() {
6836
+ if (window.parent !== window) {
6837
+ window.parent.postMessage({ type: "IFRAME_MSG_SHOW_IFRAME", timestamp: Date.now() }, "*");
6838
+ }
6839
+ }
6840
+ hideIframe() {
6841
+ if (window.parent !== window) {
6842
+ window.parent.postMessage({ type: "IFRAME_MSG_HIDE_IFRAME", timestamp: Date.now() }, "*");
6843
+ }
6844
+ }
6845
+ isSafari() {
6846
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
6847
+ }
5114
6848
  async handleRestoreBackup(message, origin) {
5115
6849
  const { sessionToken, userId, password, accessToken } = message.data;
5116
6850
  const { messageId } = message;
@@ -5132,7 +6866,8 @@ var IframeWallet = class {
5132
6866
  return;
5133
6867
  }
5134
6868
  try {
5135
- const backupData = await this.backupManager.restoreFromServer(userId, password, accessToken);
6869
+ const restoreOp = () => this.backupManager.restoreFromServer(userId, password, accessToken);
6870
+ const backupData = !password && this.isSafari() ? await this.withPasskeyConfirmation("restore", restoreOp) : await restoreOp();
5136
6871
  this.messenger.sendResponse(
5137
6872
  messageId,
5138
6873
  {
@@ -5422,5 +7157,16 @@ if (document.readyState === "loading") {
5422
7157
 
5423
7158
  @noble/hashes/esm/utils.js:
5424
7159
  (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
7160
+
7161
+ lodash-es/lodash.js:
7162
+ (**
7163
+ * @license
7164
+ * Lodash (Custom Build) <https://lodash.com/>
7165
+ * Build: `lodash modularize exports="es" -o ./`
7166
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
7167
+ * Released under MIT license <https://lodash.com/license>
7168
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7169
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
7170
+ *)
5425
7171
  */
5426
7172
  //# sourceMappingURL=main.js.map