@uidev1116/acms-js-sdk 0.1.2 → 0.3.1

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 (37) hide show
  1. package/README.md +256 -7
  2. package/dist/cjs/acms-js-sdk.cjs +3 -3
  3. package/dist/cjs/acms-path.cjs +4 -1
  4. package/dist/cjs/type-guard.cjs +1 -1
  5. package/dist/es/acms-js-sdk.js +53 -60
  6. package/dist/es/acms-path.js +2124 -4
  7. package/dist/es/type-guard.js +2 -3
  8. package/dist/index-BeSRDPIk.js +15 -0
  9. package/dist/index-Bm4C_vR2.cjs +1 -0
  10. package/dist/types/core/AcmsClient.d.ts +3 -2
  11. package/dist/types/core/AcmsFetchError.d.ts +1 -1
  12. package/dist/types/index.d.ts +1 -0
  13. package/dist/types/lib/acmsPath/acmsField.d.ts +13 -0
  14. package/dist/types/lib/acmsPath/acmsField.test.d.ts +1 -0
  15. package/dist/types/lib/acmsPath/acmsPath.d.ts +2 -2
  16. package/dist/types/lib/acmsPath/{defaultOptions.d.ts → defaults.d.ts} +1 -0
  17. package/dist/types/lib/acmsPath/index.d.ts +1 -0
  18. package/dist/types/lib/acmsPath/parseAcmsPath.d.ts +1 -1
  19. package/dist/types/lib/acmsPath/types.d.ts +32 -7
  20. package/dist/types/lib/acmsPath/utils.d.ts +1 -0
  21. package/dist/types/lib/acmsPath/utils.test.d.ts +1 -0
  22. package/dist/types/lib/typeGuard/isAcmsFetchError.d.ts +1 -1
  23. package/dist/types/types/index.d.ts +1 -2
  24. package/dist/types/utils/index.d.ts +3 -0
  25. package/dist/types/utils/mergeConfig.d.ts +10 -0
  26. package/dist/types/utils/mergeConfig.test.d.ts +1 -0
  27. package/dist/types/utils/parseFormData.d.ts +7 -0
  28. package/dist/types/utils/unique.d.ts +1 -0
  29. package/package.json +28 -27
  30. package/dist/browser-ponyfill-EPWIFhDK.js +0 -339
  31. package/dist/browser-ponyfill-r3mBr4hd.cjs +0 -2
  32. package/dist/index-H2fSgwjT.js +0 -328
  33. package/dist/index-WFlkDf6U.cjs +0 -1
  34. package/dist/index-ZZQxXurp.js +0 -19
  35. package/dist/index-x-5Zn68j.cjs +0 -1
  36. /package/dist/{typeGuard-eqTQ9U-x.cjs → typeGuard-B-hez9oi.cjs} +0 -0
  37. /package/dist/{typeGuard-Jsany_41.js → typeGuard-CkfEvQcm.js} +0 -0
package/README.md CHANGED
@@ -132,12 +132,13 @@ The second argument can be an option.
132
132
 
133
133
  Below is a list of all options.
134
134
 
135
- | name | description | type | default |
136
- | ------------ | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------- |
137
- | requestInit | An object containing any custom settings that you want to apply to the request. | RequestInit | undefined |
138
- | responseType | indication the type of data that the server will respond with | 'arrayBuffer'<br> &#124; 'blob'<br> &#124; 'formData'<br> &#124; 'json'<br> &#124; 'text'; | 'json' |
135
+ | name | description | type | default |
136
+ | --------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------- |
137
+ | requestInit | An object containing any custom settings that you want to apply to the request. | RequestInit | undefined |
138
+ | responseType | indication the type of data that the server will respond with | 'arrayBuffer'<br> &#124; 'blob'<br> &#124; 'formData'<br> &#124; 'json'<br> &#124; 'text'; | 'json' |
139
+ | acmsPathOptions | Configuration for acmsPath behavior (API version, custom segments, etc.) | AcmsPathOptions | {} |
139
140
 
140
- Options can also be set in the arguments of the createClinent function.
141
+ Options can also be set in the arguments of the createClient function.
141
142
 
142
143
  In this case, all requests will reflect the set options.
143
144
 
@@ -154,6 +155,43 @@ const acmsClient = createClient({
154
155
  });
155
156
  ```
156
157
 
158
+ ### API Version Configuration
159
+
160
+ You can configure the default API version for all requests using `acmsPathOptions`:
161
+
162
+ ```js
163
+ const acmsClient = createClient({
164
+ baseUrl: 'YOUR_BASE_URL',
165
+ apiKey: 'YOUR_API_KEY',
166
+ acmsPathOptions: {
167
+ apiVersion: 'v2', // 'v1' or 'v2' (default: 'v2')
168
+ },
169
+ });
170
+
171
+ // All API requests will use the specified version
172
+ acmsClient.get({
173
+ api: 'summary_index',
174
+ });
175
+ // => Requests to: YOUR_BASE_URL/api/v2/summary_index/
176
+ ```
177
+
178
+ You can also customize the path segments:
179
+
180
+ ```js
181
+ const acmsClient = createClient({
182
+ baseUrl: 'YOUR_BASE_URL',
183
+ apiKey: 'YOUR_API_KEY',
184
+ acmsPathOptions: {
185
+ apiVersion: 'v1',
186
+ segments: {
187
+ bid: 'custom-bid',
188
+ cid: 'custom-cid',
189
+ // ... other custom segments
190
+ },
191
+ },
192
+ });
193
+ ```
194
+
157
195
  ### Next.js App Router
158
196
 
159
197
  For Next.js App Router, you can specify the `revalidate` option.
@@ -221,6 +259,7 @@ const path = acmsPath({
221
259
  category: 'CATEGORY_CODE',
222
260
  entry: 'ENTRY_CODE',
223
261
  // user: 1,
262
+ // unit: 'UNIT_ID',
224
263
  // tag: ['tag1', 'tag2'],
225
264
  // field: 'color/eq/red',
226
265
  // span: { start: '2021-01-01', end: '2021-12-31' },
@@ -244,8 +283,9 @@ interface AcmsPathParams {
244
283
  category?: string | string[] | number;
245
284
  entry?: string | number;
246
285
  user?: number;
286
+ unit?: string;
247
287
  tag?: string[];
248
- field?: string;
288
+ field?: string | AcmsFieldList;
249
289
  span?: { start?: string | Date; end?: string | Date };
250
290
  date?: { year?: number; month?: number; day?: number };
251
291
  page?: number;
@@ -258,6 +298,31 @@ interface AcmsPathParams {
258
298
  }
259
299
  ```
260
300
 
301
+ ### Options
302
+
303
+ You can configure options for `acmsPath`.
304
+
305
+ ```ts
306
+ interface AcmsPathOptions {
307
+ apiVersion?: 'v1' | 'v2'; // Default: 'v2'
308
+ segments?: Partial<AcmsPathSegments>; // Custom segment names
309
+ }
310
+ ```
311
+
312
+ **apiVersion**: Specifies the API version for the path.
313
+ - `'v2'` (default): Generates paths like `api/v2/MODULE_ID/`
314
+ - `'v1'`: Generates paths like `api/MODULE_ID/`
315
+
316
+ ```js
317
+ // v2 API (default)
318
+ acmsPath({ api: 'summary_index' });
319
+ // => 'api/v2/summary_index/'
320
+
321
+ // v1 API
322
+ acmsPath({ api: 'summary_index' }, { apiVersion: 'v1' });
323
+ // => 'api/summary_index/'
324
+ ```
325
+
261
326
  ## isAcmsFetchError
262
327
 
263
328
  You can check if the error is `AcmsFetchError` by using utility function `isAcmsFetchError`.
@@ -296,6 +361,190 @@ const context = parseAcmsPath(window.location.pathname);
296
361
  // cid: 2,
297
362
  // eid: 3,
298
363
  // page: 2,
299
- // field: 'color/eq/red'
364
+ // field: AcmsFieldList { ... } // field is an AcmsFieldList instance
300
365
  // }
301
366
  ```
367
+
368
+ ### Return Type
369
+
370
+ ```ts
371
+ interface AcmsContext {
372
+ bid?: number;
373
+ cid?: number;
374
+ eid?: number;
375
+ uid?: number;
376
+ utid?: string;
377
+ tag?: string[];
378
+ field?: AcmsFieldList; // Returns AcmsFieldList instance
379
+ span?: { start: string | Date; end: string | Date };
380
+ date?: { year: number; month?: number; day?: number };
381
+ page?: number;
382
+ order?: string;
383
+ limit?: number;
384
+ keyword?: string;
385
+ admin?: string;
386
+ tpl?: string;
387
+ api?: string;
388
+ apiVersion?: 'v1' | 'v2'; // Detected API version
389
+ unresolvedPath?: string; // Any unresolved path segments
390
+ }
391
+ ```
392
+
393
+ **Note**: The `field` property is returned as an `AcmsFieldList` instance, which provides methods to manipulate field data. The `apiVersion` is automatically detected from the path (defaults to `'v1'` for legacy paths without version).
394
+
395
+ ### API Version Detection
396
+
397
+ The `parseAcmsPath` function automatically detects the API version from the path:
398
+
399
+ ```js
400
+ // v1 API (legacy format)
401
+ parseAcmsPath('/api/summary_index');
402
+ // { api: 'summary_index', apiVersion: 'v1', ... }
403
+
404
+ // v2 API
405
+ parseAcmsPath('/api/v2/summary_index');
406
+ // { api: 'summary_index', apiVersion: 'v2', ... }
407
+ ```
408
+
409
+ ## AcmsFieldList
410
+
411
+ The `AcmsFieldList` class is a utility for working with field contexts in a-blog cms. It allows you to build complex field queries programmatically and convert between string and object representations.
412
+
413
+ ### Basic Usage
414
+
415
+ You can use `AcmsFieldList` in two ways with `acmsPath`:
416
+
417
+ #### 1. Using string notation (simple)
418
+
419
+ ```js
420
+ import { acmsPath } from '@uidev1116/acms-js-sdk';
421
+
422
+ const path = acmsPath({
423
+ blog: 'news',
424
+ field: 'color/eq/red',
425
+ });
426
+ // => 'news/field/color/eq/red/'
427
+ ```
428
+
429
+ #### 2. Using AcmsFieldList (programmatic)
430
+
431
+ ```js
432
+ import { acmsPath, AcmsFieldList } from '@uidev1116/acms-js-sdk';
433
+
434
+ const fieldList = new AcmsFieldList([
435
+ {
436
+ key: 'color',
437
+ filters: [
438
+ { operator: 'eq', value: 'red', connector: 'or' }
439
+ ],
440
+ separator: '_and_'
441
+ }
442
+ ]);
443
+
444
+ const path = acmsPath({
445
+ blog: 'news',
446
+ field: fieldList,
447
+ });
448
+ // => 'news/field/color/eq/red/'
449
+ ```
450
+
451
+ ### AcmsFieldList Methods
452
+
453
+ #### Constructor
454
+
455
+ ```ts
456
+ const fieldList = new AcmsFieldList(fields?: AcmsField[]);
457
+ ```
458
+
459
+ #### Instance Methods
460
+
461
+ - `push(field: AcmsField)`: Add a field to the end
462
+ - `pop()`: Remove and return the last field
463
+ - `shift()`: Remove and return the first field
464
+ - `unshift(field: AcmsField)`: Add a field to the beginning
465
+ - `getFields()`: Get all fields as an array
466
+ - `toString()`: Convert to a-blog cms field path string
467
+
468
+ #### Static Methods
469
+
470
+ - `AcmsFieldList.fromString(input: string)`: Parse a field string into an AcmsFieldList
471
+ - `AcmsFieldList.fromFormData(formData: FormData)`: Create from FormData
472
+
473
+ ### Working with Field Types
474
+
475
+ ```ts
476
+ interface AcmsField {
477
+ key: string;
478
+ filters: AcmsFilter[];
479
+ separator?: '_and_' | '_or_';
480
+ }
481
+
482
+ interface AcmsFilter {
483
+ operator: 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte' | 'lk' | 'nlk' | 're' | 'nre' | 'em' | 'nem';
484
+ value: string;
485
+ connector: 'and' | 'or';
486
+ }
487
+ ```
488
+
489
+ ### Example: Building Complex Field Queries
490
+
491
+ ```js
492
+ import { AcmsFieldList } from '@uidev1116/acms-js-sdk';
493
+
494
+ // Create a field list with multiple conditions
495
+ const fieldList = new AcmsFieldList([
496
+ {
497
+ key: 'color',
498
+ filters: [
499
+ { operator: 'eq', value: 'red', connector: 'or' },
500
+ { operator: 'eq', value: 'blue', connector: 'or' }
501
+ ],
502
+ separator: '_and_'
503
+ },
504
+ {
505
+ key: 'size',
506
+ filters: [
507
+ { operator: 'gte', value: '10', connector: 'and' }
508
+ ],
509
+ separator: '_and_'
510
+ }
511
+ ]);
512
+
513
+ // Convert to string
514
+ console.log(fieldList.toString());
515
+ // => 'color/eq/red/blue/_and_/size/gte/10'
516
+ ```
517
+
518
+ ### Example: Parsing Field Strings
519
+
520
+ ```js
521
+ import { AcmsFieldList } from '@uidev1116/acms-js-sdk';
522
+
523
+ // Parse from string
524
+ const fieldList = AcmsFieldList.fromString('color/eq/red/blue/_and_/size/gte/10');
525
+
526
+ // Get structured data
527
+ const fields = fieldList.getFields();
528
+ console.log(fields);
529
+ // => [
530
+ // { key: 'color', filters: [...], separator: '_and_' },
531
+ // { key: 'size', filters: [...], separator: '_and_' }
532
+ // ]
533
+ ```
534
+
535
+ ### Using with parseAcmsPath
536
+
537
+ When you parse a path containing field segments, the result will include an `AcmsFieldList` instance:
538
+
539
+ ```js
540
+ import { parseAcmsPath } from '@uidev1116/acms-js-sdk';
541
+
542
+ const context = parseAcmsPath('/field/color/eq/red');
543
+
544
+ // context.field is an AcmsFieldList instance
545
+ console.log(context.field.toString());
546
+ // => 'color/eq/red'
547
+
548
+ console.log(context.field.getFields());
549
+ // => [{ key: 'color', filters: [...], separator: '_and_' }]
550
+ ```
@@ -1,4 +1,4 @@
1
- "use strict";var q=Object.defineProperty;var A=(r,e,t)=>e in r?q(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>(A(r,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../index-WFlkDf6U.cjs"),c=require("../typeGuard-eqTQ9U-x.cjs"),o=require("../index-x-5Zn68j.cjs");async function U(r){try{const{message:e}=await r.json();return e??null}catch{return null}}async function F(){if(typeof fetch>"u"){const{default:r}=await Promise.resolve().then(()=>require("../browser-ponyfill-r3mBr4hd.cjs")).then(e=>e.browserPonyfill);return r}return fetch}async function O(...r){if(typeof Headers>"u"){const{Headers:e}=await Promise.resolve().then(()=>require("../browser-ponyfill-r3mBr4hd.cjs")).then(t=>t.browserPonyfill);return new e(...r)}return new Headers(...r)}const $={responseType:"json",acmsPathOptions:{}};class b{constructor({baseUrl:e,apiKey:t,...a}){n(this,"baseUrl");n(this,"apiKey");n(this,"config");if(e!=null&&e==="")throw new Error("baseUrl is required.");if(t!=null&&t==="")throw new Error("apiKey is required.");if(!c.isString(e))throw new Error("baseUrl must be string.");if(!c.isString(t))throw new Error("apiKey must be string.");this.baseUrl=e,this.apiKey=t,this.config={...$,...a}}async request(e,t={}){const a={...this.config,...t},{requestInit:l,responseType:m,acmsPathOptions:d}=a,g=await F(),y=this.createUrl(e,d),P=await this.createFetchOptions(l);try{const s=await g(y,P),{ok:p,status:i,statusText:h,headers:E}=s,f={data:await s[m](),status:i,statusText:h,headers:E};if(!p){const w=await U(s);return await Promise.reject(new o.AcmsFetchError(`fetch API response status: ${i}${w!=null?`
2
- message is \`${w}\``:""}`,`${i} ${h}`,f))}return f}catch(s){return s instanceof Error?await Promise.reject(new Error(`Network Error.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./acms-path.cjs"),c=require("../typeGuard-B-hez9oi.cjs"),o=require("../index-Bm4C_vR2.cjs");async function P(r){try{const{message:t}=await r.json();return t??null}catch{return null}}async function A(){return fetch}async function F(...r){return new Headers(...r)}const U={responseType:"json",acmsPathOptions:{}};class q{baseUrl;apiKey;config;constructor({baseUrl:t,apiKey:e,...i}){if(t!=null&&t==="")throw new Error("baseUrl is required.");if(e!=null&&e==="")throw new Error("apiKey is required.");if(!c.isString(t))throw new Error("baseUrl must be string.");if(!c.isString(e))throw new Error("apiKey must be string.");this.baseUrl=t,this.apiKey=e,this.config={...U,...i}}async request(t,e={}){const i={...this.config,...e},{requestInit:f,responseType:m,acmsPathOptions:g}=i,l=await A(),E=this.createUrl(t,g),d=await this.createFetchOptions(f);try{const s=await l(E,d),{ok:p,status:a,statusText:u,headers:y}=s,h={data:await s[m](),status:a,statusText:u,headers:y};if(!p){const w=await P(s);return await Promise.reject(new o.AcmsFetchError(`fetch API response status: ${a}${w!=null?`
2
+ message is \`${w}\``:""}`,`${a} ${u}`,h))}return h}catch(s){return s instanceof Error?await Promise.reject(new Error(`Network Error.
3
3
  Details: ${s.message}`)):await Promise.reject(new Error(`Network Error.
4
- Details: Unknown Error`))}}async createFetchOptions(e){const t=await O(e==null?void 0:e.headers);return t.has("X-API-KEY")||t.set("X-API-KEY",this.apiKey),{...e,headers:t}}createUrl(e,t={}){return c.isString(e)?new URL(e,this.baseUrl):e instanceof URL?new URL(e,this.baseUrl):new URL(u.acmsPath({...e},t),this.baseUrl)}async get(e,t={}){return await this.request(e,{...t,requestInit:{...t.requestInit,method:"GET"}})}static isAcmsFetchError(e){return o.isAcmsFetchError(e)}getConfig(){return this.config}}function j(...r){return new b(...r)}exports.acmsPath=u.acmsPath;exports.parseAcmsPath=u.parseAcmsPath;exports.isAcmsFetchError=o.isAcmsFetchError;exports.createClient=j;
4
+ Details: Unknown Error`))}}async createFetchOptions(t){const e=await F(t?.headers);return e.has("X-API-KEY")||e.set("X-API-KEY",this.apiKey),{...t,headers:e}}createUrl(t,e={}){return c.isString(t)?new URL(t,this.baseUrl):t instanceof URL?new URL(t,this.baseUrl):new URL(n.acmsPath({...t},e),this.baseUrl)}async get(t,e={}){return await this.request(t,{...e,requestInit:{...e.requestInit,method:"GET"}})}static isAcmsFetchError(t){return o.isAcmsFetchError(t)}getConfig(){return this.config}}function O(...r){return new q(...r)}exports.AcmsFieldList=n.AcmsFieldList;exports.acmsPath=n.acmsPath;exports.parseAcmsPath=n.parseAcmsPath;exports.isAcmsFetchError=o.isAcmsFetchError;exports.createClient=O;
@@ -1 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-WFlkDf6U.cjs");require("../typeGuard-eqTQ9U-x.cjs");exports.acmsPath=e.acmsPath;exports.parseAcmsPath=e.parseAcmsPath;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ae=require("../typeGuard-B-hez9oi.cjs");var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sn(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var a=e.default;if(typeof a=="function"){var i=function o(){var d=!1;try{d=this instanceof o}catch{}return d?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};i.prototype=a.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var d=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(i,o,d.get?d:{enumerable:!0,get:function(){return e[o]}})}),i}var He,Zr;function Ee(){return Zr||(Zr=1,He=TypeError),He}const pn={},yn=Object.freeze(Object.defineProperty({__proto__:null,default:pn},Symbol.toStringTag,{value:"Module"})),dn=sn(yn);var Ke,et;function Me(){if(et)return Ke;et=1;var e=typeof Map=="function"&&Map.prototype,a=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=e&&a&&typeof a.get=="function"?a.get:null,o=e&&Map.prototype.forEach,d=typeof Set=="function"&&Set.prototype,v=Object.getOwnPropertyDescriptor&&d?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,b=d&&v&&typeof v.get=="function"?v.get:null,c=d&&Set.prototype.forEach,p=typeof WeakMap=="function"&&WeakMap.prototype,m=p?WeakMap.prototype.has:null,t=typeof WeakSet=="function"&&WeakSet.prototype,f=t?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,u=h?WeakRef.prototype.deref:null,g=Boolean.prototype.valueOf,w=Object.prototype.toString,l=Function.prototype.toString,s=String.prototype.match,y=String.prototype.slice,A=String.prototype.replace,S=String.prototype.toUpperCase,O=String.prototype.toLowerCase,P=RegExp.prototype.test,E=Array.prototype.concat,$=Array.prototype.join,N=Array.prototype.slice,q=Math.floor,M=typeof BigInt=="function"?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",K=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,re=Object.prototype.propertyIsEnumerable,te=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function _(r,n){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||P.call(/e/,n))return n;var F=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var T=r<0?-q(-r):q(r);if(T!==r){var C=String(T),I=y.call(n,C.length+1);return A.call(C,F,"$&_")+"."+A.call(A.call(I,/([0-9]{3})/g,"$&_"),/_$/,"")}}return A.call(n,F,"$&_")}var z=dn,ne=z.custom,ye=k(ne)?ne:null,ie={__proto__:null,double:'"',single:"'"},oe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ke=function r(n,F,T,C){var I=F||{};if(H(I,"quoteStyle")&&!H(ie,I.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(I,"maxStringLength")&&(typeof I.maxStringLength=="number"?I.maxStringLength<0&&I.maxStringLength!==1/0:I.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var se=H(I,"customInspect")?I.customInspect:!0;if(typeof se!="boolean"&&se!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(I,"indent")&&I.indent!==null&&I.indent!==" "&&!(parseInt(I.indent,10)===I.indent&&I.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(I,"numericSeparator")&&typeof I.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var de=I.numericSeparator;if(typeof n>"u")return"undefined";if(n===null)return"null";if(typeof n=="boolean")return n?"true":"false";if(typeof n=="string")return Gr(n,I);if(typeof n=="number"){if(n===0)return 1/0/n>0?"0":"-0";var V=String(n);return de?_(n,V):V}if(typeof n=="bigint"){var pe=String(n)+"n";return de?_(n,pe):pe}var Be=typeof I.depth>"u"?5:I.depth;if(typeof T>"u"&&(T=0),T>=Be&&Be>0&&typeof n=="object")return fe(n)?"[Array]":"[Object]";var be=fn(I,T);if(typeof C>"u")C=[];else if(ce(C,n)>=0)return"[Circular]";function Z(we,De,cn){if(De&&(C=N.call(C),C.push(De)),cn){var Yr={depth:I.depth};return H(I,"quoteStyle")&&(Yr.quoteStyle=I.quoteStyle),r(we,Yr,T+1,C)}return r(we,I,T+1,C)}if(typeof n=="function"&&!W(n)){var jr=he(n),Hr=Ie(n,Z);return"[Function"+(jr?": "+jr:" (anonymous)")+"]"+(Hr.length>0?" { "+$.call(Hr,", ")+" }":"")}if(k(n)){var Kr=U?A.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):G.call(n);return typeof n=="object"&&!U?Re(Kr):Kr}if(an(n)){for(var $e="<"+O.call(String(n.nodeName)),Ue=n.attributes||[],_e=0;_e<Ue.length;_e++)$e+=" "+Ue[_e].name+"="+ue(ae(Ue[_e].value),"double",I);return $e+=">",n.childNodes&&n.childNodes.length&&($e+="..."),$e+="</"+O.call(String(n.nodeName))+">",$e}if(fe(n)){if(n.length===0)return"[]";var Le=Ie(n,Z);return be&&!un(Le)?"["+Ce(Le,be)+"]":"[ "+$.call(Le,", ")+" ]"}if(D(n)){var We=Ie(n,Z);return!("cause"in Error.prototype)&&"cause"in n&&!re.call(n,"cause")?"{ ["+String(n)+"] "+$.call(E.call("[cause]: "+Z(n.cause),We),", ")+" }":We.length===0?"["+String(n)+"]":"{ ["+String(n)+"] "+$.call(We,", ")+" }"}if(typeof n=="object"&&se){if(ye&&typeof n[ye]=="function"&&z)return z(n,{depth:Be-T});if(se!=="symbol"&&typeof n.inspect=="function")return n.inspect()}if(X(n)){var zr=[];return o&&o.call(n,function(we,De){zr.push(Z(De,n,!0)+" => "+Z(we,n))}),kr("Map",i.call(n),zr,be)}if(Se(n)){var Vr=[];return c&&c.call(n,function(we){Vr.push(Z(we,n))}),kr("Set",b.call(n),Vr,be)}if(ge(n))return Te("WeakMap");if(nn(n))return Te("WeakSet");if(me(n))return Te("WeakRef");if(x(n))return Re(Z(Number(n)));if(J(n))return Re(Z(M.call(n)));if(L(n))return Re(g.call(n));if(B(n))return Re(Z(String(n)));if(typeof window<"u"&&n===window)return"{ [object Window] }";if(typeof globalThis<"u"&&n===globalThis||typeof Xr<"u"&&n===Xr)return"{ [object globalThis] }";if(!le(n)&&!W(n)){var Ge=Ie(n,Z),Qr=te?te(n)===Object.prototype:n instanceof Object||n.constructor===Object,ke=n instanceof Object?"":"null prototype",Jr=!Qr&&K&&Object(n)===n&&K in n?y.call(Y(n),8,-1):ke?"Object":"",ln=Qr||typeof n.constructor!="function"?"":n.constructor.name?n.constructor.name+" ":"",je=ln+(Jr||ke?"["+$.call(E.call([],Jr||[],ke||[]),": ")+"] ":"");return Ge.length===0?je+"{}":be?je+"{"+Ce(Ge,be)+"}":je+"{ "+$.call(Ge,", ")+" }"}return String(n)};function ue(r,n,F){var T=F.quoteStyle||n,C=ie[T];return C+r+C}function ae(r){return A.call(String(r),/"/g,"&quot;")}function Q(r){return!K||!(typeof r=="object"&&(K in r||typeof r[K]<"u"))}function fe(r){return Y(r)==="[object Array]"&&Q(r)}function le(r){return Y(r)==="[object Date]"&&Q(r)}function W(r){return Y(r)==="[object RegExp]"&&Q(r)}function D(r){return Y(r)==="[object Error]"&&Q(r)}function B(r){return Y(r)==="[object String]"&&Q(r)}function x(r){return Y(r)==="[object Number]"&&Q(r)}function L(r){return Y(r)==="[object Boolean]"&&Q(r)}function k(r){if(U)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!G)return!1;try{return G.call(r),!0}catch{}return!1}function J(r){if(!r||typeof r!="object"||!M)return!1;try{return M.call(r),!0}catch{}return!1}var j=Object.prototype.hasOwnProperty||function(r){return r in this};function H(r,n){return j.call(r,n)}function Y(r){return w.call(r)}function he(r){if(r.name)return r.name;var n=s.call(l.call(r),/^function\s*([\w$]+)/);return n?n[1]:null}function ce(r,n){if(r.indexOf)return r.indexOf(n);for(var F=0,T=r.length;F<T;F++)if(r[F]===n)return F;return-1}function X(r){if(!i||!r||typeof r!="object")return!1;try{i.call(r);try{b.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function ge(r){if(!m||!r||typeof r!="object")return!1;try{m.call(r,m);try{f.call(r,f)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function me(r){if(!u||!r||typeof r!="object")return!1;try{return u.call(r),!0}catch{}return!1}function Se(r){if(!b||!r||typeof r!="object")return!1;try{b.call(r);try{i.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function nn(r){if(!f||!r||typeof r!="object")return!1;try{f.call(r,f);try{m.call(r,m)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function an(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Gr(r,n){if(r.length>n.maxStringLength){var F=r.length-n.maxStringLength,T="... "+F+" more character"+(F>1?"s":"");return Gr(y.call(r,0,n.maxStringLength),n)+T}var C=oe[n.quoteStyle||"single"];C.lastIndex=0;var I=A.call(A.call(r,C,"\\$1"),/[\x00-\x1f]/g,on);return ue(I,"single",n)}function on(r){var n=r.charCodeAt(0),F={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return F?"\\"+F:"\\x"+(n<16?"0":"")+S.call(n.toString(16))}function Re(r){return"Object("+r+")"}function Te(r){return r+" { ? }"}function kr(r,n,F,T){var C=T?Ce(F,T):$.call(F,", ");return r+" ("+n+") {"+C+"}"}function un(r){for(var n=0;n<r.length;n++)if(ce(r[n],`
2
+ `)>=0)return!1;return!0}function fn(r,n){var F;if(r.indent===" ")F=" ";else if(typeof r.indent=="number"&&r.indent>0)F=$.call(Array(r.indent+1)," ");else return null;return{base:F,prev:$.call(Array(n+1),F)}}function Ce(r,n){if(r.length===0)return"";var F=`
3
+ `+n.prev+n.base;return F+$.call(r,","+F)+`
4
+ `+n.prev}function Ie(r,n){var F=fe(r),T=[];if(F){T.length=r.length;for(var C=0;C<r.length;C++)T[C]=H(r,C)?n(r[C],r):""}var I=typeof R=="function"?R(r):[],se;if(U){se={};for(var de=0;de<I.length;de++)se["$"+I[de]]=I[de]}for(var V in r)H(r,V)&&(F&&String(Number(V))===V&&V<r.length||U&&se["$"+V]instanceof Symbol||(P.call(/[^\w$]/,V)?T.push(n(V,r)+": "+n(r[V],r)):T.push(V+": "+n(r[V],r))));if(typeof R=="function")for(var pe=0;pe<I.length;pe++)re.call(r,I[pe])&&T.push("["+n(I[pe])+"]: "+n(r[I[pe]],r));return T}return Ke}var ze,rt;function vn(){if(rt)return ze;rt=1;var e=Me(),a=Ee(),i=function(c,p,m){for(var t=c,f;(f=t.next)!=null;t=f)if(f.key===p)return t.next=f.next,m||(f.next=c.next,c.next=f),f},o=function(c,p){if(c){var m=i(c,p);return m&&m.value}},d=function(c,p,m){var t=i(c,p);t?t.value=m:c.next={key:p,next:c.next,value:m}},v=function(c,p){return c?!!i(c,p):!1},b=function(c,p){if(c)return i(c,p,!0)};return ze=function(){var p,m={assert:function(t){if(!m.has(t))throw new a("Side channel does not contain "+e(t))},delete:function(t){var f=p&&p.next,h=b(p,t);return h&&f&&f===h&&(p=void 0),!!h},get:function(t){return o(p,t)},has:function(t){return v(p,t)},set:function(t,f){p||(p={next:void 0}),d(p,t,f)}};return m},ze}var Ve,tt;function Ht(){return tt||(tt=1,Ve=Object),Ve}var Qe,nt;function hn(){return nt||(nt=1,Qe=Error),Qe}var Je,at;function gn(){return at||(at=1,Je=EvalError),Je}var Ye,it;function mn(){return it||(it=1,Ye=RangeError),Ye}var Xe,ot;function Sn(){return ot||(ot=1,Xe=ReferenceError),Xe}var Ze,ut;function bn(){return ut||(ut=1,Ze=SyntaxError),Ze}var er,ft;function wn(){return ft||(ft=1,er=URIError),er}var rr,lt;function An(){return lt||(lt=1,rr=Math.abs),rr}var tr,ct;function On(){return ct||(ct=1,tr=Math.floor),tr}var nr,st;function Pn(){return st||(st=1,nr=Math.max),nr}var ar,pt;function En(){return pt||(pt=1,ar=Math.min),ar}var ir,yt;function Rn(){return yt||(yt=1,ir=Math.pow),ir}var or,dt;function $n(){return dt||(dt=1,or=Math.round),or}var ur,vt;function qn(){return vt||(vt=1,ur=Number.isNaN||function(a){return a!==a}),ur}var fr,ht;function In(){if(ht)return fr;ht=1;var e=qn();return fr=function(i){return e(i)||i===0?i:i<0?-1:1},fr}var lr,gt;function _n(){return gt||(gt=1,lr=Object.getOwnPropertyDescriptor),lr}var cr,mt;function Kt(){if(mt)return cr;mt=1;var e=_n();if(e)try{e([],"length")}catch{e=null}return cr=e,cr}var sr,St;function Dn(){if(St)return sr;St=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return sr=e,sr}var pr,bt;function Fn(){return bt||(bt=1,pr=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},i=Symbol("test"),o=Object(i);if(typeof i=="string"||Object.prototype.toString.call(i)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var d=42;a[i]=d;for(var v in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var b=Object.getOwnPropertySymbols(a);if(b.length!==1||b[0]!==i||!Object.prototype.propertyIsEnumerable.call(a,i))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(a,i);if(c.value!==d||c.enumerable!==!0)return!1}return!0}),pr}var yr,wt;function Nn(){if(wt)return yr;wt=1;var e=typeof Symbol<"u"&&Symbol,a=Fn();return yr=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:a()},yr}var dr,At;function zt(){return At||(At=1,dr=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),dr}var vr,Ot;function Vt(){if(Ot)return vr;Ot=1;var e=Ht();return vr=e.getPrototypeOf||null,vr}var hr,Pt;function Mn(){if(Pt)return hr;Pt=1;var e="Function.prototype.bind called on incompatible ",a=Object.prototype.toString,i=Math.max,o="[object Function]",d=function(p,m){for(var t=[],f=0;f<p.length;f+=1)t[f]=p[f];for(var h=0;h<m.length;h+=1)t[h+p.length]=m[h];return t},v=function(p,m){for(var t=[],f=m,h=0;f<p.length;f+=1,h+=1)t[h]=p[f];return t},b=function(c,p){for(var m="",t=0;t<c.length;t+=1)m+=c[t],t+1<c.length&&(m+=p);return m};return hr=function(p){var m=this;if(typeof m!="function"||a.apply(m)!==o)throw new TypeError(e+m);for(var t=v(arguments,1),f,h=function(){if(this instanceof f){var s=m.apply(this,d(t,arguments));return Object(s)===s?s:this}return m.apply(p,d(t,arguments))},u=i(0,m.length-t.length),g=[],w=0;w<u;w++)g[w]="$"+w;if(f=Function("binder","return function ("+b(g,",")+"){ return binder.apply(this,arguments); }")(h),m.prototype){var l=function(){};l.prototype=m.prototype,f.prototype=new l,l.prototype=null}return f},hr}var gr,Et;function xe(){if(Et)return gr;Et=1;var e=Mn();return gr=Function.prototype.bind||e,gr}var mr,Rt;function Cr(){return Rt||(Rt=1,mr=Function.prototype.call),mr}var Sr,$t;function Qt(){return $t||($t=1,Sr=Function.prototype.apply),Sr}var br,qt;function xn(){return qt||(qt=1,br=typeof Reflect<"u"&&Reflect&&Reflect.apply),br}var wr,It;function Tn(){if(It)return wr;It=1;var e=xe(),a=Qt(),i=Cr(),o=xn();return wr=o||e.call(i,a),wr}var Ar,_t;function Jt(){if(_t)return Ar;_t=1;var e=xe(),a=Ee(),i=Cr(),o=Tn();return Ar=function(v){if(v.length<1||typeof v[0]!="function")throw new a("a function is required");return o(e,i,v)},Ar}var Or,Dt;function Cn(){if(Dt)return Or;Dt=1;var e=Jt(),a=Kt(),i;try{i=[].__proto__===Array.prototype}catch(b){if(!b||typeof b!="object"||!("code"in b)||b.code!=="ERR_PROTO_ACCESS")throw b}var o=!!i&&a&&a(Object.prototype,"__proto__"),d=Object,v=d.getPrototypeOf;return Or=o&&typeof o.get=="function"?e([o.get]):typeof v=="function"?function(c){return v(c==null?c:d(c))}:!1,Or}var Pr,Ft;function Bn(){if(Ft)return Pr;Ft=1;var e=zt(),a=Vt(),i=Cn();return Pr=e?function(d){return e(d)}:a?function(d){if(!d||typeof d!="object"&&typeof d!="function")throw new TypeError("getProto: not an object");return a(d)}:i?function(d){return i(d)}:null,Pr}var Er,Nt;function Un(){if(Nt)return Er;Nt=1;var e=Function.prototype.call,a=Object.prototype.hasOwnProperty,i=xe();return Er=i.call(e,a),Er}var Rr,Mt;function Br(){if(Mt)return Rr;Mt=1;var e,a=Ht(),i=hn(),o=gn(),d=mn(),v=Sn(),b=bn(),c=Ee(),p=wn(),m=An(),t=On(),f=Pn(),h=En(),u=Rn(),g=$n(),w=In(),l=Function,s=function(W){try{return l('"use strict"; return ('+W+").constructor;")()}catch{}},y=Kt(),A=Dn(),S=function(){throw new c},O=y?(function(){try{return arguments.callee,S}catch{try{return y(arguments,"callee").get}catch{return S}}})():S,P=Nn()(),E=Bn(),$=Vt(),N=zt(),q=Qt(),M=Cr(),R={},G=typeof Uint8Array>"u"||!E?e:E(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":P&&E?E([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":R,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":P&&E?E(E([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!P||!E?e:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":a,"%Object.getOwnPropertyDescriptor%":y,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":d,"%ReferenceError%":v,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!P||!E?e:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":P&&E?E(""[Symbol.iterator]()):e,"%Symbol%":P?Symbol:e,"%SyntaxError%":b,"%ThrowTypeError%":O,"%TypedArray%":G,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":p,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":M,"%Function.prototype.apply%":q,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":$,"%Math.abs%":m,"%Math.floor%":t,"%Math.max%":f,"%Math.min%":h,"%Math.pow%":u,"%Math.round%":g,"%Math.sign%":w,"%Reflect.getPrototypeOf%":N};if(E)try{null.error}catch(W){var K=E(E(W));U["%Error.prototype%"]=K}var re=function W(D){var B;if(D==="%AsyncFunction%")B=s("async function () {}");else if(D==="%GeneratorFunction%")B=s("function* () {}");else if(D==="%AsyncGeneratorFunction%")B=s("async function* () {}");else if(D==="%AsyncGenerator%"){var x=W("%AsyncGeneratorFunction%");x&&(B=x.prototype)}else if(D==="%AsyncIteratorPrototype%"){var L=W("%AsyncGenerator%");L&&E&&(B=E(L.prototype))}return U[D]=B,B},te={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=xe(),z=Un(),ne=_.call(M,Array.prototype.concat),ye=_.call(q,Array.prototype.splice),ie=_.call(M,String.prototype.replace),oe=_.call(M,String.prototype.slice),ue=_.call(M,RegExp.prototype.exec),ae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q=/\\(\\)?/g,fe=function(D){var B=oe(D,0,1),x=oe(D,-1);if(B==="%"&&x!=="%")throw new b("invalid intrinsic syntax, expected closing `%`");if(x==="%"&&B!=="%")throw new b("invalid intrinsic syntax, expected opening `%`");var L=[];return ie(D,ae,function(k,J,j,H){L[L.length]=j?ie(H,Q,"$1"):J||k}),L},le=function(D,B){var x=D,L;if(z(te,x)&&(L=te[x],x="%"+L[0]+"%"),z(U,x)){var k=U[x];if(k===R&&(k=re(x)),typeof k>"u"&&!B)throw new c("intrinsic "+D+" exists, but is not available. Please file an issue!");return{alias:L,name:x,value:k}}throw new b("intrinsic "+D+" does not exist!")};return Rr=function(D,B){if(typeof D!="string"||D.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof B!="boolean")throw new c('"allowMissing" argument must be a boolean');if(ue(/^%?[^%]*%?$/,D)===null)throw new b("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var x=fe(D),L=x.length>0?x[0]:"",k=le("%"+L+"%",B),J=k.name,j=k.value,H=!1,Y=k.alias;Y&&(L=Y[0],ye(x,ne([0,1],Y)));for(var he=1,ce=!0;he<x.length;he+=1){var X=x[he],ge=oe(X,0,1),me=oe(X,-1);if((ge==='"'||ge==="'"||ge==="`"||me==='"'||me==="'"||me==="`")&&ge!==me)throw new b("property names with quotes must have matching quotes");if((X==="constructor"||!ce)&&(H=!0),L+="."+X,J="%"+L+"%",z(U,J))j=U[J];else if(j!=null){if(!(X in j)){if(!B)throw new c("base intrinsic for "+D+" exists, but the property is not available.");return}if(y&&he+1>=x.length){var Se=y(j,X);ce=!!Se,ce&&"get"in Se&&!("originalValue"in Se.get)?j=Se.get:j=j[X]}else ce=z(j,X),j=j[X];ce&&!H&&(U[J]=j)}}return j},Rr}var $r,xt;function Yt(){if(xt)return $r;xt=1;var e=Br(),a=Jt(),i=a([e("%String.prototype.indexOf%")]);return $r=function(d,v){var b=e(d,!!v);return typeof b=="function"&&i(d,".prototype.")>-1?a([b]):b},$r}var qr,Tt;function Xt(){if(Tt)return qr;Tt=1;var e=Br(),a=Yt(),i=Me(),o=Ee(),d=e("%Map%",!0),v=a("Map.prototype.get",!0),b=a("Map.prototype.set",!0),c=a("Map.prototype.has",!0),p=a("Map.prototype.delete",!0),m=a("Map.prototype.size",!0);return qr=!!d&&function(){var f,h={assert:function(u){if(!h.has(u))throw new o("Side channel does not contain "+i(u))},delete:function(u){if(f){var g=p(f,u);return m(f)===0&&(f=void 0),g}return!1},get:function(u){if(f)return v(f,u)},has:function(u){return f?c(f,u):!1},set:function(u,g){f||(f=new d),b(f,u,g)}};return h},qr}var Ir,Ct;function Ln(){if(Ct)return Ir;Ct=1;var e=Br(),a=Yt(),i=Me(),o=Xt(),d=Ee(),v=e("%WeakMap%",!0),b=a("WeakMap.prototype.get",!0),c=a("WeakMap.prototype.set",!0),p=a("WeakMap.prototype.has",!0),m=a("WeakMap.prototype.delete",!0);return Ir=v?function(){var f,h,u={assert:function(g){if(!u.has(g))throw new d("Side channel does not contain "+i(g))},delete:function(g){if(v&&g&&(typeof g=="object"||typeof g=="function")){if(f)return m(f,g)}else if(o&&h)return h.delete(g);return!1},get:function(g){return v&&g&&(typeof g=="object"||typeof g=="function")&&f?b(f,g):h&&h.get(g)},has:function(g){return v&&g&&(typeof g=="object"||typeof g=="function")&&f?p(f,g):!!h&&h.has(g)},set:function(g,w){v&&g&&(typeof g=="object"||typeof g=="function")?(f||(f=new v),c(f,g,w)):o&&(h||(h=o()),h.set(g,w))}};return u}:o,Ir}var _r,Bt;function Wn(){if(Bt)return _r;Bt=1;var e=Ee(),a=Me(),i=vn(),o=Xt(),d=Ln(),v=d||o||i;return _r=function(){var c,p={assert:function(m){if(!p.has(m))throw new e("Side channel does not contain "+a(m))},delete:function(m){return!!c&&c.delete(m)},get:function(m){return c&&c.get(m)},has:function(m){return!!c&&c.has(m)},set:function(m,t){c||(c=v()),c.set(m,t)}};return p},_r}var Dr,Ut;function Ur(){if(Ut)return Dr;Ut=1;var e=String.prototype.replace,a=/%20/g,i={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Dr={default:i.RFC3986,formatters:{RFC1738:function(o){return e.call(o,a,"+")},RFC3986:function(o){return String(o)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986},Dr}var Fr,Lt;function Zt(){if(Lt)return Fr;Lt=1;var e=Ur(),a=Object.prototype.hasOwnProperty,i=Array.isArray,o=(function(){for(var l=[],s=0;s<256;++s)l.push("%"+((s<16?"0":"")+s.toString(16)).toUpperCase());return l})(),d=function(s){for(;s.length>1;){var y=s.pop(),A=y.obj[y.prop];if(i(A)){for(var S=[],O=0;O<A.length;++O)typeof A[O]<"u"&&S.push(A[O]);y.obj[y.prop]=S}}},v=function(s,y){for(var A=y&&y.plainObjects?{__proto__:null}:{},S=0;S<s.length;++S)typeof s[S]<"u"&&(A[S]=s[S]);return A},b=function l(s,y,A){if(!y)return s;if(typeof y!="object"&&typeof y!="function"){if(i(s))s.push(y);else if(s&&typeof s=="object")(A&&(A.plainObjects||A.allowPrototypes)||!a.call(Object.prototype,y))&&(s[y]=!0);else return[s,y];return s}if(!s||typeof s!="object")return[s].concat(y);var S=s;return i(s)&&!i(y)&&(S=v(s,A)),i(s)&&i(y)?(y.forEach(function(O,P){if(a.call(s,P)){var E=s[P];E&&typeof E=="object"&&O&&typeof O=="object"?s[P]=l(E,O,A):s.push(O)}else s[P]=O}),s):Object.keys(y).reduce(function(O,P){var E=y[P];return a.call(O,P)?O[P]=l(O[P],E,A):O[P]=E,O},S)},c=function(s,y){return Object.keys(y).reduce(function(A,S){return A[S]=y[S],A},s)},p=function(l,s,y){var A=l.replace(/\+/g," ");if(y==="iso-8859-1")return A.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(A)}catch{return A}},m=1024,t=function(s,y,A,S,O){if(s.length===0)return s;var P=s;if(typeof s=="symbol"?P=Symbol.prototype.toString.call(s):typeof s!="string"&&(P=String(s)),A==="iso-8859-1")return escape(P).replace(/%u[0-9a-f]{4}/gi,function(G){return"%26%23"+parseInt(G.slice(2),16)+"%3B"});for(var E="",$=0;$<P.length;$+=m){for(var N=P.length>=m?P.slice($,$+m):P,q=[],M=0;M<N.length;++M){var R=N.charCodeAt(M);if(R===45||R===46||R===95||R===126||R>=48&&R<=57||R>=65&&R<=90||R>=97&&R<=122||O===e.RFC1738&&(R===40||R===41)){q[q.length]=N.charAt(M);continue}if(R<128){q[q.length]=o[R];continue}if(R<2048){q[q.length]=o[192|R>>6]+o[128|R&63];continue}if(R<55296||R>=57344){q[q.length]=o[224|R>>12]+o[128|R>>6&63]+o[128|R&63];continue}M+=1,R=65536+((R&1023)<<10|N.charCodeAt(M)&1023),q[q.length]=o[240|R>>18]+o[128|R>>12&63]+o[128|R>>6&63]+o[128|R&63]}E+=q.join("")}return E},f=function(s){for(var y=[{obj:{o:s},prop:"o"}],A=[],S=0;S<y.length;++S)for(var O=y[S],P=O.obj[O.prop],E=Object.keys(P),$=0;$<E.length;++$){var N=E[$],q=P[N];typeof q=="object"&&q!==null&&A.indexOf(q)===-1&&(y.push({obj:P,prop:N}),A.push(q))}return d(y),s},h=function(s){return Object.prototype.toString.call(s)==="[object RegExp]"},u=function(s){return!s||typeof s!="object"?!1:!!(s.constructor&&s.constructor.isBuffer&&s.constructor.isBuffer(s))},g=function(s,y){return[].concat(s,y)},w=function(s,y){if(i(s)){for(var A=[],S=0;S<s.length;S+=1)A.push(y(s[S]));return A}return y(s)};return Fr={arrayToObject:v,assign:c,combine:g,compact:f,decode:p,encode:t,isBuffer:u,isRegExp:h,maybeMap:w,merge:b},Fr}var Nr,Wt;function Gn(){if(Wt)return Nr;Wt=1;var e=Wn(),a=Zt(),i=Ur(),o=Object.prototype.hasOwnProperty,d={brackets:function(l){return l+"[]"},comma:"comma",indices:function(l,s){return l+"["+s+"]"},repeat:function(l){return l}},v=Array.isArray,b=Array.prototype.push,c=function(w,l){b.apply(w,v(l)?l:[l])},p=Date.prototype.toISOString,m=i.default,t={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:a.encode,encodeValuesOnly:!1,filter:void 0,format:m,formatter:i.formatters[m],indices:!1,serializeDate:function(l){return p.call(l)},skipNulls:!1,strictNullHandling:!1},f=function(l){return typeof l=="string"||typeof l=="number"||typeof l=="boolean"||typeof l=="symbol"||typeof l=="bigint"},h={},u=function w(l,s,y,A,S,O,P,E,$,N,q,M,R,G,U,K,re,te){for(var _=l,z=te,ne=0,ye=!1;(z=z.get(h))!==void 0&&!ye;){var ie=z.get(l);if(ne+=1,typeof ie<"u"){if(ie===ne)throw new RangeError("Cyclic object value");ye=!0}typeof z.get(h)>"u"&&(ne=0)}if(typeof N=="function"?_=N(s,_):_ instanceof Date?_=R(_):y==="comma"&&v(_)&&(_=a.maybeMap(_,function(J){return J instanceof Date?R(J):J})),_===null){if(O)return $&&!K?$(s,t.encoder,re,"key",G):s;_=""}if(f(_)||a.isBuffer(_)){if($){var oe=K?s:$(s,t.encoder,re,"key",G);return[U(oe)+"="+U($(_,t.encoder,re,"value",G))]}return[U(s)+"="+U(String(_))]}var ue=[];if(typeof _>"u")return ue;var ae;if(y==="comma"&&v(_))K&&$&&(_=a.maybeMap(_,$)),ae=[{value:_.length>0?_.join(",")||null:void 0}];else if(v(N))ae=N;else{var Q=Object.keys(_);ae=q?Q.sort(q):Q}var fe=E?String(s).replace(/\./g,"%2E"):String(s),le=A&&v(_)&&_.length===1?fe+"[]":fe;if(S&&v(_)&&_.length===0)return le+"[]";for(var W=0;W<ae.length;++W){var D=ae[W],B=typeof D=="object"&&D&&typeof D.value<"u"?D.value:_[D];if(!(P&&B===null)){var x=M&&E?String(D).replace(/\./g,"%2E"):String(D),L=v(_)?typeof y=="function"?y(le,x):le:le+(M?"."+x:"["+x+"]");te.set(l,ne);var k=e();k.set(h,te),c(ue,w(B,L,y,A,S,O,P,E,y==="comma"&&K&&v(_)?null:$,N,q,M,R,G,U,K,re,k))}}return ue},g=function(l){if(!l)return t;if(typeof l.allowEmptyArrays<"u"&&typeof l.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof l.encodeDotInKeys<"u"&&typeof l.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(l.encoder!==null&&typeof l.encoder<"u"&&typeof l.encoder!="function")throw new TypeError("Encoder has to be a function.");var s=l.charset||t.charset;if(typeof l.charset<"u"&&l.charset!=="utf-8"&&l.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=i.default;if(typeof l.format<"u"){if(!o.call(i.formatters,l.format))throw new TypeError("Unknown format option provided.");y=l.format}var A=i.formatters[y],S=t.filter;(typeof l.filter=="function"||v(l.filter))&&(S=l.filter);var O;if(l.arrayFormat in d?O=l.arrayFormat:"indices"in l?O=l.indices?"indices":"repeat":O=t.arrayFormat,"commaRoundTrip"in l&&typeof l.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var P=typeof l.allowDots>"u"?l.encodeDotInKeys===!0?!0:t.allowDots:!!l.allowDots;return{addQueryPrefix:typeof l.addQueryPrefix=="boolean"?l.addQueryPrefix:t.addQueryPrefix,allowDots:P,allowEmptyArrays:typeof l.allowEmptyArrays=="boolean"?!!l.allowEmptyArrays:t.allowEmptyArrays,arrayFormat:O,charset:s,charsetSentinel:typeof l.charsetSentinel=="boolean"?l.charsetSentinel:t.charsetSentinel,commaRoundTrip:!!l.commaRoundTrip,delimiter:typeof l.delimiter>"u"?t.delimiter:l.delimiter,encode:typeof l.encode=="boolean"?l.encode:t.encode,encodeDotInKeys:typeof l.encodeDotInKeys=="boolean"?l.encodeDotInKeys:t.encodeDotInKeys,encoder:typeof l.encoder=="function"?l.encoder:t.encoder,encodeValuesOnly:typeof l.encodeValuesOnly=="boolean"?l.encodeValuesOnly:t.encodeValuesOnly,filter:S,format:y,formatter:A,serializeDate:typeof l.serializeDate=="function"?l.serializeDate:t.serializeDate,skipNulls:typeof l.skipNulls=="boolean"?l.skipNulls:t.skipNulls,sort:typeof l.sort=="function"?l.sort:null,strictNullHandling:typeof l.strictNullHandling=="boolean"?l.strictNullHandling:t.strictNullHandling}};return Nr=function(w,l){var s=w,y=g(l),A,S;typeof y.filter=="function"?(S=y.filter,s=S("",s)):v(y.filter)&&(S=y.filter,A=S);var O=[];if(typeof s!="object"||s===null)return"";var P=d[y.arrayFormat],E=P==="comma"&&y.commaRoundTrip;A||(A=Object.keys(s)),y.sort&&A.sort(y.sort);for(var $=e(),N=0;N<A.length;++N){var q=A[N],M=s[q];y.skipNulls&&M===null||c(O,u(M,q,P,E,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,$))}var R=O.join(y.delimiter),G=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?G+="utf8=%26%2310003%3B&":G+="utf8=%E2%9C%93&"),R.length>0?G+R:""},Nr}var Mr,Gt;function kn(){if(Gt)return Mr;Gt=1;var e=Zt(),a=Object.prototype.hasOwnProperty,i=Array.isArray,o={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},d=function(h){return h.replace(/&#(\d+);/g,function(u,g){return String.fromCharCode(parseInt(g,10))})},v=function(h,u,g){if(h&&typeof h=="string"&&u.comma&&h.indexOf(",")>-1)return h.split(",");if(u.throwOnLimitExceeded&&g>=u.arrayLimit)throw new RangeError("Array limit exceeded. Only "+u.arrayLimit+" element"+(u.arrayLimit===1?"":"s")+" allowed in an array.");return h},b="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",p=function(u,g){var w={__proto__:null},l=g.ignoreQueryPrefix?u.replace(/^\?/,""):u;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=g.parameterLimit===1/0?void 0:g.parameterLimit,y=l.split(g.delimiter,g.throwOnLimitExceeded?s+1:s);if(g.throwOnLimitExceeded&&y.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var A=-1,S,O=g.charset;if(g.charsetSentinel)for(S=0;S<y.length;++S)y[S].indexOf("utf8=")===0&&(y[S]===c?O="utf-8":y[S]===b&&(O="iso-8859-1"),A=S,S=y.length);for(S=0;S<y.length;++S)if(S!==A){var P=y[S],E=P.indexOf("]="),$=E===-1?P.indexOf("="):E+1,N,q;$===-1?(N=g.decoder(P,o.decoder,O,"key"),q=g.strictNullHandling?null:""):(N=g.decoder(P.slice(0,$),o.decoder,O,"key"),q=e.maybeMap(v(P.slice($+1),g,i(w[N])?w[N].length:0),function(R){return g.decoder(R,o.decoder,O,"value")})),q&&g.interpretNumericEntities&&O==="iso-8859-1"&&(q=d(String(q))),P.indexOf("[]=")>-1&&(q=i(q)?[q]:q);var M=a.call(w,N);M&&g.duplicates==="combine"?w[N]=e.combine(w[N],q):(!M||g.duplicates==="last")&&(w[N]=q)}return w},m=function(h,u,g,w){var l=0;if(h.length>0&&h[h.length-1]==="[]"){var s=h.slice(0,-1).join("");l=Array.isArray(u)&&u[s]?u[s].length:0}for(var y=w?u:v(u,g,l),A=h.length-1;A>=0;--A){var S,O=h[A];if(O==="[]"&&g.parseArrays)S=g.allowEmptyArrays&&(y===""||g.strictNullHandling&&y===null)?[]:e.combine([],y);else{S=g.plainObjects?{__proto__:null}:{};var P=O.charAt(0)==="["&&O.charAt(O.length-1)==="]"?O.slice(1,-1):O,E=g.decodeDotInKeys?P.replace(/%2E/g,"."):P,$=parseInt(E,10);!g.parseArrays&&E===""?S={0:y}:!isNaN($)&&O!==E&&String($)===E&&$>=0&&g.parseArrays&&$<=g.arrayLimit?(S=[],S[$]=y):E!=="__proto__"&&(S[E]=y)}y=S}return y},t=function(u,g,w,l){if(u){var s=w.allowDots?u.replace(/\.([^.[]+)/g,"[$1]"):u,y=/(\[[^[\]]*])/,A=/(\[[^[\]]*])/g,S=w.depth>0&&y.exec(s),O=S?s.slice(0,S.index):s,P=[];if(O){if(!w.plainObjects&&a.call(Object.prototype,O)&&!w.allowPrototypes)return;P.push(O)}for(var E=0;w.depth>0&&(S=A.exec(s))!==null&&E<w.depth;){if(E+=1,!w.plainObjects&&a.call(Object.prototype,S[1].slice(1,-1))&&!w.allowPrototypes)return;P.push(S[1])}if(S){if(w.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+w.depth+" and strictDepth is true");P.push("["+s.slice(S.index)+"]")}return m(P,g,w,l)}},f=function(u){if(!u)return o;if(typeof u.allowEmptyArrays<"u"&&typeof u.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof u.decodeDotInKeys<"u"&&typeof u.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(u.decoder!==null&&typeof u.decoder<"u"&&typeof u.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof u.charset<"u"&&u.charset!=="utf-8"&&u.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof u.throwOnLimitExceeded<"u"&&typeof u.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var g=typeof u.charset>"u"?o.charset:u.charset,w=typeof u.duplicates>"u"?o.duplicates:u.duplicates;if(w!=="combine"&&w!=="first"&&w!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var l=typeof u.allowDots>"u"?u.decodeDotInKeys===!0?!0:o.allowDots:!!u.allowDots;return{allowDots:l,allowEmptyArrays:typeof u.allowEmptyArrays=="boolean"?!!u.allowEmptyArrays:o.allowEmptyArrays,allowPrototypes:typeof u.allowPrototypes=="boolean"?u.allowPrototypes:o.allowPrototypes,allowSparse:typeof u.allowSparse=="boolean"?u.allowSparse:o.allowSparse,arrayLimit:typeof u.arrayLimit=="number"?u.arrayLimit:o.arrayLimit,charset:g,charsetSentinel:typeof u.charsetSentinel=="boolean"?u.charsetSentinel:o.charsetSentinel,comma:typeof u.comma=="boolean"?u.comma:o.comma,decodeDotInKeys:typeof u.decodeDotInKeys=="boolean"?u.decodeDotInKeys:o.decodeDotInKeys,decoder:typeof u.decoder=="function"?u.decoder:o.decoder,delimiter:typeof u.delimiter=="string"||e.isRegExp(u.delimiter)?u.delimiter:o.delimiter,depth:typeof u.depth=="number"||u.depth===!1?+u.depth:o.depth,duplicates:w,ignoreQueryPrefix:u.ignoreQueryPrefix===!0,interpretNumericEntities:typeof u.interpretNumericEntities=="boolean"?u.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:typeof u.parameterLimit=="number"?u.parameterLimit:o.parameterLimit,parseArrays:u.parseArrays!==!1,plainObjects:typeof u.plainObjects=="boolean"?u.plainObjects:o.plainObjects,strictDepth:typeof u.strictDepth=="boolean"?!!u.strictDepth:o.strictDepth,strictNullHandling:typeof u.strictNullHandling=="boolean"?u.strictNullHandling:o.strictNullHandling,throwOnLimitExceeded:typeof u.throwOnLimitExceeded=="boolean"?u.throwOnLimitExceeded:!1}};return Mr=function(h,u){var g=f(u);if(h===""||h===null||typeof h>"u")return g.plainObjects?{__proto__:null}:{};for(var w=typeof h=="string"?p(h,g):h,l=g.plainObjects?{__proto__:null}:{},s=Object.keys(w),y=0;y<s.length;++y){var A=s[y],S=t(A,w[A],g,typeof h=="string");l=e.merge(l,S,g)}return g.allowSparse===!0?l:e.compact(l)},Mr}var xr,kt;function jn(){if(kt)return xr;kt=1;var e=Gn(),a=kn(),i=Ur();return xr={formats:i,parse:a,stringify:e},xr}var en=jn();function ee(e){return encodeURIComponent(e).replace(/[!'()*]/g,a=>`%${a.charCodeAt(0).toString(16)}`)}function Fe(e){return!isNaN(Date.parse(e))}function Hn(e){const a=new URLSearchParams;for(const[i,o]of e)a.append(i,o);return a.toString()}function Kn(e){const a=Hn(e);return en.parse(a)}function zn(e){return Array.from(new Set(e))}function Lr(e,a){const i={...e};for(const o in a)if(Object.prototype.hasOwnProperty.call(a,o)){const d=a[o],v=e[o];if(d===void 0)continue;jt(d)&&jt(v)?i[o]=Lr(v,d):i[o]=d}return i}function jt(e){if(typeof e!="object"||e===null||Array.isArray(e)||e instanceof Date||e instanceof RegExp)return!1;const a=Object.getPrototypeOf(e);return a===null||a===Object.prototype}const rn={bid:"bid",cid:"cid",eid:"eid",uid:"uid",utid:"utid",tag:"tag",field:"field",span:"-",page:"page",order:"order",limit:"limit",keyword:"keyword",admin:"admin",tpl:"tpl",api:"api"};function Pe(e){function a(p){return p<10?`0${p}`:p}const i=e.getFullYear(),o=a(e.getMonth()+1),d=a(e.getDate()),v=a(e.getHours()),b=a(e.getMinutes()),c=a(e.getSeconds());return`${i}-${o}-${d} ${v}:${b}:${c}`}function tn(e){e.startsWith("/")&&(e=e.substring(1));const a=[];let i="",o=!1;for(let d=0;d<e.length;d++){const v=e[d];v==="\\"&&!o?(o=!0,i+=v):v==="/"&&!o?(a.push(i),i=""):(i+=v,o=!1)}return i.length>0&&a.push(i),a}function Vn(e){return"blog"in e||"category"in e||"entry"in e||"user"in e||"unit"in e}function Qn(e){return{blog:e.bid,category:e.cid,entry:e.eid,user:e.uid,unit:e.utid,tag:e.tag,field:e.field,span:e.span,date:e.date,page:e.page,order:e.order,limit:e.limit,keyword:e.keyword,admin:e.admin,tpl:e.tpl,api:e.api,searchParams:e.searchParams}}function Jn(e){return e<10?`0${e}`:e}const Yn={segments:rn,apiVersion:"v2"};function Xn(e,a={}){const i=Vn(e)?e:Qn(e),{segments:o,apiVersion:d}=Lr(Yn,a);let v=["blog","admin","category","entry","user","unit","span","date","keyword","tag","field","page","order","limit","tpl","api"].reduce((c,p)=>{const m=i[p];if(m==null)return c;if(p==="blog"){const t=i[p];return Ae.isNumber(t)?isNaN(t)||t===0?c:`${c}/${o.bid}/${t}`:t===""?c:`${c}/${t.split("/").map(ee).join("/")}`}if(p==="category"){const t=i[p];return Ae.isNumber(t)?isNaN(t)||t===0?c:`${c}/${o.cid}/${t}`:Array.isArray(t)?`${c}/${t.map(ee).join("/")}`:t===""?c:`${c}/${ee(t)}`}if(p==="entry"){const t=i[p];return Ae.isNumber(t)?isNaN(t)||t===0?c:`${c}/${o.eid}/${t}`:t===""?c:`${c}/${ee(t)}`}if(p==="user"){const t=i[p];return isNaN(t)||t===0?c:`${c}/${o.uid}/${t}`}if(p==="unit"){const t=i[p];return t===""?c:`${c}/${o.utid}/${t}`}if(p==="field"){const t=i[p],f=typeof t!="string"?t.toString():t;return f===""?c:`${c}/${o.field}/${f.split("/").map(ee).join("/")}`}if(p==="span"){const t=i[p],{start:f,end:h}={start:"1000-01-01 00:00:00",end:"9999-12-31 23:59:59",...t};if(Ae.isString(f)&&!Fe(f))throw new Error(`Invalid start date: ${f}`);if(Ae.isString(h)&&!Fe(h))throw new Error(`Invalid end date: ${h}`);return`${c}/${ee(Pe(new Date(f)))}/${o.span}/${ee(Pe(new Date(h)))}`}if(p==="date"){if(i.span!=null)return c;const t=i[p],{year:f,month:h,day:u}=t;return[f,h,u].reduce((g,w)=>w==null||isNaN(w)?g:`${g}/${Jn(w)}`,c)}if(p==="page"){const t=i[p];return isNaN(t)||t===0||t===1?c:`${c}/${o.page}/${t}`}if(p==="tpl"){const t=i[p];return t===""?c:`${c}/${o.tpl}/${t.split("/").map(ee).join("/")}`}if(p==="api"){const t=i[p];if(t==="")return c;const f=d==="v1"?"":`/${d}`;return`${c}/${o.api}${f}/${ee(t)}`}return Array.isArray(m)?m.length>0?`${c}/${o[p]}/${m.map(ee).join("/")}`:c:m!==""?Ae.isNumber(m)&&isNaN(m)?c:`${c}/${o[p]}/${ee(m)}`:c},"");/\.[^/.]+$/.test(v)||(v+="/");const b=i.searchParams instanceof URLSearchParams?i.searchParams.toString():en.stringify(i.searchParams,{format:"RFC1738"});return b.length>0&&(v+=`?${b}`),v.startsWith("/")?v.slice(1):v}function Oe(e){return typeof e=="string"&&["and","or"].includes(e)}function qe(e){return typeof e=="string"&&["eq","neq","gt","lt","gte","lte","lk","nlk","re","nre","em","nem"].includes(e)}function Ne(e){return typeof e=="string"&&["_and_","_or_"].includes(e)}function Wr(e){return typeof e=="object"&&e!==null&&qe(e.operator)&&(typeof e.value=="string"||typeof e.value=="number")&&Oe(e.connector)}function Zn(e){return!(typeof e!="object"||e==null||typeof e.key!="string"||!Array.isArray(e.filters)||!e.filters.every(Wr)||e.separator!==void 0&&!Ne(e.separator))}class ve{fields=[];constructor(a=[]){this.fields=a}push(a){this.fields.push(a)}pop(){return this.fields.pop()}shift(){return this.fields.shift()}unshift(a){this.fields.unshift(a)}getFields(){return this.fields}toString(){const a=[];return this.fields.forEach(i=>{const{key:o,filters:d,separator:v}=i,b=d.map(u=>u.value),c=d.map(u=>u.operator),p=d.map(u=>u.connector),m=Math.max(b.length,c.length,p.length);if(m===0)return;let t=0;const f=[];for(let u=0;u<m;u++){const g=b[u]??"",w=c[u]??"",l=p[u]??"";switch(w){case"eq":case"neq":case"lt":case"lte":case"gt":case"gte":case"lk":case"nlk":case"re":case"nre":if(g!==""){for(let s=0;s<t;s++)f.push("");t=0,l==="or"?(w!=="eq"&&(f.push("or"),f.push(w)),f.push(String(g))):(f.push(w),f.push(String(g)))}else t++;break;case"em":case"nem":for(let s=0;s<t;s++)f.push("");t=0,l==="or"&&f.push("or"),f.push(w);break;default:f.push("")}}const h=[];f.length>0&&(h.push(v??"_and_"),h.push(o),f.forEach(u=>{h.push(u)}),a.push(...h))}),a.length>0&&["_or_","_and_","and"].includes(a[0])&&a.shift(),a.join("/")}static fromString(a){const i=tn(a);let o={},d=null,v=null,b=null,c=null,p=null,m=null;const t=[];for(;i.length>0;){const f=i.shift();if(f!==void 0){if(d===null){d=f,m!=null&&Ne(m)?p=m:p="_and_",t.push({key:d,filters:[],separator:p}),m=null,p=null;continue}if(f===""&&(v===null?(v=null,b=null):b===null&&(b="eq")),b===null){switch(f){case"eq":b=f,v="or";break;case"neq":case"lt":case"lte":case"gt":case"gte":case"lk":case"nlk":case"re":case"nre":b=f;break;case"em":case"nem":b=f,c="";break}if(b!==null&&(v===null&&(v="and"),c===null))continue}if(v===null)if(Oe(f)){v=f;continue}else v="or",b===null&&(b="eq"),c=f;if(c===null)b===null&&(b="eq"),c=f;else if(["and","_and_","_or_"].includes(f)){m=f==="and"?"_and_":f,d=null,v=null,b=null,c=null;continue}if(d!==""){qe(b)&&(o={...o,operator:b}),c!==null&&(o={...o,value:c}),Oe(v)&&(o={...o,connector:v});const h=t.find(u=>u.key===d);h!==void 0&&Wr(o)&&(h.filters=[...h.filters,o])}v=null,b=null,c=null}}return new ve(t)}static fromFormData(a){const i=Kn(a);if(!Array.isArray(i.field))return new ve;if(!i.field.every(v=>typeof v=="string"))return new ve;const d=zn(i.field.filter(v=>v!=="")).map(v=>{const b=`${v}@operator`,c=`${v}@connector`,p=`${v}@separator`,m=v,t=Array.isArray(i[b])?i[b]:[],f=Array.isArray(i[c])?i[c]:[],h=Array.isArray(i[m])?i[m]:[],u=Ne(i[p])?i[p]:"_and_",g=Math.max(t.length,f.length,h.length);if(g===0)return{key:v,filters:[]};let w="and",l="eq";f.length===0&&t.length===0&&(w="or"),f.length>0&&Oe(f[0])&&(w=f[0]),t.length>0&&qe(t[0])&&(l=t[0]);const s=[];for(let y=0;y<g;y++){const A=h[y],S=qe(t[y])?t[y]:l,O=Oe(f[y])?f[y]:w;s.push({value:A,operator:S,connector:O})}return{key:v,filters:s,separator:u}});return new ve(d)}}function Tr(e,a,i){const o=[];for(let d=a;d<e.length&&!i.includes(e[d]);d++)o.push(e[d]);return o.join("/")}function ea(e,a){const i=Fe(e)?Pe(new Date(e)):void 0,o=Fe(a)?Pe(new Date(a)):void 0;return[i,o]}function ra(e){const a=parseInt(e,10);return a>=1e3&&a<=9999}function ta(e){const a=parseInt(e,10);return a>=1&&a<=12}function na(e){const a=parseInt(e,10);return a>=1&&a<=31}function aa(e){let a=new Date(1e3,0,1,0,0,0),i=new Date(9999,11,31,23,59,59);return e.date!==void 0&&(a=new Date(e.date.year,(e.date.month??1)-1,e.date.day??1),i=new Date(e.date.year,(e.date.month??12)-1,e.date.day??31,23,59,59)),{start:Pe(a),end:Pe(i)}}const ia={segments:rn};function oa(e,a={}){const{segments:i}=Lr(ia,a),o=tn(e).filter(p=>p),d={},v=[],b=Object.keys(i),c=Object.values(i);for(let p=0;p<o.length;p++){const m=o[p];if(c.includes(m)){const t=b.find(f=>i[f]===m);if(t!==void 0){const f=o[p+1];if(f!==void 0)switch(t){case"bid":case"uid":case"cid":case"eid":case"page":case"limit":d[t]=parseInt(f,10),p++;break;case"utid":case"admin":case"keyword":case"order":d[t]=f,p++;break;case"api":{if(/^v\d+$/.test(f)){d.apiVersion=f;const h=o[p+2];h!==void 0&&(d.api=h,p+=2)}else d.apiVersion="v1",d.api=f,p++;break}case"tpl":d.tpl=Tr(o,p+1,c),p+=d.tpl.split("/").length;break;case"field":{const h=Tr(o,p+1,c);d.field=ve.fromString(h),p+=h.split("/").length;break}case"tag":d.tag=Tr(o,p+1,c).split("/").map(h=>h.trim()),p+=d.tag.length;break;case"span":{const[h,u]=ea(o[p-1],f);h!==void 0&&u!==void 0&&(d.span={start:h,end:u},v.pop(),p++);break}}}}else v.push(m)}for(let p=0;p<v.length;p++){const m=v[p];if(ra(m)){const t=m,f=v[p+1];if(f!==void 0&&ta(f)){const h=v[p+2];if(h!==void 0&&na(h)){d.date={year:parseInt(t,10),month:parseInt(f,10),day:parseInt(h,10)},v.splice(p,3);continue}d.date={year:parseInt(t,10),month:parseInt(f,10)},v.splice(p,2);continue}d.date={year:parseInt(t,10)},v.splice(p,1);continue}}return d.page===void 0&&(d.page=1),d.span===void 0&&(d.span=aa(d)),d.unresolvedPath=v.join("/"),d}exports.AcmsFieldList=ve;exports.acmsPath=Xn;exports.isAcmsField=Zn;exports.isAcmsFilter=Wr;exports.isConnector=Oe;exports.isOperator=qe;exports.isSeparator=Ne;exports.parseAcmsPath=oa;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index-x-5Zn68j.cjs");require("../typeGuard-eqTQ9U-x.cjs");exports.isAcmsFetchError=r.isAcmsFetchError;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index-Bm4C_vR2.cjs");exports.isAcmsFetchError=r.isAcmsFetchError;
@@ -1,79 +1,69 @@
1
- var y = Object.defineProperty;
2
- var U = (r, e, t) => e in r ? y(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var n = (r, e, t) => (U(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { a as P } from "../index-H2fSgwjT.js";
5
- import { p as D } from "../index-H2fSgwjT.js";
6
- import { i as o } from "../typeGuard-Jsany_41.js";
7
- import { A, i as q } from "../index-ZZQxXurp.js";
8
- async function F(r) {
1
+ import { acmsPath as d } from "./acms-path.js";
2
+ import { AcmsFieldList as T, parseAcmsPath as x } from "./acms-path.js";
3
+ import { i as a } from "../typeGuard-CkfEvQcm.js";
4
+ import { A as y, i as U } from "../index-BeSRDPIk.js";
5
+ async function A(r) {
9
6
  try {
10
- const { message: e } = await r.json();
11
- return e ?? null;
7
+ const { message: t } = await r.json();
8
+ return t ?? null;
12
9
  } catch {
13
10
  return null;
14
11
  }
15
12
  }
16
- async function I() {
17
- if (typeof fetch > "u") {
18
- const { default: r } = await import("../browser-ponyfill-EPWIFhDK.js").then((e) => e.b);
19
- return r;
20
- }
13
+ async function P() {
21
14
  return fetch;
22
15
  }
23
- async function O(...r) {
24
- if (typeof Headers > "u") {
25
- const { Headers: e } = await import("../browser-ponyfill-EPWIFhDK.js").then((t) => t.b);
26
- return new e(...r);
27
- }
16
+ async function F(...r) {
28
17
  return new Headers(...r);
29
18
  }
30
- const R = {
19
+ const q = {
31
20
  responseType: "json",
32
21
  acmsPathOptions: {}
33
22
  };
34
- class $ {
23
+ class I {
24
+ baseUrl;
25
+ apiKey;
26
+ config;
35
27
  constructor({
36
- baseUrl: e,
37
- apiKey: t,
38
- ...a
28
+ baseUrl: t,
29
+ apiKey: e,
30
+ ...n
39
31
  }) {
40
- n(this, "baseUrl");
41
- n(this, "apiKey");
42
- n(this, "config");
43
- if (e != null && e === "")
44
- throw new Error("baseUrl is required.");
45
32
  if (t != null && t === "")
33
+ throw new Error("baseUrl is required.");
34
+ if (e != null && e === "")
46
35
  throw new Error("apiKey is required.");
47
- if (!o(e))
36
+ if (!a(t))
48
37
  throw new Error("baseUrl must be string.");
49
- if (!o(t))
38
+ if (!a(e))
50
39
  throw new Error("apiKey must be string.");
51
- this.baseUrl = e, this.apiKey = t, this.config = {
52
- ...R,
53
- ...a
40
+ this.baseUrl = t, this.apiKey = e, this.config = {
41
+ ...q,
42
+ ...n
54
43
  };
55
44
  }
56
- async request(e, t = {}) {
57
- const a = { ...this.config, ...t }, { requestInit: f, responseType: w, acmsPathOptions: m } = a, p = await I(), d = this.createUrl(e, m), g = await this.createFetchOptions(f);
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
+ async request(t, e = {}) {
47
+ const n = { ...this.config, ...e }, { requestInit: u, responseType: f, acmsPathOptions: w } = n, m = await P(), g = this.createUrl(t, w), p = await this.createFetchOptions(u);
58
48
  try {
59
- const s = await p(d, g), { ok: l, status: i, statusText: c, headers: E } = s, h = {
60
- data: await s[w](),
49
+ const s = await m(g, p), { ok: l, status: i, statusText: c, headers: E } = s, o = {
50
+ data: await s[f](),
61
51
  status: i,
62
52
  statusText: c,
63
53
  headers: E
64
54
  };
65
55
  if (!l) {
66
- const u = await F(s);
56
+ const h = await A(s);
67
57
  return await Promise.reject(
68
- new A(
69
- `fetch API response status: ${i}${u != null ? `
70
- message is \`${u}\`` : ""}`,
58
+ new y(
59
+ `fetch API response status: ${i}${h != null ? `
60
+ message is \`${h}\`` : ""}`,
71
61
  `${i} ${c}`,
72
- h
62
+ o
73
63
  )
74
64
  );
75
65
  }
76
- return h;
66
+ return o;
77
67
  } catch (s) {
78
68
  return s instanceof Error ? await Promise.reject(
79
69
  new Error(`Network Error.
@@ -84,32 +74,35 @@ class $ {
84
74
  );
85
75
  }
86
76
  }
87
- async createFetchOptions(e) {
88
- const t = await O(e == null ? void 0 : e.headers);
89
- return t.has("X-API-KEY") || t.set("X-API-KEY", this.apiKey), { ...e, headers: t };
77
+ async createFetchOptions(t) {
78
+ const e = await F(t?.headers);
79
+ return e.has("X-API-KEY") || e.set("X-API-KEY", this.apiKey), { ...t, headers: e };
90
80
  }
91
- createUrl(e, t = {}) {
92
- return o(e) ? new URL(e, this.baseUrl) : e instanceof URL ? new URL(e, this.baseUrl) : new URL(P({ ...e }, t), this.baseUrl);
81
+ createUrl(t, e = {}) {
82
+ return a(t) ? new URL(t, this.baseUrl) : t instanceof URL ? new URL(t, this.baseUrl) : new URL(d({ ...t }, e), this.baseUrl);
93
83
  }
94
- async get(e, t = {}) {
95
- return await this.request(e, {
96
- ...t,
97
- requestInit: { ...t.requestInit, method: "GET" }
84
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
+ async get(t, e = {}) {
86
+ return await this.request(t, {
87
+ ...e,
88
+ requestInit: { ...e.requestInit, method: "GET" }
98
89
  });
99
90
  }
100
- static isAcmsFetchError(e) {
101
- return q(e);
91
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
+ static isAcmsFetchError(t) {
93
+ return U(t);
102
94
  }
103
95
  getConfig() {
104
96
  return this.config;
105
97
  }
106
98
  }
107
99
  function L(...r) {
108
- return new $(...r);
100
+ return new I(...r);
109
101
  }
110
102
  export {
111
- P as acmsPath,
103
+ T as AcmsFieldList,
104
+ d as acmsPath,
112
105
  L as createClient,
113
- q as isAcmsFetchError,
114
- D as parseAcmsPath
106
+ U as isAcmsFetchError,
107
+ x as parseAcmsPath
115
108
  };