@assembled-brands/frontend 0.1.0

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.
Files changed (45) hide show
  1. package/README.md +0 -0
  2. package/dist/_headers +17 -0
  3. package/dist/pages/account-recovery-complete/index.js +2861 -0
  4. package/dist/pages/account-recovery-complete/index.js.map +7 -0
  5. package/dist/pages/account-recovery-initiate/index.js +2824 -0
  6. package/dist/pages/account-recovery-initiate/index.js.map +7 -0
  7. package/dist/pages/account-setup-finish-verification/index.js +2866 -0
  8. package/dist/pages/account-setup-finish-verification/index.js.map +7 -0
  9. package/dist/pages/claim-account/index.js +2931 -0
  10. package/dist/pages/claim-account/index.js.map +7 -0
  11. package/dist/pages/cold-lead-register/index.js +2837 -0
  12. package/dist/pages/cold-lead-register/index.js.map +7 -0
  13. package/dist/pages/finance-docs-accounts-inventory/index.js +3208 -0
  14. package/dist/pages/finance-docs-accounts-inventory/index.js.map +7 -0
  15. package/dist/pages/finance-docs-ecommerce-performance/index.js +3143 -0
  16. package/dist/pages/finance-docs-ecommerce-performance/index.js.map +7 -0
  17. package/dist/pages/finance-docs-financial-reports/index.js +3179 -0
  18. package/dist/pages/finance-docs-financial-reports/index.js.map +7 -0
  19. package/dist/pages/finance-docs-team-ownership/index.js +3208 -0
  20. package/dist/pages/finance-docs-team-ownership/index.js.map +7 -0
  21. package/dist/pages/financial-company-profile/index.js +3024 -0
  22. package/dist/pages/financial-company-profile/index.js.map +7 -0
  23. package/dist/pages/financial-financial-overview/index.js +2966 -0
  24. package/dist/pages/financial-financial-overview/index.js.map +7 -0
  25. package/dist/pages/financial-wizard-step-3/index.js +2902 -0
  26. package/dist/pages/financial-wizard-step-3/index.js.map +174 -0
  27. package/dist/pages/financial-wizard-step-4/index.js +2902 -0
  28. package/dist/pages/financial-wizard-step-4/index.js.map +174 -0
  29. package/dist/pages/financial-wizard-step-5/index.js +2920 -0
  30. package/dist/pages/financial-wizard-step-5/index.js.map +174 -0
  31. package/dist/pages/invite-team-members/index.js +2978 -0
  32. package/dist/pages/invite-team-members/index.js.map +7 -0
  33. package/dist/pages/login/index.js +2877 -0
  34. package/dist/pages/login/index.js.map +7 -0
  35. package/dist/pages/onboarding-step-1/index.js +2868 -0
  36. package/dist/pages/onboarding-step-1/index.js.map +7 -0
  37. package/dist/pages/onboarding-step-2/index.js +2870 -0
  38. package/dist/pages/onboarding-step-2/index.js.map +7 -0
  39. package/dist/pages/onboarding-step-3/index.js +2888 -0
  40. package/dist/pages/onboarding-step-3/index.js.map +7 -0
  41. package/dist/pages/team-acknowledge-invitation/index.js +2812 -0
  42. package/dist/pages/team-acknowledge-invitation/index.js.map +7 -0
  43. package/dist/pages/team-members/index.js +2874 -0
  44. package/dist/pages/team-members/index.js.map +7 -0
  45. package/package.json +31 -0
@@ -0,0 +1,2902 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all3) => {
3
+ for (var name in all3)
4
+ __defProp(target, name, { get: all3[name], enumerable: true });
5
+ };
6
+
7
+ // bin/live-reload.js
8
+ new EventSource(`${"http://localhost:3000"}/esbuild`).addEventListener("change", () => location.reload());
9
+
10
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/bind.js
11
+ function bind(fn, thisArg) {
12
+ return function wrap() {
13
+ return fn.apply(thisArg, arguments);
14
+ };
15
+ }
16
+
17
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/utils.js
18
+ var { toString } = Object.prototype;
19
+ var { getPrototypeOf } = Object;
20
+ var { iterator, toStringTag } = Symbol;
21
+ var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
22
+ const str = toString.call(thing);
23
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
24
+ })(/* @__PURE__ */ Object.create(null));
25
+ var kindOfTest = (type) => {
26
+ type = type.toLowerCase();
27
+ return (thing) => kindOf(thing) === type;
28
+ };
29
+ var typeOfTest = (type) => (thing) => typeof thing === type;
30
+ var { isArray } = Array;
31
+ var isUndefined = typeOfTest("undefined");
32
+ function isBuffer(val) {
33
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
34
+ }
35
+ var isArrayBuffer = kindOfTest("ArrayBuffer");
36
+ function isArrayBufferView(val) {
37
+ let result;
38
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
39
+ result = ArrayBuffer.isView(val);
40
+ } else {
41
+ result = val && val.buffer && isArrayBuffer(val.buffer);
42
+ }
43
+ return result;
44
+ }
45
+ var isString = typeOfTest("string");
46
+ var isFunction = typeOfTest("function");
47
+ var isNumber = typeOfTest("number");
48
+ var isObject = (thing) => thing !== null && typeof thing === "object";
49
+ var isBoolean = (thing) => thing === true || thing === false;
50
+ var isPlainObject = (val) => {
51
+ if (kindOf(val) !== "object") {
52
+ return false;
53
+ }
54
+ const prototype3 = getPrototypeOf(val);
55
+ return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator in val);
56
+ };
57
+ var isEmptyObject = (val) => {
58
+ if (!isObject(val) || isBuffer(val)) {
59
+ return false;
60
+ }
61
+ try {
62
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
63
+ } catch (e) {
64
+ return false;
65
+ }
66
+ };
67
+ var isDate = kindOfTest("Date");
68
+ var isFile = kindOfTest("File");
69
+ var isBlob = kindOfTest("Blob");
70
+ var isFileList = kindOfTest("FileList");
71
+ var isStream = (val) => isObject(val) && isFunction(val.pipe);
72
+ var isFormData = (thing) => {
73
+ let kind;
74
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
75
+ kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
76
+ };
77
+ var isURLSearchParams = kindOfTest("URLSearchParams");
78
+ var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
79
+ var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
80
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
81
+ if (obj === null || typeof obj === "undefined") {
82
+ return;
83
+ }
84
+ let i;
85
+ let l;
86
+ if (typeof obj !== "object") {
87
+ obj = [obj];
88
+ }
89
+ if (isArray(obj)) {
90
+ for (i = 0, l = obj.length; i < l; i++) {
91
+ fn.call(null, obj[i], i, obj);
92
+ }
93
+ } else {
94
+ if (isBuffer(obj)) {
95
+ return;
96
+ }
97
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
98
+ const len = keys.length;
99
+ let key;
100
+ for (i = 0; i < len; i++) {
101
+ key = keys[i];
102
+ fn.call(null, obj[key], key, obj);
103
+ }
104
+ }
105
+ }
106
+ function findKey(obj, key) {
107
+ if (isBuffer(obj)) {
108
+ return null;
109
+ }
110
+ key = key.toLowerCase();
111
+ const keys = Object.keys(obj);
112
+ let i = keys.length;
113
+ let _key;
114
+ while (i-- > 0) {
115
+ _key = keys[i];
116
+ if (key === _key.toLowerCase()) {
117
+ return _key;
118
+ }
119
+ }
120
+ return null;
121
+ }
122
+ var _global = (() => {
123
+ if (typeof globalThis !== "undefined") return globalThis;
124
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
125
+ })();
126
+ var isContextDefined = (context) => !isUndefined(context) && context !== _global;
127
+ function merge() {
128
+ const { caseless, skipUndefined } = isContextDefined(this) && this || {};
129
+ const result = {};
130
+ const assignValue = (val, key) => {
131
+ const targetKey = caseless && findKey(result, key) || key;
132
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
133
+ result[targetKey] = merge(result[targetKey], val);
134
+ } else if (isPlainObject(val)) {
135
+ result[targetKey] = merge({}, val);
136
+ } else if (isArray(val)) {
137
+ result[targetKey] = val.slice();
138
+ } else if (!skipUndefined || !isUndefined(val)) {
139
+ result[targetKey] = val;
140
+ }
141
+ };
142
+ for (let i = 0, l = arguments.length; i < l; i++) {
143
+ arguments[i] && forEach(arguments[i], assignValue);
144
+ }
145
+ return result;
146
+ }
147
+ var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
148
+ forEach(b, (val, key) => {
149
+ if (thisArg && isFunction(val)) {
150
+ a[key] = bind(val, thisArg);
151
+ } else {
152
+ a[key] = val;
153
+ }
154
+ }, { allOwnKeys });
155
+ return a;
156
+ };
157
+ var stripBOM = (content) => {
158
+ if (content.charCodeAt(0) === 65279) {
159
+ content = content.slice(1);
160
+ }
161
+ return content;
162
+ };
163
+ var inherits = (constructor, superConstructor, props, descriptors2) => {
164
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
165
+ constructor.prototype.constructor = constructor;
166
+ Object.defineProperty(constructor, "super", {
167
+ value: superConstructor.prototype
168
+ });
169
+ props && Object.assign(constructor.prototype, props);
170
+ };
171
+ var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
172
+ let props;
173
+ let i;
174
+ let prop;
175
+ const merged = {};
176
+ destObj = destObj || {};
177
+ if (sourceObj == null) return destObj;
178
+ do {
179
+ props = Object.getOwnPropertyNames(sourceObj);
180
+ i = props.length;
181
+ while (i-- > 0) {
182
+ prop = props[i];
183
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
184
+ destObj[prop] = sourceObj[prop];
185
+ merged[prop] = true;
186
+ }
187
+ }
188
+ sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
189
+ } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
190
+ return destObj;
191
+ };
192
+ var endsWith = (str, searchString, position) => {
193
+ str = String(str);
194
+ if (position === void 0 || position > str.length) {
195
+ position = str.length;
196
+ }
197
+ position -= searchString.length;
198
+ const lastIndex = str.indexOf(searchString, position);
199
+ return lastIndex !== -1 && lastIndex === position;
200
+ };
201
+ var toArray = (thing) => {
202
+ if (!thing) return null;
203
+ if (isArray(thing)) return thing;
204
+ let i = thing.length;
205
+ if (!isNumber(i)) return null;
206
+ const arr = new Array(i);
207
+ while (i-- > 0) {
208
+ arr[i] = thing[i];
209
+ }
210
+ return arr;
211
+ };
212
+ var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
213
+ return (thing) => {
214
+ return TypedArray && thing instanceof TypedArray;
215
+ };
216
+ })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
217
+ var forEachEntry = (obj, fn) => {
218
+ const generator = obj && obj[iterator];
219
+ const _iterator = generator.call(obj);
220
+ let result;
221
+ while ((result = _iterator.next()) && !result.done) {
222
+ const pair = result.value;
223
+ fn.call(obj, pair[0], pair[1]);
224
+ }
225
+ };
226
+ var matchAll = (regExp, str) => {
227
+ let matches;
228
+ const arr = [];
229
+ while ((matches = regExp.exec(str)) !== null) {
230
+ arr.push(matches);
231
+ }
232
+ return arr;
233
+ };
234
+ var isHTMLForm = kindOfTest("HTMLFormElement");
235
+ var toCamelCase = (str) => {
236
+ return str.toLowerCase().replace(
237
+ /[-_\s]([a-z\d])(\w*)/g,
238
+ function replacer(m, p1, p2) {
239
+ return p1.toUpperCase() + p2;
240
+ }
241
+ );
242
+ };
243
+ var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
244
+ var isRegExp = kindOfTest("RegExp");
245
+ var reduceDescriptors = (obj, reducer) => {
246
+ const descriptors2 = Object.getOwnPropertyDescriptors(obj);
247
+ const reducedDescriptors = {};
248
+ forEach(descriptors2, (descriptor, name) => {
249
+ let ret;
250
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
251
+ reducedDescriptors[name] = ret || descriptor;
252
+ }
253
+ });
254
+ Object.defineProperties(obj, reducedDescriptors);
255
+ };
256
+ var freezeMethods = (obj) => {
257
+ reduceDescriptors(obj, (descriptor, name) => {
258
+ if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
259
+ return false;
260
+ }
261
+ const value = obj[name];
262
+ if (!isFunction(value)) return;
263
+ descriptor.enumerable = false;
264
+ if ("writable" in descriptor) {
265
+ descriptor.writable = false;
266
+ return;
267
+ }
268
+ if (!descriptor.set) {
269
+ descriptor.set = () => {
270
+ throw Error("Can not rewrite read-only method '" + name + "'");
271
+ };
272
+ }
273
+ });
274
+ };
275
+ var toObjectSet = (arrayOrString, delimiter) => {
276
+ const obj = {};
277
+ const define = (arr) => {
278
+ arr.forEach((value) => {
279
+ obj[value] = true;
280
+ });
281
+ };
282
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
283
+ return obj;
284
+ };
285
+ var noop = () => {
286
+ };
287
+ var toFiniteNumber = (value, defaultValue) => {
288
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
289
+ };
290
+ function isSpecCompliantForm(thing) {
291
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
292
+ }
293
+ var toJSONObject = (obj) => {
294
+ const stack = new Array(10);
295
+ const visit = (source, i) => {
296
+ if (isObject(source)) {
297
+ if (stack.indexOf(source) >= 0) {
298
+ return;
299
+ }
300
+ if (isBuffer(source)) {
301
+ return source;
302
+ }
303
+ if (!("toJSON" in source)) {
304
+ stack[i] = source;
305
+ const target = isArray(source) ? [] : {};
306
+ forEach(source, (value, key) => {
307
+ const reducedValue = visit(value, i + 1);
308
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
309
+ });
310
+ stack[i] = void 0;
311
+ return target;
312
+ }
313
+ }
314
+ return source;
315
+ };
316
+ return visit(obj, 0);
317
+ };
318
+ var isAsyncFn = kindOfTest("AsyncFunction");
319
+ var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
320
+ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
321
+ if (setImmediateSupported) {
322
+ return setImmediate;
323
+ }
324
+ return postMessageSupported ? ((token, callbacks) => {
325
+ _global.addEventListener("message", ({ source, data }) => {
326
+ if (source === _global && data === token) {
327
+ callbacks.length && callbacks.shift()();
328
+ }
329
+ }, false);
330
+ return (cb) => {
331
+ callbacks.push(cb);
332
+ _global.postMessage(token, "*");
333
+ };
334
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
335
+ })(
336
+ typeof setImmediate === "function",
337
+ isFunction(_global.postMessage)
338
+ );
339
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
340
+ var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
341
+ var utils_default = {
342
+ isArray,
343
+ isArrayBuffer,
344
+ isBuffer,
345
+ isFormData,
346
+ isArrayBufferView,
347
+ isString,
348
+ isNumber,
349
+ isBoolean,
350
+ isObject,
351
+ isPlainObject,
352
+ isEmptyObject,
353
+ isReadableStream,
354
+ isRequest,
355
+ isResponse,
356
+ isHeaders,
357
+ isUndefined,
358
+ isDate,
359
+ isFile,
360
+ isBlob,
361
+ isRegExp,
362
+ isFunction,
363
+ isStream,
364
+ isURLSearchParams,
365
+ isTypedArray,
366
+ isFileList,
367
+ forEach,
368
+ merge,
369
+ extend,
370
+ trim,
371
+ stripBOM,
372
+ inherits,
373
+ toFlatObject,
374
+ kindOf,
375
+ kindOfTest,
376
+ endsWith,
377
+ toArray,
378
+ forEachEntry,
379
+ matchAll,
380
+ isHTMLForm,
381
+ hasOwnProperty,
382
+ hasOwnProp: hasOwnProperty,
383
+ // an alias to avoid ESLint no-prototype-builtins detection
384
+ reduceDescriptors,
385
+ freezeMethods,
386
+ toObjectSet,
387
+ toCamelCase,
388
+ noop,
389
+ toFiniteNumber,
390
+ findKey,
391
+ global: _global,
392
+ isContextDefined,
393
+ isSpecCompliantForm,
394
+ toJSONObject,
395
+ isAsyncFn,
396
+ isThenable,
397
+ setImmediate: _setImmediate,
398
+ asap,
399
+ isIterable
400
+ };
401
+
402
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/AxiosError.js
403
+ function AxiosError(message, code, config, request, response) {
404
+ Error.call(this);
405
+ if (Error.captureStackTrace) {
406
+ Error.captureStackTrace(this, this.constructor);
407
+ } else {
408
+ this.stack = new Error().stack;
409
+ }
410
+ this.message = message;
411
+ this.name = "AxiosError";
412
+ code && (this.code = code);
413
+ config && (this.config = config);
414
+ request && (this.request = request);
415
+ if (response) {
416
+ this.response = response;
417
+ this.status = response.status ? response.status : null;
418
+ }
419
+ }
420
+ utils_default.inherits(AxiosError, Error, {
421
+ toJSON: function toJSON() {
422
+ return {
423
+ // Standard
424
+ message: this.message,
425
+ name: this.name,
426
+ // Microsoft
427
+ description: this.description,
428
+ number: this.number,
429
+ // Mozilla
430
+ fileName: this.fileName,
431
+ lineNumber: this.lineNumber,
432
+ columnNumber: this.columnNumber,
433
+ stack: this.stack,
434
+ // Axios
435
+ config: utils_default.toJSONObject(this.config),
436
+ code: this.code,
437
+ status: this.status
438
+ };
439
+ }
440
+ });
441
+ var prototype = AxiosError.prototype;
442
+ var descriptors = {};
443
+ [
444
+ "ERR_BAD_OPTION_VALUE",
445
+ "ERR_BAD_OPTION",
446
+ "ECONNABORTED",
447
+ "ETIMEDOUT",
448
+ "ERR_NETWORK",
449
+ "ERR_FR_TOO_MANY_REDIRECTS",
450
+ "ERR_DEPRECATED",
451
+ "ERR_BAD_RESPONSE",
452
+ "ERR_BAD_REQUEST",
453
+ "ERR_CANCELED",
454
+ "ERR_NOT_SUPPORT",
455
+ "ERR_INVALID_URL"
456
+ // eslint-disable-next-line func-names
457
+ ].forEach((code) => {
458
+ descriptors[code] = { value: code };
459
+ });
460
+ Object.defineProperties(AxiosError, descriptors);
461
+ Object.defineProperty(prototype, "isAxiosError", { value: true });
462
+ AxiosError.from = (error, code, config, request, response, customProps) => {
463
+ const axiosError = Object.create(prototype);
464
+ utils_default.toFlatObject(error, axiosError, function filter2(obj) {
465
+ return obj !== Error.prototype;
466
+ }, (prop) => {
467
+ return prop !== "isAxiosError";
468
+ });
469
+ const msg = error && error.message ? error.message : "Error";
470
+ const errCode = code == null && error ? error.code : code;
471
+ AxiosError.call(axiosError, msg, errCode, config, request, response);
472
+ if (error && axiosError.cause == null) {
473
+ Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
474
+ }
475
+ axiosError.name = error && error.name || "Error";
476
+ customProps && Object.assign(axiosError, customProps);
477
+ return axiosError;
478
+ };
479
+ var AxiosError_default = AxiosError;
480
+
481
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/null.js
482
+ var null_default = null;
483
+
484
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/toFormData.js
485
+ function isVisitable(thing) {
486
+ return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
487
+ }
488
+ function removeBrackets(key) {
489
+ return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
490
+ }
491
+ function renderKey(path, key, dots) {
492
+ if (!path) return key;
493
+ return path.concat(key).map(function each(token, i) {
494
+ token = removeBrackets(token);
495
+ return !dots && i ? "[" + token + "]" : token;
496
+ }).join(dots ? "." : "");
497
+ }
498
+ function isFlatArray(arr) {
499
+ return utils_default.isArray(arr) && !arr.some(isVisitable);
500
+ }
501
+ var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
502
+ return /^is[A-Z]/.test(prop);
503
+ });
504
+ function toFormData(obj, formData, options) {
505
+ if (!utils_default.isObject(obj)) {
506
+ throw new TypeError("target must be an object");
507
+ }
508
+ formData = formData || new (null_default || FormData)();
509
+ options = utils_default.toFlatObject(options, {
510
+ metaTokens: true,
511
+ dots: false,
512
+ indexes: false
513
+ }, false, function defined(option, source) {
514
+ return !utils_default.isUndefined(source[option]);
515
+ });
516
+ const metaTokens = options.metaTokens;
517
+ const visitor = options.visitor || defaultVisitor;
518
+ const dots = options.dots;
519
+ const indexes = options.indexes;
520
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
521
+ const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
522
+ if (!utils_default.isFunction(visitor)) {
523
+ throw new TypeError("visitor must be a function");
524
+ }
525
+ function convertValue(value) {
526
+ if (value === null) return "";
527
+ if (utils_default.isDate(value)) {
528
+ return value.toISOString();
529
+ }
530
+ if (utils_default.isBoolean(value)) {
531
+ return value.toString();
532
+ }
533
+ if (!useBlob && utils_default.isBlob(value)) {
534
+ throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
535
+ }
536
+ if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
537
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
538
+ }
539
+ return value;
540
+ }
541
+ function defaultVisitor(value, key, path) {
542
+ let arr = value;
543
+ if (value && !path && typeof value === "object") {
544
+ if (utils_default.endsWith(key, "{}")) {
545
+ key = metaTokens ? key : key.slice(0, -2);
546
+ value = JSON.stringify(value);
547
+ } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
548
+ key = removeBrackets(key);
549
+ arr.forEach(function each(el, index) {
550
+ !(utils_default.isUndefined(el) || el === null) && formData.append(
551
+ // eslint-disable-next-line no-nested-ternary
552
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
553
+ convertValue(el)
554
+ );
555
+ });
556
+ return false;
557
+ }
558
+ }
559
+ if (isVisitable(value)) {
560
+ return true;
561
+ }
562
+ formData.append(renderKey(path, key, dots), convertValue(value));
563
+ return false;
564
+ }
565
+ const stack = [];
566
+ const exposedHelpers = Object.assign(predicates, {
567
+ defaultVisitor,
568
+ convertValue,
569
+ isVisitable
570
+ });
571
+ function build(value, path) {
572
+ if (utils_default.isUndefined(value)) return;
573
+ if (stack.indexOf(value) !== -1) {
574
+ throw Error("Circular reference detected in " + path.join("."));
575
+ }
576
+ stack.push(value);
577
+ utils_default.forEach(value, function each(el, key) {
578
+ const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
579
+ formData,
580
+ el,
581
+ utils_default.isString(key) ? key.trim() : key,
582
+ path,
583
+ exposedHelpers
584
+ );
585
+ if (result === true) {
586
+ build(el, path ? path.concat(key) : [key]);
587
+ }
588
+ });
589
+ stack.pop();
590
+ }
591
+ if (!utils_default.isObject(obj)) {
592
+ throw new TypeError("data must be an object");
593
+ }
594
+ build(obj);
595
+ return formData;
596
+ }
597
+ var toFormData_default = toFormData;
598
+
599
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
600
+ function encode(str) {
601
+ const charMap = {
602
+ "!": "%21",
603
+ "'": "%27",
604
+ "(": "%28",
605
+ ")": "%29",
606
+ "~": "%7E",
607
+ "%20": "+",
608
+ "%00": "\0"
609
+ };
610
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
611
+ return charMap[match];
612
+ });
613
+ }
614
+ function AxiosURLSearchParams(params, options) {
615
+ this._pairs = [];
616
+ params && toFormData_default(params, this, options);
617
+ }
618
+ var prototype2 = AxiosURLSearchParams.prototype;
619
+ prototype2.append = function append(name, value) {
620
+ this._pairs.push([name, value]);
621
+ };
622
+ prototype2.toString = function toString2(encoder) {
623
+ const _encode = encoder ? function (value) {
624
+ return encoder.call(this, value, encode);
625
+ } : encode;
626
+ return this._pairs.map(function each(pair) {
627
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
628
+ }, "").join("&");
629
+ };
630
+ var AxiosURLSearchParams_default = AxiosURLSearchParams;
631
+
632
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/buildURL.js
633
+ function encode2(val) {
634
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
635
+ }
636
+ function buildURL(url, params, options) {
637
+ if (!params) {
638
+ return url;
639
+ }
640
+ const _encode = options && options.encode || encode2;
641
+ if (utils_default.isFunction(options)) {
642
+ options = {
643
+ serialize: options
644
+ };
645
+ }
646
+ const serializeFn = options && options.serialize;
647
+ let serializedParams;
648
+ if (serializeFn) {
649
+ serializedParams = serializeFn(params, options);
650
+ } else {
651
+ serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
652
+ }
653
+ if (serializedParams) {
654
+ const hashmarkIndex = url.indexOf("#");
655
+ if (hashmarkIndex !== -1) {
656
+ url = url.slice(0, hashmarkIndex);
657
+ }
658
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
659
+ }
660
+ return url;
661
+ }
662
+
663
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/InterceptorManager.js
664
+ var InterceptorManager = class {
665
+ constructor() {
666
+ this.handlers = [];
667
+ }
668
+ /**
669
+ * Add a new interceptor to the stack
670
+ *
671
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
672
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
673
+ *
674
+ * @return {Number} An ID used to remove interceptor later
675
+ */
676
+ use(fulfilled, rejected, options) {
677
+ this.handlers.push({
678
+ fulfilled,
679
+ rejected,
680
+ synchronous: options ? options.synchronous : false,
681
+ runWhen: options ? options.runWhen : null
682
+ });
683
+ return this.handlers.length - 1;
684
+ }
685
+ /**
686
+ * Remove an interceptor from the stack
687
+ *
688
+ * @param {Number} id The ID that was returned by `use`
689
+ *
690
+ * @returns {void}
691
+ */
692
+ eject(id) {
693
+ if (this.handlers[id]) {
694
+ this.handlers[id] = null;
695
+ }
696
+ }
697
+ /**
698
+ * Clear all interceptors from the stack
699
+ *
700
+ * @returns {void}
701
+ */
702
+ clear() {
703
+ if (this.handlers) {
704
+ this.handlers = [];
705
+ }
706
+ }
707
+ /**
708
+ * Iterate over all the registered interceptors
709
+ *
710
+ * This method is particularly useful for skipping over any
711
+ * interceptors that may have become `null` calling `eject`.
712
+ *
713
+ * @param {Function} fn The function to call for each interceptor
714
+ *
715
+ * @returns {void}
716
+ */
717
+ forEach(fn) {
718
+ utils_default.forEach(this.handlers, function forEachHandler(h) {
719
+ if (h !== null) {
720
+ fn(h);
721
+ }
722
+ });
723
+ }
724
+ };
725
+ var InterceptorManager_default = InterceptorManager;
726
+
727
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/defaults/transitional.js
728
+ var transitional_default = {
729
+ silentJSONParsing: true,
730
+ forcedJSONParsing: true,
731
+ clarifyTimeoutError: false
732
+ };
733
+
734
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
735
+ var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
736
+
737
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/classes/FormData.js
738
+ var FormData_default = typeof FormData !== "undefined" ? FormData : null;
739
+
740
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/classes/Blob.js
741
+ var Blob_default = typeof Blob !== "undefined" ? Blob : null;
742
+
743
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/browser/index.js
744
+ var browser_default = {
745
+ isBrowser: true,
746
+ classes: {
747
+ URLSearchParams: URLSearchParams_default,
748
+ FormData: FormData_default,
749
+ Blob: Blob_default
750
+ },
751
+ protocols: ["http", "https", "file", "blob", "url", "data"]
752
+ };
753
+
754
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/common/utils.js
755
+ var utils_exports = {};
756
+ __export(utils_exports, {
757
+ hasBrowserEnv: () => hasBrowserEnv,
758
+ hasStandardBrowserEnv: () => hasStandardBrowserEnv,
759
+ hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
760
+ navigator: () => _navigator,
761
+ origin: () => origin
762
+ });
763
+ var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
764
+ var _navigator = typeof navigator === "object" && navigator || void 0;
765
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
766
+ var hasStandardBrowserWebWorkerEnv = (() => {
767
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
768
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
769
+ })();
770
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
771
+
772
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/platform/index.js
773
+ var platform_default = {
774
+ ...utils_exports,
775
+ ...browser_default
776
+ };
777
+
778
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/toURLEncodedForm.js
779
+ function toURLEncodedForm(data, options) {
780
+ return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
781
+ visitor: function (value, key, path, helpers) {
782
+ if (platform_default.isNode && utils_default.isBuffer(value)) {
783
+ this.append(key, value.toString("base64"));
784
+ return false;
785
+ }
786
+ return helpers.defaultVisitor.apply(this, arguments);
787
+ },
788
+ ...options
789
+ });
790
+ }
791
+
792
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/formDataToJSON.js
793
+ function parsePropPath(name) {
794
+ return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
795
+ return match[0] === "[]" ? "" : match[1] || match[0];
796
+ });
797
+ }
798
+ function arrayToObject(arr) {
799
+ const obj = {};
800
+ const keys = Object.keys(arr);
801
+ let i;
802
+ const len = keys.length;
803
+ let key;
804
+ for (i = 0; i < len; i++) {
805
+ key = keys[i];
806
+ obj[key] = arr[key];
807
+ }
808
+ return obj;
809
+ }
810
+ function formDataToJSON(formData) {
811
+ function buildPath(path, value, target, index) {
812
+ let name = path[index++];
813
+ if (name === "__proto__") return true;
814
+ const isNumericKey = Number.isFinite(+name);
815
+ const isLast = index >= path.length;
816
+ name = !name && utils_default.isArray(target) ? target.length : name;
817
+ if (isLast) {
818
+ if (utils_default.hasOwnProp(target, name)) {
819
+ target[name] = [target[name], value];
820
+ } else {
821
+ target[name] = value;
822
+ }
823
+ return !isNumericKey;
824
+ }
825
+ if (!target[name] || !utils_default.isObject(target[name])) {
826
+ target[name] = [];
827
+ }
828
+ const result = buildPath(path, value, target[name], index);
829
+ if (result && utils_default.isArray(target[name])) {
830
+ target[name] = arrayToObject(target[name]);
831
+ }
832
+ return !isNumericKey;
833
+ }
834
+ if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
835
+ const obj = {};
836
+ utils_default.forEachEntry(formData, (name, value) => {
837
+ buildPath(parsePropPath(name), value, obj, 0);
838
+ });
839
+ return obj;
840
+ }
841
+ return null;
842
+ }
843
+ var formDataToJSON_default = formDataToJSON;
844
+
845
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/defaults/index.js
846
+ function stringifySafely(rawValue, parser, encoder) {
847
+ if (utils_default.isString(rawValue)) {
848
+ try {
849
+ (parser || JSON.parse)(rawValue);
850
+ return utils_default.trim(rawValue);
851
+ } catch (e) {
852
+ if (e.name !== "SyntaxError") {
853
+ throw e;
854
+ }
855
+ }
856
+ }
857
+ return (encoder || JSON.stringify)(rawValue);
858
+ }
859
+ var defaults = {
860
+ transitional: transitional_default,
861
+ adapter: ["xhr", "http", "fetch"],
862
+ transformRequest: [function transformRequest(data, headers) {
863
+ const contentType = headers.getContentType() || "";
864
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
865
+ const isObjectPayload = utils_default.isObject(data);
866
+ if (isObjectPayload && utils_default.isHTMLForm(data)) {
867
+ data = new FormData(data);
868
+ }
869
+ const isFormData2 = utils_default.isFormData(data);
870
+ if (isFormData2) {
871
+ return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
872
+ }
873
+ if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
874
+ return data;
875
+ }
876
+ if (utils_default.isArrayBufferView(data)) {
877
+ return data.buffer;
878
+ }
879
+ if (utils_default.isURLSearchParams(data)) {
880
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
881
+ return data.toString();
882
+ }
883
+ let isFileList2;
884
+ if (isObjectPayload) {
885
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
886
+ return toURLEncodedForm(data, this.formSerializer).toString();
887
+ }
888
+ if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
889
+ const _FormData = this.env && this.env.FormData;
890
+ return toFormData_default(
891
+ isFileList2 ? { "files[]": data } : data,
892
+ _FormData && new _FormData(),
893
+ this.formSerializer
894
+ );
895
+ }
896
+ }
897
+ if (isObjectPayload || hasJSONContentType) {
898
+ headers.setContentType("application/json", false);
899
+ return stringifySafely(data);
900
+ }
901
+ return data;
902
+ }],
903
+ transformResponse: [function transformResponse(data) {
904
+ const transitional2 = this.transitional || defaults.transitional;
905
+ const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
906
+ const JSONRequested = this.responseType === "json";
907
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
908
+ return data;
909
+ }
910
+ if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
911
+ const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
912
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
913
+ try {
914
+ return JSON.parse(data, this.parseReviver);
915
+ } catch (e) {
916
+ if (strictJSONParsing) {
917
+ if (e.name === "SyntaxError") {
918
+ throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
919
+ }
920
+ throw e;
921
+ }
922
+ }
923
+ }
924
+ return data;
925
+ }],
926
+ /**
927
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
928
+ * timeout is not created.
929
+ */
930
+ timeout: 0,
931
+ xsrfCookieName: "XSRF-TOKEN",
932
+ xsrfHeaderName: "X-XSRF-TOKEN",
933
+ maxContentLength: -1,
934
+ maxBodyLength: -1,
935
+ env: {
936
+ FormData: platform_default.classes.FormData,
937
+ Blob: platform_default.classes.Blob
938
+ },
939
+ validateStatus: function validateStatus(status) {
940
+ return status >= 200 && status < 300;
941
+ },
942
+ headers: {
943
+ common: {
944
+ "Accept": "application/json, text/plain, */*",
945
+ "Content-Type": void 0
946
+ }
947
+ }
948
+ };
949
+ utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
950
+ defaults.headers[method] = {};
951
+ });
952
+ var defaults_default = defaults;
953
+
954
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/parseHeaders.js
955
+ var ignoreDuplicateOf = utils_default.toObjectSet([
956
+ "age",
957
+ "authorization",
958
+ "content-length",
959
+ "content-type",
960
+ "etag",
961
+ "expires",
962
+ "from",
963
+ "host",
964
+ "if-modified-since",
965
+ "if-unmodified-since",
966
+ "last-modified",
967
+ "location",
968
+ "max-forwards",
969
+ "proxy-authorization",
970
+ "referer",
971
+ "retry-after",
972
+ "user-agent"
973
+ ]);
974
+ var parseHeaders_default = (rawHeaders) => {
975
+ const parsed = {};
976
+ let key;
977
+ let val;
978
+ let i;
979
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
980
+ i = line.indexOf(":");
981
+ key = line.substring(0, i).trim().toLowerCase();
982
+ val = line.substring(i + 1).trim();
983
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
984
+ return;
985
+ }
986
+ if (key === "set-cookie") {
987
+ if (parsed[key]) {
988
+ parsed[key].push(val);
989
+ } else {
990
+ parsed[key] = [val];
991
+ }
992
+ } else {
993
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
994
+ }
995
+ });
996
+ return parsed;
997
+ };
998
+
999
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/AxiosHeaders.js
1000
+ var $internals = Symbol("internals");
1001
+ function normalizeHeader(header) {
1002
+ return header && String(header).trim().toLowerCase();
1003
+ }
1004
+ function normalizeValue(value) {
1005
+ if (value === false || value == null) {
1006
+ return value;
1007
+ }
1008
+ return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
1009
+ }
1010
+ function parseTokens(str) {
1011
+ const tokens = /* @__PURE__ */ Object.create(null);
1012
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1013
+ let match;
1014
+ while (match = tokensRE.exec(str)) {
1015
+ tokens[match[1]] = match[2];
1016
+ }
1017
+ return tokens;
1018
+ }
1019
+ var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1020
+ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
1021
+ if (utils_default.isFunction(filter2)) {
1022
+ return filter2.call(this, value, header);
1023
+ }
1024
+ if (isHeaderNameFilter) {
1025
+ value = header;
1026
+ }
1027
+ if (!utils_default.isString(value)) return;
1028
+ if (utils_default.isString(filter2)) {
1029
+ return value.indexOf(filter2) !== -1;
1030
+ }
1031
+ if (utils_default.isRegExp(filter2)) {
1032
+ return filter2.test(value);
1033
+ }
1034
+ }
1035
+ function formatHeader(header) {
1036
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1037
+ return char.toUpperCase() + str;
1038
+ });
1039
+ }
1040
+ function buildAccessors(obj, header) {
1041
+ const accessorName = utils_default.toCamelCase(" " + header);
1042
+ ["get", "set", "has"].forEach((methodName) => {
1043
+ Object.defineProperty(obj, methodName + accessorName, {
1044
+ value: function (arg1, arg2, arg3) {
1045
+ return this[methodName].call(this, header, arg1, arg2, arg3);
1046
+ },
1047
+ configurable: true
1048
+ });
1049
+ });
1050
+ }
1051
+ var AxiosHeaders = class {
1052
+ constructor(headers) {
1053
+ headers && this.set(headers);
1054
+ }
1055
+ set(header, valueOrRewrite, rewrite) {
1056
+ const self2 = this;
1057
+ function setHeader(_value, _header, _rewrite) {
1058
+ const lHeader = normalizeHeader(_header);
1059
+ if (!lHeader) {
1060
+ throw new Error("header name must be a non-empty string");
1061
+ }
1062
+ const key = utils_default.findKey(self2, lHeader);
1063
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
1064
+ self2[key || _header] = normalizeValue(_value);
1065
+ }
1066
+ }
1067
+ const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1068
+ if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
1069
+ setHeaders(header, valueOrRewrite);
1070
+ } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1071
+ setHeaders(parseHeaders_default(header), valueOrRewrite);
1072
+ } else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
1073
+ let obj = {}, dest, key;
1074
+ for (const entry of header) {
1075
+ if (!utils_default.isArray(entry)) {
1076
+ throw TypeError("Object iterator must return a key-value pair");
1077
+ }
1078
+ obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
1079
+ }
1080
+ setHeaders(obj, valueOrRewrite);
1081
+ } else {
1082
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1083
+ }
1084
+ return this;
1085
+ }
1086
+ get(header, parser) {
1087
+ header = normalizeHeader(header);
1088
+ if (header) {
1089
+ const key = utils_default.findKey(this, header);
1090
+ if (key) {
1091
+ const value = this[key];
1092
+ if (!parser) {
1093
+ return value;
1094
+ }
1095
+ if (parser === true) {
1096
+ return parseTokens(value);
1097
+ }
1098
+ if (utils_default.isFunction(parser)) {
1099
+ return parser.call(this, value, key);
1100
+ }
1101
+ if (utils_default.isRegExp(parser)) {
1102
+ return parser.exec(value);
1103
+ }
1104
+ throw new TypeError("parser must be boolean|regexp|function");
1105
+ }
1106
+ }
1107
+ }
1108
+ has(header, matcher) {
1109
+ header = normalizeHeader(header);
1110
+ if (header) {
1111
+ const key = utils_default.findKey(this, header);
1112
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1113
+ }
1114
+ return false;
1115
+ }
1116
+ delete(header, matcher) {
1117
+ const self2 = this;
1118
+ let deleted = false;
1119
+ function deleteHeader(_header) {
1120
+ _header = normalizeHeader(_header);
1121
+ if (_header) {
1122
+ const key = utils_default.findKey(self2, _header);
1123
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
1124
+ delete self2[key];
1125
+ deleted = true;
1126
+ }
1127
+ }
1128
+ }
1129
+ if (utils_default.isArray(header)) {
1130
+ header.forEach(deleteHeader);
1131
+ } else {
1132
+ deleteHeader(header);
1133
+ }
1134
+ return deleted;
1135
+ }
1136
+ clear(matcher) {
1137
+ const keys = Object.keys(this);
1138
+ let i = keys.length;
1139
+ let deleted = false;
1140
+ while (i--) {
1141
+ const key = keys[i];
1142
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1143
+ delete this[key];
1144
+ deleted = true;
1145
+ }
1146
+ }
1147
+ return deleted;
1148
+ }
1149
+ normalize(format) {
1150
+ const self2 = this;
1151
+ const headers = {};
1152
+ utils_default.forEach(this, (value, header) => {
1153
+ const key = utils_default.findKey(headers, header);
1154
+ if (key) {
1155
+ self2[key] = normalizeValue(value);
1156
+ delete self2[header];
1157
+ return;
1158
+ }
1159
+ const normalized = format ? formatHeader(header) : String(header).trim();
1160
+ if (normalized !== header) {
1161
+ delete self2[header];
1162
+ }
1163
+ self2[normalized] = normalizeValue(value);
1164
+ headers[normalized] = true;
1165
+ });
1166
+ return this;
1167
+ }
1168
+ concat(...targets) {
1169
+ return this.constructor.concat(this, ...targets);
1170
+ }
1171
+ toJSON(asStrings) {
1172
+ const obj = /* @__PURE__ */ Object.create(null);
1173
+ utils_default.forEach(this, (value, header) => {
1174
+ value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
1175
+ });
1176
+ return obj;
1177
+ }
1178
+ [Symbol.iterator]() {
1179
+ return Object.entries(this.toJSON())[Symbol.iterator]();
1180
+ }
1181
+ toString() {
1182
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
1183
+ }
1184
+ getSetCookie() {
1185
+ return this.get("set-cookie") || [];
1186
+ }
1187
+ get [Symbol.toStringTag]() {
1188
+ return "AxiosHeaders";
1189
+ }
1190
+ static from(thing) {
1191
+ return thing instanceof this ? thing : new this(thing);
1192
+ }
1193
+ static concat(first, ...targets) {
1194
+ const computed = new this(first);
1195
+ targets.forEach((target) => computed.set(target));
1196
+ return computed;
1197
+ }
1198
+ static accessor(header) {
1199
+ const internals = this[$internals] = this[$internals] = {
1200
+ accessors: {}
1201
+ };
1202
+ const accessors = internals.accessors;
1203
+ const prototype3 = this.prototype;
1204
+ function defineAccessor(_header) {
1205
+ const lHeader = normalizeHeader(_header);
1206
+ if (!accessors[lHeader]) {
1207
+ buildAccessors(prototype3, _header);
1208
+ accessors[lHeader] = true;
1209
+ }
1210
+ }
1211
+ utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1212
+ return this;
1213
+ }
1214
+ };
1215
+ AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1216
+ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
1217
+ let mapped = key[0].toUpperCase() + key.slice(1);
1218
+ return {
1219
+ get: () => value,
1220
+ set(headerValue) {
1221
+ this[mapped] = headerValue;
1222
+ }
1223
+ };
1224
+ });
1225
+ utils_default.freezeMethods(AxiosHeaders);
1226
+ var AxiosHeaders_default = AxiosHeaders;
1227
+
1228
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/transformData.js
1229
+ function transformData(fns, response) {
1230
+ const config = this || defaults_default;
1231
+ const context = response || config;
1232
+ const headers = AxiosHeaders_default.from(context.headers);
1233
+ let data = context.data;
1234
+ utils_default.forEach(fns, function transform(fn) {
1235
+ data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
1236
+ });
1237
+ headers.normalize();
1238
+ return data;
1239
+ }
1240
+
1241
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/cancel/isCancel.js
1242
+ function isCancel(value) {
1243
+ return !!(value && value.__CANCEL__);
1244
+ }
1245
+
1246
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/cancel/CanceledError.js
1247
+ function CanceledError(message, config, request) {
1248
+ AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
1249
+ this.name = "CanceledError";
1250
+ }
1251
+ utils_default.inherits(CanceledError, AxiosError_default, {
1252
+ __CANCEL__: true
1253
+ });
1254
+ var CanceledError_default = CanceledError;
1255
+
1256
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/settle.js
1257
+ function settle(resolve, reject, response) {
1258
+ const validateStatus2 = response.config.validateStatus;
1259
+ if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1260
+ resolve(response);
1261
+ } else {
1262
+ reject(new AxiosError_default(
1263
+ "Request failed with status code " + response.status,
1264
+ [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1265
+ response.config,
1266
+ response.request,
1267
+ response
1268
+ ));
1269
+ }
1270
+ }
1271
+
1272
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/parseProtocol.js
1273
+ function parseProtocol(url) {
1274
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1275
+ return match && match[1] || "";
1276
+ }
1277
+
1278
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/speedometer.js
1279
+ function speedometer(samplesCount, min) {
1280
+ samplesCount = samplesCount || 10;
1281
+ const bytes = new Array(samplesCount);
1282
+ const timestamps = new Array(samplesCount);
1283
+ let head = 0;
1284
+ let tail = 0;
1285
+ let firstSampleTS;
1286
+ min = min !== void 0 ? min : 1e3;
1287
+ return function push(chunkLength) {
1288
+ const now = Date.now();
1289
+ const startedAt = timestamps[tail];
1290
+ if (!firstSampleTS) {
1291
+ firstSampleTS = now;
1292
+ }
1293
+ bytes[head] = chunkLength;
1294
+ timestamps[head] = now;
1295
+ let i = tail;
1296
+ let bytesCount = 0;
1297
+ while (i !== head) {
1298
+ bytesCount += bytes[i++];
1299
+ i = i % samplesCount;
1300
+ }
1301
+ head = (head + 1) % samplesCount;
1302
+ if (head === tail) {
1303
+ tail = (tail + 1) % samplesCount;
1304
+ }
1305
+ if (now - firstSampleTS < min) {
1306
+ return;
1307
+ }
1308
+ const passed = startedAt && now - startedAt;
1309
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
1310
+ };
1311
+ }
1312
+ var speedometer_default = speedometer;
1313
+
1314
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/throttle.js
1315
+ function throttle(fn, freq) {
1316
+ let timestamp = 0;
1317
+ let threshold = 1e3 / freq;
1318
+ let lastArgs;
1319
+ let timer;
1320
+ const invoke = (args, now = Date.now()) => {
1321
+ timestamp = now;
1322
+ lastArgs = null;
1323
+ if (timer) {
1324
+ clearTimeout(timer);
1325
+ timer = null;
1326
+ }
1327
+ fn(...args);
1328
+ };
1329
+ const throttled = (...args) => {
1330
+ const now = Date.now();
1331
+ const passed = now - timestamp;
1332
+ if (passed >= threshold) {
1333
+ invoke(args, now);
1334
+ } else {
1335
+ lastArgs = args;
1336
+ if (!timer) {
1337
+ timer = setTimeout(() => {
1338
+ timer = null;
1339
+ invoke(lastArgs);
1340
+ }, threshold - passed);
1341
+ }
1342
+ }
1343
+ };
1344
+ const flush = () => lastArgs && invoke(lastArgs);
1345
+ return [throttled, flush];
1346
+ }
1347
+ var throttle_default = throttle;
1348
+
1349
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/progressEventReducer.js
1350
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
1351
+ let bytesNotified = 0;
1352
+ const _speedometer = speedometer_default(50, 250);
1353
+ return throttle_default((e) => {
1354
+ const loaded = e.loaded;
1355
+ const total = e.lengthComputable ? e.total : void 0;
1356
+ const progressBytes = loaded - bytesNotified;
1357
+ const rate = _speedometer(progressBytes);
1358
+ const inRange = loaded <= total;
1359
+ bytesNotified = loaded;
1360
+ const data = {
1361
+ loaded,
1362
+ total,
1363
+ progress: total ? loaded / total : void 0,
1364
+ bytes: progressBytes,
1365
+ rate: rate ? rate : void 0,
1366
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1367
+ event: e,
1368
+ lengthComputable: total != null,
1369
+ [isDownloadStream ? "download" : "upload"]: true
1370
+ };
1371
+ listener(data);
1372
+ }, freq);
1373
+ };
1374
+ var progressEventDecorator = (total, throttled) => {
1375
+ const lengthComputable = total != null;
1376
+ return [(loaded) => throttled[0]({
1377
+ lengthComputable,
1378
+ total,
1379
+ loaded
1380
+ }), throttled[1]];
1381
+ };
1382
+ var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
1383
+
1384
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/isURLSameOrigin.js
1385
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
1386
+ url = new URL(url, platform_default.origin);
1387
+ return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
1388
+ })(
1389
+ new URL(platform_default.origin),
1390
+ platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
1391
+ ) : () => true;
1392
+
1393
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/cookies.js
1394
+ var cookies_default = platform_default.hasStandardBrowserEnv ? (
1395
+ // Standard browser envs support document.cookie
1396
+ {
1397
+ write(name, value, expires, path, domain, secure, sameSite) {
1398
+ if (typeof document === "undefined") return;
1399
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
1400
+ if (utils_default.isNumber(expires)) {
1401
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
1402
+ }
1403
+ if (utils_default.isString(path)) {
1404
+ cookie.push(`path=${path}`);
1405
+ }
1406
+ if (utils_default.isString(domain)) {
1407
+ cookie.push(`domain=${domain}`);
1408
+ }
1409
+ if (secure === true) {
1410
+ cookie.push("secure");
1411
+ }
1412
+ if (utils_default.isString(sameSite)) {
1413
+ cookie.push(`SameSite=${sameSite}`);
1414
+ }
1415
+ document.cookie = cookie.join("; ");
1416
+ },
1417
+ read(name) {
1418
+ if (typeof document === "undefined") return null;
1419
+ const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
1420
+ return match ? decodeURIComponent(match[1]) : null;
1421
+ },
1422
+ remove(name) {
1423
+ this.write(name, "", Date.now() - 864e5, "/");
1424
+ }
1425
+ }
1426
+ ) : (
1427
+ // Non-standard browser env (web workers, react-native) lack needed support.
1428
+ {
1429
+ write() {
1430
+ },
1431
+ read() {
1432
+ return null;
1433
+ },
1434
+ remove() {
1435
+ }
1436
+ }
1437
+ );
1438
+
1439
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/isAbsoluteURL.js
1440
+ function isAbsoluteURL(url) {
1441
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1442
+ }
1443
+
1444
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/combineURLs.js
1445
+ function combineURLs(baseURL, relativeURL) {
1446
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1447
+ }
1448
+
1449
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/buildFullPath.js
1450
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
1451
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
1452
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
1453
+ return combineURLs(baseURL, requestedURL);
1454
+ }
1455
+ return requestedURL;
1456
+ }
1457
+
1458
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/mergeConfig.js
1459
+ var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
1460
+ function mergeConfig(config1, config2) {
1461
+ config2 = config2 || {};
1462
+ const config = {};
1463
+ function getMergedValue(target, source, prop, caseless) {
1464
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
1465
+ return utils_default.merge.call({ caseless }, target, source);
1466
+ } else if (utils_default.isPlainObject(source)) {
1467
+ return utils_default.merge({}, source);
1468
+ } else if (utils_default.isArray(source)) {
1469
+ return source.slice();
1470
+ }
1471
+ return source;
1472
+ }
1473
+ function mergeDeepProperties(a, b, prop, caseless) {
1474
+ if (!utils_default.isUndefined(b)) {
1475
+ return getMergedValue(a, b, prop, caseless);
1476
+ } else if (!utils_default.isUndefined(a)) {
1477
+ return getMergedValue(void 0, a, prop, caseless);
1478
+ }
1479
+ }
1480
+ function valueFromConfig2(a, b) {
1481
+ if (!utils_default.isUndefined(b)) {
1482
+ return getMergedValue(void 0, b);
1483
+ }
1484
+ }
1485
+ function defaultToConfig2(a, b) {
1486
+ if (!utils_default.isUndefined(b)) {
1487
+ return getMergedValue(void 0, b);
1488
+ } else if (!utils_default.isUndefined(a)) {
1489
+ return getMergedValue(void 0, a);
1490
+ }
1491
+ }
1492
+ function mergeDirectKeys(a, b, prop) {
1493
+ if (prop in config2) {
1494
+ return getMergedValue(a, b);
1495
+ } else if (prop in config1) {
1496
+ return getMergedValue(void 0, a);
1497
+ }
1498
+ }
1499
+ const mergeMap = {
1500
+ url: valueFromConfig2,
1501
+ method: valueFromConfig2,
1502
+ data: valueFromConfig2,
1503
+ baseURL: defaultToConfig2,
1504
+ transformRequest: defaultToConfig2,
1505
+ transformResponse: defaultToConfig2,
1506
+ paramsSerializer: defaultToConfig2,
1507
+ timeout: defaultToConfig2,
1508
+ timeoutMessage: defaultToConfig2,
1509
+ withCredentials: defaultToConfig2,
1510
+ withXSRFToken: defaultToConfig2,
1511
+ adapter: defaultToConfig2,
1512
+ responseType: defaultToConfig2,
1513
+ xsrfCookieName: defaultToConfig2,
1514
+ xsrfHeaderName: defaultToConfig2,
1515
+ onUploadProgress: defaultToConfig2,
1516
+ onDownloadProgress: defaultToConfig2,
1517
+ decompress: defaultToConfig2,
1518
+ maxContentLength: defaultToConfig2,
1519
+ maxBodyLength: defaultToConfig2,
1520
+ beforeRedirect: defaultToConfig2,
1521
+ transport: defaultToConfig2,
1522
+ httpAgent: defaultToConfig2,
1523
+ httpsAgent: defaultToConfig2,
1524
+ cancelToken: defaultToConfig2,
1525
+ socketPath: defaultToConfig2,
1526
+ responseEncoding: defaultToConfig2,
1527
+ validateStatus: mergeDirectKeys,
1528
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
1529
+ };
1530
+ utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
1531
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
1532
+ const configValue = merge2(config1[prop], config2[prop], prop);
1533
+ utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
1534
+ });
1535
+ return config;
1536
+ }
1537
+
1538
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/resolveConfig.js
1539
+ var resolveConfig_default = (config) => {
1540
+ const newConfig = mergeConfig({}, config);
1541
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
1542
+ newConfig.headers = headers = AxiosHeaders_default.from(headers);
1543
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
1544
+ if (auth) {
1545
+ headers.set(
1546
+ "Authorization",
1547
+ "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
1548
+ );
1549
+ }
1550
+ if (utils_default.isFormData(data)) {
1551
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
1552
+ headers.setContentType(void 0);
1553
+ } else if (utils_default.isFunction(data.getHeaders)) {
1554
+ const formHeaders = data.getHeaders();
1555
+ const allowedHeaders = ["content-type", "content-length"];
1556
+ Object.entries(formHeaders).forEach(([key, val]) => {
1557
+ if (allowedHeaders.includes(key.toLowerCase())) {
1558
+ headers.set(key, val);
1559
+ }
1560
+ });
1561
+ }
1562
+ }
1563
+ if (platform_default.hasStandardBrowserEnv) {
1564
+ withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
1565
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
1566
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
1567
+ if (xsrfValue) {
1568
+ headers.set(xsrfHeaderName, xsrfValue);
1569
+ }
1570
+ }
1571
+ }
1572
+ return newConfig;
1573
+ };
1574
+
1575
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/adapters/xhr.js
1576
+ var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1577
+ var xhr_default = isXHRAdapterSupported && function (config) {
1578
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
1579
+ const _config = resolveConfig_default(config);
1580
+ let requestData = _config.data;
1581
+ const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
1582
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
1583
+ let onCanceled;
1584
+ let uploadThrottled, downloadThrottled;
1585
+ let flushUpload, flushDownload;
1586
+ function done() {
1587
+ flushUpload && flushUpload();
1588
+ flushDownload && flushDownload();
1589
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
1590
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
1591
+ }
1592
+ let request = new XMLHttpRequest();
1593
+ request.open(_config.method.toUpperCase(), _config.url, true);
1594
+ request.timeout = _config.timeout;
1595
+ function onloadend() {
1596
+ if (!request) {
1597
+ return;
1598
+ }
1599
+ const responseHeaders = AxiosHeaders_default.from(
1600
+ "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1601
+ );
1602
+ const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1603
+ const response = {
1604
+ data: responseData,
1605
+ status: request.status,
1606
+ statusText: request.statusText,
1607
+ headers: responseHeaders,
1608
+ config,
1609
+ request
1610
+ };
1611
+ settle(function _resolve(value) {
1612
+ resolve(value);
1613
+ done();
1614
+ }, function _reject(err) {
1615
+ reject(err);
1616
+ done();
1617
+ }, response);
1618
+ request = null;
1619
+ }
1620
+ if ("onloadend" in request) {
1621
+ request.onloadend = onloadend;
1622
+ } else {
1623
+ request.onreadystatechange = function handleLoad() {
1624
+ if (!request || request.readyState !== 4) {
1625
+ return;
1626
+ }
1627
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
1628
+ return;
1629
+ }
1630
+ setTimeout(onloadend);
1631
+ };
1632
+ }
1633
+ request.onabort = function handleAbort() {
1634
+ if (!request) {
1635
+ return;
1636
+ }
1637
+ reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
1638
+ request = null;
1639
+ };
1640
+ request.onerror = function handleError(event) {
1641
+ const msg = event && event.message ? event.message : "Network Error";
1642
+ const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request);
1643
+ err.event = event || null;
1644
+ reject(err);
1645
+ request = null;
1646
+ };
1647
+ request.ontimeout = function handleTimeout() {
1648
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
1649
+ const transitional2 = _config.transitional || transitional_default;
1650
+ if (_config.timeoutErrorMessage) {
1651
+ timeoutErrorMessage = _config.timeoutErrorMessage;
1652
+ }
1653
+ reject(new AxiosError_default(
1654
+ timeoutErrorMessage,
1655
+ transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
1656
+ config,
1657
+ request
1658
+ ));
1659
+ request = null;
1660
+ };
1661
+ requestData === void 0 && requestHeaders.setContentType(null);
1662
+ if ("setRequestHeader" in request) {
1663
+ utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1664
+ request.setRequestHeader(key, val);
1665
+ });
1666
+ }
1667
+ if (!utils_default.isUndefined(_config.withCredentials)) {
1668
+ request.withCredentials = !!_config.withCredentials;
1669
+ }
1670
+ if (responseType && responseType !== "json") {
1671
+ request.responseType = _config.responseType;
1672
+ }
1673
+ if (onDownloadProgress) {
1674
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
1675
+ request.addEventListener("progress", downloadThrottled);
1676
+ }
1677
+ if (onUploadProgress && request.upload) {
1678
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
1679
+ request.upload.addEventListener("progress", uploadThrottled);
1680
+ request.upload.addEventListener("loadend", flushUpload);
1681
+ }
1682
+ if (_config.cancelToken || _config.signal) {
1683
+ onCanceled = (cancel) => {
1684
+ if (!request) {
1685
+ return;
1686
+ }
1687
+ reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
1688
+ request.abort();
1689
+ request = null;
1690
+ };
1691
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
1692
+ if (_config.signal) {
1693
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
1694
+ }
1695
+ }
1696
+ const protocol = parseProtocol(_config.url);
1697
+ if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
1698
+ reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
1699
+ return;
1700
+ }
1701
+ request.send(requestData || null);
1702
+ });
1703
+ };
1704
+
1705
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/composeSignals.js
1706
+ var composeSignals = (signals, timeout) => {
1707
+ const { length } = signals = signals ? signals.filter(Boolean) : [];
1708
+ if (timeout || length) {
1709
+ let controller = new AbortController();
1710
+ let aborted;
1711
+ const onabort = function (reason) {
1712
+ if (!aborted) {
1713
+ aborted = true;
1714
+ unsubscribe();
1715
+ const err = reason instanceof Error ? reason : this.reason;
1716
+ controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
1717
+ }
1718
+ };
1719
+ let timer = timeout && setTimeout(() => {
1720
+ timer = null;
1721
+ onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
1722
+ }, timeout);
1723
+ const unsubscribe = () => {
1724
+ if (signals) {
1725
+ timer && clearTimeout(timer);
1726
+ timer = null;
1727
+ signals.forEach((signal2) => {
1728
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
1729
+ });
1730
+ signals = null;
1731
+ }
1732
+ };
1733
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
1734
+ const { signal } = controller;
1735
+ signal.unsubscribe = () => utils_default.asap(unsubscribe);
1736
+ return signal;
1737
+ }
1738
+ };
1739
+ var composeSignals_default = composeSignals;
1740
+
1741
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/trackStream.js
1742
+ var streamChunk = function* (chunk, chunkSize) {
1743
+ let len = chunk.byteLength;
1744
+ if (!chunkSize || len < chunkSize) {
1745
+ yield chunk;
1746
+ return;
1747
+ }
1748
+ let pos = 0;
1749
+ let end;
1750
+ while (pos < len) {
1751
+ end = pos + chunkSize;
1752
+ yield chunk.slice(pos, end);
1753
+ pos = end;
1754
+ }
1755
+ };
1756
+ var readBytes = async function* (iterable, chunkSize) {
1757
+ for await (const chunk of readStream(iterable)) {
1758
+ yield* streamChunk(chunk, chunkSize);
1759
+ }
1760
+ };
1761
+ var readStream = async function* (stream) {
1762
+ if (stream[Symbol.asyncIterator]) {
1763
+ yield* stream;
1764
+ return;
1765
+ }
1766
+ const reader = stream.getReader();
1767
+ try {
1768
+ for (; ;) {
1769
+ const { done, value } = await reader.read();
1770
+ if (done) {
1771
+ break;
1772
+ }
1773
+ yield value;
1774
+ }
1775
+ } finally {
1776
+ await reader.cancel();
1777
+ }
1778
+ };
1779
+ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
1780
+ const iterator2 = readBytes(stream, chunkSize);
1781
+ let bytes = 0;
1782
+ let done;
1783
+ let _onFinish = (e) => {
1784
+ if (!done) {
1785
+ done = true;
1786
+ onFinish && onFinish(e);
1787
+ }
1788
+ };
1789
+ return new ReadableStream({
1790
+ async pull(controller) {
1791
+ try {
1792
+ const { done: done2, value } = await iterator2.next();
1793
+ if (done2) {
1794
+ _onFinish();
1795
+ controller.close();
1796
+ return;
1797
+ }
1798
+ let len = value.byteLength;
1799
+ if (onProgress) {
1800
+ let loadedBytes = bytes += len;
1801
+ onProgress(loadedBytes);
1802
+ }
1803
+ controller.enqueue(new Uint8Array(value));
1804
+ } catch (err) {
1805
+ _onFinish(err);
1806
+ throw err;
1807
+ }
1808
+ },
1809
+ cancel(reason) {
1810
+ _onFinish(reason);
1811
+ return iterator2.return();
1812
+ }
1813
+ }, {
1814
+ highWaterMark: 2
1815
+ });
1816
+ };
1817
+
1818
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/adapters/fetch.js
1819
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
1820
+ var { isFunction: isFunction2 } = utils_default;
1821
+ var globalFetchAPI = (({ Request, Response }) => ({
1822
+ Request,
1823
+ Response
1824
+ }))(utils_default.global);
1825
+ var {
1826
+ ReadableStream: ReadableStream2,
1827
+ TextEncoder
1828
+ } = utils_default.global;
1829
+ var test = (fn, ...args) => {
1830
+ try {
1831
+ return !!fn(...args);
1832
+ } catch (e) {
1833
+ return false;
1834
+ }
1835
+ };
1836
+ var factory = (env) => {
1837
+ env = utils_default.merge.call({
1838
+ skipUndefined: true
1839
+ }, globalFetchAPI, env);
1840
+ const { fetch: envFetch, Request, Response } = env;
1841
+ const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
1842
+ const isRequestSupported = isFunction2(Request);
1843
+ const isResponseSupported = isFunction2(Response);
1844
+ if (!isFetchSupported) {
1845
+ return false;
1846
+ }
1847
+ const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
1848
+ const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
1849
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
1850
+ let duplexAccessed = false;
1851
+ const hasContentType = new Request(platform_default.origin, {
1852
+ body: new ReadableStream2(),
1853
+ method: "POST",
1854
+ get duplex() {
1855
+ duplexAccessed = true;
1856
+ return "half";
1857
+ }
1858
+ }).headers.has("Content-Type");
1859
+ return duplexAccessed && !hasContentType;
1860
+ });
1861
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
1862
+ const resolvers = {
1863
+ stream: supportsResponseStream && ((res) => res.body)
1864
+ };
1865
+ isFetchSupported && (() => {
1866
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
1867
+ !resolvers[type] && (resolvers[type] = (res, config) => {
1868
+ let method = res && res[type];
1869
+ if (method) {
1870
+ return method.call(res);
1871
+ }
1872
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
1873
+ });
1874
+ });
1875
+ })();
1876
+ const getBodyLength = async (body) => {
1877
+ if (body == null) {
1878
+ return 0;
1879
+ }
1880
+ if (utils_default.isBlob(body)) {
1881
+ return body.size;
1882
+ }
1883
+ if (utils_default.isSpecCompliantForm(body)) {
1884
+ const _request = new Request(platform_default.origin, {
1885
+ method: "POST",
1886
+ body
1887
+ });
1888
+ return (await _request.arrayBuffer()).byteLength;
1889
+ }
1890
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
1891
+ return body.byteLength;
1892
+ }
1893
+ if (utils_default.isURLSearchParams(body)) {
1894
+ body = body + "";
1895
+ }
1896
+ if (utils_default.isString(body)) {
1897
+ return (await encodeText(body)).byteLength;
1898
+ }
1899
+ };
1900
+ const resolveBodyLength = async (headers, body) => {
1901
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
1902
+ return length == null ? getBodyLength(body) : length;
1903
+ };
1904
+ return async (config) => {
1905
+ let {
1906
+ url,
1907
+ method,
1908
+ data,
1909
+ signal,
1910
+ cancelToken,
1911
+ timeout,
1912
+ onDownloadProgress,
1913
+ onUploadProgress,
1914
+ responseType,
1915
+ headers,
1916
+ withCredentials = "same-origin",
1917
+ fetchOptions
1918
+ } = resolveConfig_default(config);
1919
+ let _fetch = envFetch || fetch;
1920
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
1921
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
1922
+ let request = null;
1923
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
1924
+ composedSignal.unsubscribe();
1925
+ });
1926
+ let requestContentLength;
1927
+ try {
1928
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
1929
+ let _request = new Request(url, {
1930
+ method: "POST",
1931
+ body: data,
1932
+ duplex: "half"
1933
+ });
1934
+ let contentTypeHeader;
1935
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
1936
+ headers.setContentType(contentTypeHeader);
1937
+ }
1938
+ if (_request.body) {
1939
+ const [onProgress, flush] = progressEventDecorator(
1940
+ requestContentLength,
1941
+ progressEventReducer(asyncDecorator(onUploadProgress))
1942
+ );
1943
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
1944
+ }
1945
+ }
1946
+ if (!utils_default.isString(withCredentials)) {
1947
+ withCredentials = withCredentials ? "include" : "omit";
1948
+ }
1949
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
1950
+ const resolvedOptions = {
1951
+ ...fetchOptions,
1952
+ signal: composedSignal,
1953
+ method: method.toUpperCase(),
1954
+ headers: headers.normalize().toJSON(),
1955
+ body: data,
1956
+ duplex: "half",
1957
+ credentials: isCredentialsSupported ? withCredentials : void 0
1958
+ };
1959
+ request = isRequestSupported && new Request(url, resolvedOptions);
1960
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
1961
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
1962
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
1963
+ const options = {};
1964
+ ["status", "statusText", "headers"].forEach((prop) => {
1965
+ options[prop] = response[prop];
1966
+ });
1967
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
1968
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
1969
+ responseContentLength,
1970
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
1971
+ ) || [];
1972
+ response = new Response(
1973
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
1974
+ flush && flush();
1975
+ unsubscribe && unsubscribe();
1976
+ }),
1977
+ options
1978
+ );
1979
+ }
1980
+ responseType = responseType || "text";
1981
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
1982
+ !isStreamResponse && unsubscribe && unsubscribe();
1983
+ return await new Promise((resolve, reject) => {
1984
+ settle(resolve, reject, {
1985
+ data: responseData,
1986
+ headers: AxiosHeaders_default.from(response.headers),
1987
+ status: response.status,
1988
+ statusText: response.statusText,
1989
+ config,
1990
+ request
1991
+ });
1992
+ });
1993
+ } catch (err) {
1994
+ unsubscribe && unsubscribe();
1995
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
1996
+ throw Object.assign(
1997
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
1998
+ {
1999
+ cause: err.cause || err
2000
+ }
2001
+ );
2002
+ }
2003
+ throw AxiosError_default.from(err, err && err.code, config, request);
2004
+ }
2005
+ };
2006
+ };
2007
+ var seedCache = /* @__PURE__ */ new Map();
2008
+ var getFetch = (config) => {
2009
+ let env = config && config.env || {};
2010
+ const { fetch: fetch2, Request, Response } = env;
2011
+ const seeds = [
2012
+ Request,
2013
+ Response,
2014
+ fetch2
2015
+ ];
2016
+ let len = seeds.length, i = len, seed, target, map = seedCache;
2017
+ while (i--) {
2018
+ seed = seeds[i];
2019
+ target = map.get(seed);
2020
+ target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
2021
+ map = target;
2022
+ }
2023
+ return target;
2024
+ };
2025
+ var adapter = getFetch();
2026
+
2027
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/adapters/adapters.js
2028
+ var knownAdapters = {
2029
+ http: null_default,
2030
+ xhr: xhr_default,
2031
+ fetch: {
2032
+ get: getFetch
2033
+ }
2034
+ };
2035
+ utils_default.forEach(knownAdapters, (fn, value) => {
2036
+ if (fn) {
2037
+ try {
2038
+ Object.defineProperty(fn, "name", { value });
2039
+ } catch (e) {
2040
+ }
2041
+ Object.defineProperty(fn, "adapterName", { value });
2042
+ }
2043
+ });
2044
+ var renderReason = (reason) => `- ${reason}`;
2045
+ var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
2046
+ function getAdapter(adapters, config) {
2047
+ adapters = utils_default.isArray(adapters) ? adapters : [adapters];
2048
+ const { length } = adapters;
2049
+ let nameOrAdapter;
2050
+ let adapter2;
2051
+ const rejectedReasons = {};
2052
+ for (let i = 0; i < length; i++) {
2053
+ nameOrAdapter = adapters[i];
2054
+ let id;
2055
+ adapter2 = nameOrAdapter;
2056
+ if (!isResolvedHandle(nameOrAdapter)) {
2057
+ adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
2058
+ if (adapter2 === void 0) {
2059
+ throw new AxiosError_default(`Unknown adapter '${id}'`);
2060
+ }
2061
+ }
2062
+ if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
2063
+ break;
2064
+ }
2065
+ rejectedReasons[id || "#" + i] = adapter2;
2066
+ }
2067
+ if (!adapter2) {
2068
+ const reasons = Object.entries(rejectedReasons).map(
2069
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
2070
+ );
2071
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
2072
+ throw new AxiosError_default(
2073
+ `There is no suitable adapter to dispatch the request ` + s,
2074
+ "ERR_NOT_SUPPORT"
2075
+ );
2076
+ }
2077
+ return adapter2;
2078
+ }
2079
+ var adapters_default = {
2080
+ /**
2081
+ * Resolve an adapter from a list of adapter names or functions.
2082
+ * @type {Function}
2083
+ */
2084
+ getAdapter,
2085
+ /**
2086
+ * Exposes all known adapters
2087
+ * @type {Object<string, Function|Object>}
2088
+ */
2089
+ adapters: knownAdapters
2090
+ };
2091
+
2092
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/dispatchRequest.js
2093
+ function throwIfCancellationRequested(config) {
2094
+ if (config.cancelToken) {
2095
+ config.cancelToken.throwIfRequested();
2096
+ }
2097
+ if (config.signal && config.signal.aborted) {
2098
+ throw new CanceledError_default(null, config);
2099
+ }
2100
+ }
2101
+ function dispatchRequest(config) {
2102
+ throwIfCancellationRequested(config);
2103
+ config.headers = AxiosHeaders_default.from(config.headers);
2104
+ config.data = transformData.call(
2105
+ config,
2106
+ config.transformRequest
2107
+ );
2108
+ if (["post", "put", "patch"].indexOf(config.method) !== -1) {
2109
+ config.headers.setContentType("application/x-www-form-urlencoded", false);
2110
+ }
2111
+ const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
2112
+ return adapter2(config).then(function onAdapterResolution(response) {
2113
+ throwIfCancellationRequested(config);
2114
+ response.data = transformData.call(
2115
+ config,
2116
+ config.transformResponse,
2117
+ response
2118
+ );
2119
+ response.headers = AxiosHeaders_default.from(response.headers);
2120
+ return response;
2121
+ }, function onAdapterRejection(reason) {
2122
+ if (!isCancel(reason)) {
2123
+ throwIfCancellationRequested(config);
2124
+ if (reason && reason.response) {
2125
+ reason.response.data = transformData.call(
2126
+ config,
2127
+ config.transformResponse,
2128
+ reason.response
2129
+ );
2130
+ reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
2131
+ }
2132
+ }
2133
+ return Promise.reject(reason);
2134
+ });
2135
+ }
2136
+
2137
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/env/data.js
2138
+ var VERSION = "1.13.2";
2139
+
2140
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/validator.js
2141
+ var validators = {};
2142
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
2143
+ validators[type] = function validator(thing) {
2144
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
2145
+ };
2146
+ });
2147
+ var deprecatedWarnings = {};
2148
+ validators.transitional = function transitional(validator, version, message) {
2149
+ function formatMessage(opt, desc) {
2150
+ return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
2151
+ }
2152
+ return (value, opt, opts) => {
2153
+ if (validator === false) {
2154
+ throw new AxiosError_default(
2155
+ formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
2156
+ AxiosError_default.ERR_DEPRECATED
2157
+ );
2158
+ }
2159
+ if (version && !deprecatedWarnings[opt]) {
2160
+ deprecatedWarnings[opt] = true;
2161
+ console.warn(
2162
+ formatMessage(
2163
+ opt,
2164
+ " has been deprecated since v" + version + " and will be removed in the near future"
2165
+ )
2166
+ );
2167
+ }
2168
+ return validator ? validator(value, opt, opts) : true;
2169
+ };
2170
+ };
2171
+ validators.spelling = function spelling(correctSpelling) {
2172
+ return (value, opt) => {
2173
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
2174
+ return true;
2175
+ };
2176
+ };
2177
+ function assertOptions(options, schema, allowUnknown) {
2178
+ if (typeof options !== "object") {
2179
+ throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
2180
+ }
2181
+ const keys = Object.keys(options);
2182
+ let i = keys.length;
2183
+ while (i-- > 0) {
2184
+ const opt = keys[i];
2185
+ const validator = schema[opt];
2186
+ if (validator) {
2187
+ const value = options[opt];
2188
+ const result = value === void 0 || validator(value, opt, options);
2189
+ if (result !== true) {
2190
+ throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
2191
+ }
2192
+ continue;
2193
+ }
2194
+ if (allowUnknown !== true) {
2195
+ throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
2196
+ }
2197
+ }
2198
+ }
2199
+ var validator_default = {
2200
+ assertOptions,
2201
+ validators
2202
+ };
2203
+
2204
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/core/Axios.js
2205
+ var validators2 = validator_default.validators;
2206
+ var Axios = class {
2207
+ constructor(instanceConfig) {
2208
+ this.defaults = instanceConfig || {};
2209
+ this.interceptors = {
2210
+ request: new InterceptorManager_default(),
2211
+ response: new InterceptorManager_default()
2212
+ };
2213
+ }
2214
+ /**
2215
+ * Dispatch a request
2216
+ *
2217
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2218
+ * @param {?Object} config
2219
+ *
2220
+ * @returns {Promise} The Promise to be fulfilled
2221
+ */
2222
+ async request(configOrUrl, config) {
2223
+ try {
2224
+ return await this._request(configOrUrl, config);
2225
+ } catch (err) {
2226
+ if (err instanceof Error) {
2227
+ let dummy = {};
2228
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
2229
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
2230
+ try {
2231
+ if (!err.stack) {
2232
+ err.stack = stack;
2233
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
2234
+ err.stack += "\n" + stack;
2235
+ }
2236
+ } catch (e) {
2237
+ }
2238
+ }
2239
+ throw err;
2240
+ }
2241
+ }
2242
+ _request(configOrUrl, config) {
2243
+ if (typeof configOrUrl === "string") {
2244
+ config = config || {};
2245
+ config.url = configOrUrl;
2246
+ } else {
2247
+ config = configOrUrl || {};
2248
+ }
2249
+ config = mergeConfig(this.defaults, config);
2250
+ const { transitional: transitional2, paramsSerializer, headers } = config;
2251
+ if (transitional2 !== void 0) {
2252
+ validator_default.assertOptions(transitional2, {
2253
+ silentJSONParsing: validators2.transitional(validators2.boolean),
2254
+ forcedJSONParsing: validators2.transitional(validators2.boolean),
2255
+ clarifyTimeoutError: validators2.transitional(validators2.boolean)
2256
+ }, false);
2257
+ }
2258
+ if (paramsSerializer != null) {
2259
+ if (utils_default.isFunction(paramsSerializer)) {
2260
+ config.paramsSerializer = {
2261
+ serialize: paramsSerializer
2262
+ };
2263
+ } else {
2264
+ validator_default.assertOptions(paramsSerializer, {
2265
+ encode: validators2.function,
2266
+ serialize: validators2.function
2267
+ }, true);
2268
+ }
2269
+ }
2270
+ if (config.allowAbsoluteUrls !== void 0) {
2271
+ } else if (this.defaults.allowAbsoluteUrls !== void 0) {
2272
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
2273
+ } else {
2274
+ config.allowAbsoluteUrls = true;
2275
+ }
2276
+ validator_default.assertOptions(config, {
2277
+ baseUrl: validators2.spelling("baseURL"),
2278
+ withXsrfToken: validators2.spelling("withXSRFToken")
2279
+ }, true);
2280
+ config.method = (config.method || this.defaults.method || "get").toLowerCase();
2281
+ let contextHeaders = headers && utils_default.merge(
2282
+ headers.common,
2283
+ headers[config.method]
2284
+ );
2285
+ headers && utils_default.forEach(
2286
+ ["delete", "get", "head", "post", "put", "patch", "common"],
2287
+ (method) => {
2288
+ delete headers[method];
2289
+ }
2290
+ );
2291
+ config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
2292
+ const requestInterceptorChain = [];
2293
+ let synchronousRequestInterceptors = true;
2294
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2295
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
2296
+ return;
2297
+ }
2298
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2299
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2300
+ });
2301
+ const responseInterceptorChain = [];
2302
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2303
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2304
+ });
2305
+ let promise;
2306
+ let i = 0;
2307
+ let len;
2308
+ if (!synchronousRequestInterceptors) {
2309
+ const chain = [dispatchRequest.bind(this), void 0];
2310
+ chain.unshift(...requestInterceptorChain);
2311
+ chain.push(...responseInterceptorChain);
2312
+ len = chain.length;
2313
+ promise = Promise.resolve(config);
2314
+ while (i < len) {
2315
+ promise = promise.then(chain[i++], chain[i++]);
2316
+ }
2317
+ return promise;
2318
+ }
2319
+ len = requestInterceptorChain.length;
2320
+ let newConfig = config;
2321
+ while (i < len) {
2322
+ const onFulfilled = requestInterceptorChain[i++];
2323
+ const onRejected = requestInterceptorChain[i++];
2324
+ try {
2325
+ newConfig = onFulfilled(newConfig);
2326
+ } catch (error) {
2327
+ onRejected.call(this, error);
2328
+ break;
2329
+ }
2330
+ }
2331
+ try {
2332
+ promise = dispatchRequest.call(this, newConfig);
2333
+ } catch (error) {
2334
+ return Promise.reject(error);
2335
+ }
2336
+ i = 0;
2337
+ len = responseInterceptorChain.length;
2338
+ while (i < len) {
2339
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
2340
+ }
2341
+ return promise;
2342
+ }
2343
+ getUri(config) {
2344
+ config = mergeConfig(this.defaults, config);
2345
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
2346
+ return buildURL(fullPath, config.params, config.paramsSerializer);
2347
+ }
2348
+ };
2349
+ utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
2350
+ Axios.prototype[method] = function (url, config) {
2351
+ return this.request(mergeConfig(config || {}, {
2352
+ method,
2353
+ url,
2354
+ data: (config || {}).data
2355
+ }));
2356
+ };
2357
+ });
2358
+ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
2359
+ function generateHTTPMethod(isForm) {
2360
+ return function httpMethod(url, data, config) {
2361
+ return this.request(mergeConfig(config || {}, {
2362
+ method,
2363
+ headers: isForm ? {
2364
+ "Content-Type": "multipart/form-data"
2365
+ } : {},
2366
+ url,
2367
+ data
2368
+ }));
2369
+ };
2370
+ }
2371
+ Axios.prototype[method] = generateHTTPMethod();
2372
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
2373
+ });
2374
+ var Axios_default = Axios;
2375
+
2376
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/cancel/CancelToken.js
2377
+ var CancelToken = class _CancelToken {
2378
+ constructor(executor) {
2379
+ if (typeof executor !== "function") {
2380
+ throw new TypeError("executor must be a function.");
2381
+ }
2382
+ let resolvePromise;
2383
+ this.promise = new Promise(function promiseExecutor(resolve) {
2384
+ resolvePromise = resolve;
2385
+ });
2386
+ const token = this;
2387
+ this.promise.then((cancel) => {
2388
+ if (!token._listeners) return;
2389
+ let i = token._listeners.length;
2390
+ while (i-- > 0) {
2391
+ token._listeners[i](cancel);
2392
+ }
2393
+ token._listeners = null;
2394
+ });
2395
+ this.promise.then = (onfulfilled) => {
2396
+ let _resolve;
2397
+ const promise = new Promise((resolve) => {
2398
+ token.subscribe(resolve);
2399
+ _resolve = resolve;
2400
+ }).then(onfulfilled);
2401
+ promise.cancel = function reject() {
2402
+ token.unsubscribe(_resolve);
2403
+ };
2404
+ return promise;
2405
+ };
2406
+ executor(function cancel(message, config, request) {
2407
+ if (token.reason) {
2408
+ return;
2409
+ }
2410
+ token.reason = new CanceledError_default(message, config, request);
2411
+ resolvePromise(token.reason);
2412
+ });
2413
+ }
2414
+ /**
2415
+ * Throws a `CanceledError` if cancellation has been requested.
2416
+ */
2417
+ throwIfRequested() {
2418
+ if (this.reason) {
2419
+ throw this.reason;
2420
+ }
2421
+ }
2422
+ /**
2423
+ * Subscribe to the cancel signal
2424
+ */
2425
+ subscribe(listener) {
2426
+ if (this.reason) {
2427
+ listener(this.reason);
2428
+ return;
2429
+ }
2430
+ if (this._listeners) {
2431
+ this._listeners.push(listener);
2432
+ } else {
2433
+ this._listeners = [listener];
2434
+ }
2435
+ }
2436
+ /**
2437
+ * Unsubscribe from the cancel signal
2438
+ */
2439
+ unsubscribe(listener) {
2440
+ if (!this._listeners) {
2441
+ return;
2442
+ }
2443
+ const index = this._listeners.indexOf(listener);
2444
+ if (index !== -1) {
2445
+ this._listeners.splice(index, 1);
2446
+ }
2447
+ }
2448
+ toAbortSignal() {
2449
+ const controller = new AbortController();
2450
+ const abort = (err) => {
2451
+ controller.abort(err);
2452
+ };
2453
+ this.subscribe(abort);
2454
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
2455
+ return controller.signal;
2456
+ }
2457
+ /**
2458
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
2459
+ * cancels the `CancelToken`.
2460
+ */
2461
+ static source() {
2462
+ let cancel;
2463
+ const token = new _CancelToken(function executor(c) {
2464
+ cancel = c;
2465
+ });
2466
+ return {
2467
+ token,
2468
+ cancel
2469
+ };
2470
+ }
2471
+ };
2472
+ var CancelToken_default = CancelToken;
2473
+
2474
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/spread.js
2475
+ function spread(callback) {
2476
+ return function wrap(arr) {
2477
+ return callback.apply(null, arr);
2478
+ };
2479
+ }
2480
+
2481
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/isAxiosError.js
2482
+ function isAxiosError(payload) {
2483
+ return utils_default.isObject(payload) && payload.isAxiosError === true;
2484
+ }
2485
+
2486
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/helpers/HttpStatusCode.js
2487
+ var HttpStatusCode = {
2488
+ Continue: 100,
2489
+ SwitchingProtocols: 101,
2490
+ Processing: 102,
2491
+ EarlyHints: 103,
2492
+ Ok: 200,
2493
+ Created: 201,
2494
+ Accepted: 202,
2495
+ NonAuthoritativeInformation: 203,
2496
+ NoContent: 204,
2497
+ ResetContent: 205,
2498
+ PartialContent: 206,
2499
+ MultiStatus: 207,
2500
+ AlreadyReported: 208,
2501
+ ImUsed: 226,
2502
+ MultipleChoices: 300,
2503
+ MovedPermanently: 301,
2504
+ Found: 302,
2505
+ SeeOther: 303,
2506
+ NotModified: 304,
2507
+ UseProxy: 305,
2508
+ Unused: 306,
2509
+ TemporaryRedirect: 307,
2510
+ PermanentRedirect: 308,
2511
+ BadRequest: 400,
2512
+ Unauthorized: 401,
2513
+ PaymentRequired: 402,
2514
+ Forbidden: 403,
2515
+ NotFound: 404,
2516
+ MethodNotAllowed: 405,
2517
+ NotAcceptable: 406,
2518
+ ProxyAuthenticationRequired: 407,
2519
+ RequestTimeout: 408,
2520
+ Conflict: 409,
2521
+ Gone: 410,
2522
+ LengthRequired: 411,
2523
+ PreconditionFailed: 412,
2524
+ PayloadTooLarge: 413,
2525
+ UriTooLong: 414,
2526
+ UnsupportedMediaType: 415,
2527
+ RangeNotSatisfiable: 416,
2528
+ ExpectationFailed: 417,
2529
+ ImATeapot: 418,
2530
+ MisdirectedRequest: 421,
2531
+ UnprocessableEntity: 422,
2532
+ Locked: 423,
2533
+ FailedDependency: 424,
2534
+ TooEarly: 425,
2535
+ UpgradeRequired: 426,
2536
+ PreconditionRequired: 428,
2537
+ TooManyRequests: 429,
2538
+ RequestHeaderFieldsTooLarge: 431,
2539
+ UnavailableForLegalReasons: 451,
2540
+ InternalServerError: 500,
2541
+ NotImplemented: 501,
2542
+ BadGateway: 502,
2543
+ ServiceUnavailable: 503,
2544
+ GatewayTimeout: 504,
2545
+ HttpVersionNotSupported: 505,
2546
+ VariantAlsoNegotiates: 506,
2547
+ InsufficientStorage: 507,
2548
+ LoopDetected: 508,
2549
+ NotExtended: 510,
2550
+ NetworkAuthenticationRequired: 511,
2551
+ WebServerIsDown: 521,
2552
+ ConnectionTimedOut: 522,
2553
+ OriginIsUnreachable: 523,
2554
+ TimeoutOccurred: 524,
2555
+ SslHandshakeFailed: 525,
2556
+ InvalidSslCertificate: 526
2557
+ };
2558
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
2559
+ HttpStatusCode[value] = key;
2560
+ });
2561
+ var HttpStatusCode_default = HttpStatusCode;
2562
+
2563
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/lib/axios.js
2564
+ function createInstance(defaultConfig) {
2565
+ const context = new Axios_default(defaultConfig);
2566
+ const instance = bind(Axios_default.prototype.request, context);
2567
+ utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
2568
+ utils_default.extend(instance, context, null, { allOwnKeys: true });
2569
+ instance.create = function create(instanceConfig) {
2570
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
2571
+ };
2572
+ return instance;
2573
+ }
2574
+ var axios = createInstance(defaults_default);
2575
+ axios.Axios = Axios_default;
2576
+ axios.CanceledError = CanceledError_default;
2577
+ axios.CancelToken = CancelToken_default;
2578
+ axios.isCancel = isCancel;
2579
+ axios.VERSION = VERSION;
2580
+ axios.toFormData = toFormData_default;
2581
+ axios.AxiosError = AxiosError_default;
2582
+ axios.Cancel = axios.CanceledError;
2583
+ axios.all = function all(promises) {
2584
+ return Promise.all(promises);
2585
+ };
2586
+ axios.spread = spread;
2587
+ axios.isAxiosError = isAxiosError;
2588
+ axios.mergeConfig = mergeConfig;
2589
+ axios.AxiosHeaders = AxiosHeaders_default;
2590
+ axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
2591
+ axios.getAdapter = adapters_default.getAdapter;
2592
+ axios.HttpStatusCode = HttpStatusCode_default;
2593
+ axios.default = axios;
2594
+ var axios_default = axios;
2595
+
2596
+ // ../../node_modules/.pnpm/axios@1.13.2/node_modules/axios/index.js
2597
+ var {
2598
+ Axios: Axios2,
2599
+ AxiosError: AxiosError2,
2600
+ CanceledError: CanceledError2,
2601
+ isCancel: isCancel2,
2602
+ CancelToken: CancelToken2,
2603
+ VERSION: VERSION2,
2604
+ all: all2,
2605
+ Cancel,
2606
+ isAxiosError: isAxiosError2,
2607
+ spread: spread2,
2608
+ toFormData: toFormData2,
2609
+ AxiosHeaders: AxiosHeaders2,
2610
+ HttpStatusCode: HttpStatusCode2,
2611
+ formToJSON,
2612
+ getAdapter: getAdapter2,
2613
+ mergeConfig: mergeConfig2
2614
+ } = axios_default;
2615
+
2616
+ // shared/utils/config.ts
2617
+ var devMode = localStorage.getItem("dev-mode");
2618
+ var API_LOCAL_DEV_URL = "http://127.0.0.1:8787";
2619
+ var API_REMOTE_DEV_URL = "https://assembled-brands-dev.crystal-e8a.workers.dev";
2620
+ var API_PROD_URL = "https://assembled-brands-prod.crystal-e8a.workers.dev";
2621
+ var appConfig = {
2622
+ apiBaseUrl: devMode === "local" ? API_LOCAL_DEV_URL : devMode === "remote-dev" ? API_REMOTE_DEV_URL : API_PROD_URL,
2623
+ apiVersion: "/api/v1",
2624
+ accessTokenPersistStrategy: "cookie",
2625
+ TOKEN_NAME_IN_STORAGE: "accessToken",
2626
+ TOKEN_TYPE: "Bearer",
2627
+ REQUEST_HEADER_AUTH_KEY: "Authorization"
2628
+ };
2629
+ var navigateToPath = (path, skipDevMode = false) => {
2630
+ if (devMode === "local" && !skipDevMode) {
2631
+ window.location.href = `/dev${path}`;
2632
+ } else if (devMode === "remote-dev" && !skipDevMode) {
2633
+ window.location.href = `/dev${path}`;
2634
+ } else {
2635
+ window.location.href = `/${path}`;
2636
+ }
2637
+ };
2638
+
2639
+ // shared/utils/auth.ts
2640
+ var setCookie = (name, value, days) => {
2641
+ const date = /* @__PURE__ */ new Date();
2642
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1e3);
2643
+ const expires = "expires=" + date.toUTCString();
2644
+ document.cookie = `${name}=${encodeURIComponent(value)}; ${expires}; path=/`;
2645
+ };
2646
+ var getCookie = (name) => {
2647
+ const cookies = document.cookie.split("; ");
2648
+ for (const c of cookies) {
2649
+ const [key, val] = c.split("=");
2650
+ if (key === name) return decodeURIComponent(val);
2651
+ }
2652
+ return null;
2653
+ };
2654
+ var deleteCookie = (name) => {
2655
+ setCookie(name, "", -1);
2656
+ };
2657
+ var processMiddleware = () => {
2658
+ const cookie = getCookie("accessToken");
2659
+ if (!cookie) {
2660
+ navigateToPath("/login?error=unauthorized", false);
2661
+ }
2662
+ return cookie;
2663
+ };
2664
+
2665
+ // shared/services/axios/AxiosRequestIntrceptorConfigCallback.ts
2666
+ var AxiosRequestIntrceptorConfigCallback = (config) => {
2667
+ const storage = appConfig.accessTokenPersistStrategy;
2668
+ if (storage === "localStorage" || storage === "sessionStorage" || storage === "cookie") {
2669
+ let accessToken = "";
2670
+ if (storage === "localStorage") {
2671
+ accessToken = localStorage.getItem(appConfig.TOKEN_NAME_IN_STORAGE) || "";
2672
+ }
2673
+ if (storage === "sessionStorage") {
2674
+ accessToken = sessionStorage.getItem(appConfig.TOKEN_NAME_IN_STORAGE) || "";
2675
+ }
2676
+ if (storage === "cookie") {
2677
+ accessToken = getCookie(appConfig.TOKEN_NAME_IN_STORAGE) || "";
2678
+ }
2679
+ if (accessToken) {
2680
+ config.headers[appConfig.REQUEST_HEADER_AUTH_KEY] = `${appConfig.TOKEN_TYPE} ${accessToken}`;
2681
+ }
2682
+ }
2683
+ const teamId = localStorage.getItem("team_id");
2684
+ if (teamId) {
2685
+ config.headers["X-Team-Id"] = teamId;
2686
+ }
2687
+ return config;
2688
+ };
2689
+ var AxiosRequestIntrceptorConfigCallback_default = AxiosRequestIntrceptorConfigCallback;
2690
+
2691
+ // shared/services/axios/AxiosResponseIntrceptorErrorCallback.ts
2692
+ var UNAUTHORIZED_CODES = [401, 419, 440];
2693
+ var AxiosResponseIntrceptorErrorCallback = (error) => {
2694
+ console.warn(error);
2695
+ const { response } = error;
2696
+ if (response && UNAUTHORIZED_CODES.includes(response.status)) {
2697
+ deleteCookie("accessToken");
2698
+ navigateToPath("/login?error=unauthorized", false);
2699
+ }
2700
+ };
2701
+ var AxiosResponseIntrceptorErrorCallback_default = AxiosResponseIntrceptorErrorCallback;
2702
+
2703
+ // shared/services/axios/AxiosBase.ts
2704
+ var AxiosBase = axios_default.create({
2705
+ timeout: 6e4,
2706
+ baseURL: appConfig.apiBaseUrl + appConfig.apiVersion
2707
+ });
2708
+ AxiosBase.interceptors.request.use(
2709
+ (config) => {
2710
+ return AxiosRequestIntrceptorConfigCallback_default(config);
2711
+ },
2712
+ (error) => {
2713
+ return Promise.reject(error);
2714
+ }
2715
+ );
2716
+ AxiosBase.interceptors.response.use(
2717
+ (response) => response,
2718
+ (error) => {
2719
+ AxiosResponseIntrceptorErrorCallback_default(error);
2720
+ return Promise.reject(error);
2721
+ }
2722
+ );
2723
+ var AxiosBase_default = AxiosBase;
2724
+
2725
+ // shared/services/ApiService.ts
2726
+ var ApiService = {
2727
+ fetchDataWithAxios(param) {
2728
+ return new Promise((resolve, reject) => {
2729
+ AxiosBase_default(param).then((response) => {
2730
+ resolve(response.data);
2731
+ }).catch((error) => {
2732
+ let message = "An unknown error occurred";
2733
+ if (error.response && error.response.data) {
2734
+ const data = error.response.data;
2735
+ if (typeof data.message === "string") {
2736
+ message = data.message;
2737
+ } else if (typeof data.error === "string") {
2738
+ message = data.error;
2739
+ } else {
2740
+ message = JSON.stringify(data);
2741
+ }
2742
+ } else if (error.message) {
2743
+ message = error.message;
2744
+ }
2745
+ reject({ ...error, message });
2746
+ });
2747
+ });
2748
+ }
2749
+ };
2750
+ var ApiService_default = ApiService;
2751
+
2752
+ // shared/services/AssetService.ts
2753
+ var apiCreateAssetPresignedUrl = (data) => {
2754
+ return ApiService_default.fetchDataWithAxios({
2755
+ url: "/asset",
2756
+ method: "post",
2757
+ data
2758
+ });
2759
+ };
2760
+
2761
+ // shared/services/FinancialWizardService.ts
2762
+ var apiUploadFinancialDocument = (data) => {
2763
+ return ApiService_default.fetchDataWithAxios({
2764
+ url: "/financial-wizard/document",
2765
+ method: "post",
2766
+ data
2767
+ });
2768
+ };
2769
+
2770
+ // shared/utils/selectors.ts
2771
+ var queryElement = (selector, scope = document) => {
2772
+ return scope.querySelector(selector);
2773
+ };
2774
+ var queryAllElements = (selector, scope = document) => {
2775
+ const elements = scope.querySelectorAll(selector);
2776
+ return [...Array.from(elements)];
2777
+ };
2778
+
2779
+ // pages/financial-wizard-step-3/index.ts
2780
+ var initFinancialWizardStep3Page = () => {
2781
+ processMiddleware();
2782
+ const form = document.querySelector('[dev-target="financial-wizard-step3-form"]');
2783
+ if (!form) {
2784
+ console.error(
2785
+ 'Financial Wizard Step 3 form not found. Element: [dev-target="financial-wizard-step3-form"] not found'
2786
+ );
2787
+ return;
2788
+ }
2789
+ const documentTypeRadios = queryAllElements(
2790
+ 'input[name="document_type"]',
2791
+ form
2792
+ );
2793
+ const fileInput = queryElement('[dev-target="file-input"]', form);
2794
+ const notesInput = queryElement('[dev-target="notes-input"]', form);
2795
+ const submitButton = queryElement('[dev-target="submit-button"]', form);
2796
+ const backButton = queryElement('[dev-target="back-button"]', form);
2797
+ const continueButton = queryElement('[dev-target="continue-button"]', form);
2798
+ if (!documentTypeRadios.length) {
2799
+ console.error(
2800
+ 'Ensure [input[name="document_type"]] is present. Found ' + documentTypeRadios.length + " elements."
2801
+ );
2802
+ return;
2803
+ }
2804
+ if (!fileInput) {
2805
+ console.error('Ensure [dev-target="file-input"] is present.');
2806
+ return;
2807
+ }
2808
+ if (!submitButton) {
2809
+ console.error('Ensure [dev-target="submit-button"] is present.');
2810
+ return;
2811
+ }
2812
+ if (!backButton) {
2813
+ console.error('Ensure [dev-target="back-button"] is present.');
2814
+ return;
2815
+ }
2816
+ if (!continueButton) {
2817
+ console.error('Ensure [dev-target="continue-button"] is present.');
2818
+ return;
2819
+ }
2820
+ backButton.addEventListener("click", () => {
2821
+ navigateToPath("/finance-docs-financial-reports");
2822
+ });
2823
+ continueButton.addEventListener("click", () => {
2824
+ navigateToPath("/financial-wizard-step-4");
2825
+ });
2826
+ form.addEventListener("submit", async (event) => {
2827
+ event.preventDefault();
2828
+ event.stopPropagation();
2829
+ const resetErrors = () => {
2830
+ fileInput.classList.remove("is-error");
2831
+ submitButton.classList.remove("is-error");
2832
+ submitButton.value = "UPLOAD DOCUMENT";
2833
+ };
2834
+ fileInput.addEventListener("change", resetErrors, { once: true });
2835
+ documentTypeRadios.forEach((radio) => {
2836
+ radio.addEventListener("change", resetErrors, { once: true });
2837
+ });
2838
+ const selectedDocumentType = documentTypeRadios.find((radio) => radio.checked);
2839
+ if (!selectedDocumentType) {
2840
+ submitButton.classList.add("is-error");
2841
+ submitButton.value = "Document type is required";
2842
+ return;
2843
+ }
2844
+ if (!fileInput.files || !fileInput.files[0]) {
2845
+ fileInput.classList.add("is-error");
2846
+ submitButton.classList.add("is-error");
2847
+ submitButton.value = "Please select a file to upload";
2848
+ return;
2849
+ }
2850
+ const file = fileInput.files[0];
2851
+ const allowedTypes = [
2852
+ "application/pdf",
2853
+ "application/msword",
2854
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2855
+ "application/vnd.ms-excel",
2856
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2857
+ "text/csv"
2858
+ ];
2859
+ if (!allowedTypes.includes(file.type)) {
2860
+ fileInput.classList.add("is-error");
2861
+ submitButton.classList.add("is-error");
2862
+ submitButton.value = "Invalid file type. Please upload PDF, Word, Excel, or CSV files";
2863
+ return;
2864
+ }
2865
+ try {
2866
+ const assetPayload = {
2867
+ fileName: file.name,
2868
+ contentType: file.type,
2869
+ assetType: "document",
2870
+ fileSize: file.size,
2871
+ duration: 0
2872
+ };
2873
+ const assetResponse = await apiCreateAssetPresignedUrl(assetPayload);
2874
+ const assetId = assetResponse.asset.id;
2875
+ const documentPayload = {
2876
+ step: 3,
2877
+ document_type: selectedDocumentType.value,
2878
+ asset_id: assetId,
2879
+ ...notesInput?.value ? { notes: notesInput.value } : {}
2880
+ };
2881
+ await apiUploadFinancialDocument(documentPayload);
2882
+ submitButton.classList.add("is-success");
2883
+ submitButton.value = "Document uploaded successfully!";
2884
+ fileInput.value = "";
2885
+ if (notesInput) notesInput.value = "";
2886
+ documentTypeRadios.forEach((radio) => {
2887
+ radio.checked = false;
2888
+ });
2889
+ setTimeout(() => {
2890
+ submitButton.classList.remove("is-success");
2891
+ submitButton.value = "UPLOAD DOCUMENT";
2892
+ }, 2e3);
2893
+ } catch (error) {
2894
+ const { message } = error;
2895
+ console.error(message);
2896
+ submitButton.classList.add("is-error");
2897
+ submitButton.value = message || "There was a problem uploading the document";
2898
+ }
2899
+ });
2900
+ };
2901
+ initFinancialWizardStep3Page();
2902
+ //# sourceMappingURL=index.js.map