appos 0.3.6-0 → 0.3.7-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.
- package/dist/bin/main.mjs +3 -3
- package/dist/bin/youch-handler-D7REmh8Z.mjs +2 -0
- package/dist/exports/tests/api.d.mts +1 -1
- package/dist/exports/tests/api.mjs +14 -14
- package/dist/exports/tests/{auth-schema-DUCJw-_2.mjs → auth-schema-B_qHPoa4.mjs} +1 -1
- package/dist/exports/tests/{conditions-B0ffVJ5E.mjs → conditions-BeWxRN_Z.mjs} +1 -1
- package/dist/exports/tests/{extract-blob-metadata-Dv343Vcn.mjs → extract-blob-metadata-6xQrarjB.mjs} +2 -2
- package/dist/exports/tests/{generate-image-variant-cQc8q0kh.mjs → generate-image-variant-KQITLmCx.mjs} +1 -1
- package/dist/exports/tests/{generate-preview-HaTMd2hS.mjs → generate-preview-YnujQo5I.mjs} +1 -1
- package/dist/exports/tests/mock-BvoS23fi.mjs +1 -0
- package/dist/exports/tests/mock.mjs +1 -1
- package/dist/exports/tests/{purge-attachment-D4uOzHRi.mjs → purge-attachment-DTSmCl-z.mjs} +1 -1
- package/dist/exports/tests/{purge-audit-logs-DiPcc09d.mjs → purge-audit-logs-D0_UUhN2.mjs} +1 -1
- package/dist/exports/tests/{purge-unattached-blobs-CqW6tlIC.mjs → purge-unattached-blobs-IENmSB8K.mjs} +1 -1
- package/dist/exports/tests/react.mjs +1 -1
- package/dist/exports/tests/setup.mjs +2 -2
- package/dist/exports/tests/{track-db-changes-Bd4W-P1q.mjs → track-db-changes-Td9Q3DLd.mjs} +1 -1
- package/dist/exports/tests/youch-handler-efUxKCCs.mjs +1 -0
- package/dist/exports/vite/index.mjs +4 -4
- package/dist/exports/vite/{lib-DuBRr9dH.mjs → lib-B0s0q6aX.mjs} +73 -73
- package/dist/exports/vite/lib-BkrbWMaV.mjs +1 -0
- package/dist/exports/vitest/config.mjs +1 -77
- package/dist/exports/vitest/index.mjs +1 -348
- package/package.json +1 -7
- package/dist/bin/youch-handler-DrYdbUhe.mjs +0 -2
- package/dist/exports/devtools/BaseTanStackRouterDevtoolsPanel-BBz1qLry-DUwdvyLv.js +0 -2090
- package/dist/exports/devtools/EIDV623S-B7f6114d.js +0 -2497
- package/dist/exports/devtools/FloatingTanStackRouterDevtools-DymJEvfG-BHuQHiRR.js +0 -237
- package/dist/exports/devtools/MIMHJGAX-Cb3wf11F.js +0 -10903
- package/dist/exports/devtools/Q7LWSL4U-BoEO3rNq.js +0 -37
- package/dist/exports/devtools/VLTTJS3N-CIyRc84e.js +0 -44
- package/dist/exports/devtools/index.d.ts +0 -3
- package/dist/exports/devtools/index.js +0 -1725
- package/dist/exports/devtools/utils-YRTCpRgb.js +0 -1670
- package/dist/exports/tests/magic-string.es-D6VRmdiF.mjs +0 -14
- package/dist/exports/tests/mock-BvkO5nlm.mjs +0 -1
- package/dist/exports/tests/vi.2VT5v0um-Cme1b0Dl.mjs +0 -348
- package/dist/exports/tests/youch-handler-Ch5yf6im.mjs +0 -1
- package/dist/exports/vite/api-DGRU_RdM.mjs +0 -27
- package/dist/exports/vite/build-CxJAu2Bn.mjs +0 -1
- package/dist/exports/vite/build2-BMK0OFVt.mjs +0 -16
- package/dist/exports/vite/chunk-CxnlK1Zi.mjs +0 -1
- package/dist/exports/vite/chunk-PtveFMYu.mjs +0 -1
- package/dist/exports/vite/dist-Bxp8DqWh.mjs +0 -114
- package/dist/exports/vite/dist-CX51FKbX.mjs +0 -1
- package/dist/exports/vite/dist-DcyNr-KR.mjs +0 -1
- package/dist/exports/vite/dist-j3-Khlzt.mjs +0 -1
- package/dist/exports/vite/experimental-index-3KsfmUbz.mjs +0 -1
- package/dist/exports/vite/false-BNJbUKYT.mjs +0 -1
- package/dist/exports/vite/false-BvrPEDU6.mjs +0 -1
- package/dist/exports/vite/internal-C5cVwRiK.mjs +0 -1
- package/dist/exports/vite/jiti-BjSPrFvg.mjs +0 -9
- package/dist/exports/vite/lexer-DQCqS3nf-C6xCDOEQ.mjs +0 -3
- package/dist/exports/vite/lib-CMv7Sfwa.mjs +0 -1
- package/dist/exports/vite/lib-D9TnS-7w.mjs +0 -1
- package/dist/exports/vite/node-DI8AnY_i.mjs +0 -437
- package/dist/exports/vite/postcss-BtmDpj-c.mjs +0 -32
- package/dist/exports/vite/postcss-import-Bk_ZCd6c.mjs +0 -5
- package/dist/exports/vite/rolldown-build-CNW2eye_-CJNfyXdF.mjs +0 -13
- package/dist/exports/vitest/api-CPv6lnxG.mjs +0 -27
- package/dist/exports/vitest/build2-28i3OiJ3.mjs +0 -16
- package/dist/exports/vitest/chunk-_e2jlDPK.mjs +0 -1
- package/dist/exports/vitest/chunk-jwDkFoXW.mjs +0 -1
- package/dist/exports/vitest/dist-L-OpshPJ.mjs +0 -114
- package/dist/exports/vitest/jiti-eNGOyHIo.mjs +0 -9
- package/dist/exports/vitest/lexer-DQCqS3nf-TWLyIqlY.mjs +0 -3
- package/dist/exports/vitest/lib-C3G64csm.mjs +0 -1
- package/dist/exports/vitest/magic-string.es-CxM5Ubyl.mjs +0 -14
- package/dist/exports/vitest/module-runner-DsF4L04D.mjs +0 -1
- package/dist/exports/vitest/postcss-BxLp_Too.mjs +0 -32
- package/dist/exports/vitest/postcss-import-5pKj3f5q.mjs +0 -5
- /package/dist/exports/tests/{constants-DHjjg05J.mjs → constants-D_m07gCJ.mjs} +0 -0
- /package/dist/exports/tests/{dist-EfrRkq5c.mjs → dist-Cx2HEBOB.mjs} +0 -0
- /package/dist/exports/tests/{dist-D6vgKv3t.mjs → dist-DnACOvNW.mjs} +0 -0
- /package/dist/exports/tests/{pdf-BDsS3vjF.mjs → pdf-lZ-as2o7.mjs} +0 -0
- /package/dist/exports/tests/{table-CbU04119.mjs → table-CmPSf_pE.mjs} +0 -0
- /package/dist/exports/tests/{workflow-DwZxTqdH.mjs → workflow-BWRWyC83.mjs} +0 -0
- /package/dist/exports/tests/{zod-DcpxsMPz.mjs → zod-CkJO9qpV.mjs} +0 -0
package/dist/bin/main.mjs
CHANGED
|
@@ -80,7 +80,7 @@ ${wi}${t.trimStart()}`),n=3+xt(t.trimStart()).length)}process.stdout.write(`
|
|
|
80
80
|
`);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=F.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?F.default.green(Jr):n===1?F.default.red(Kr):F.default.red(qr);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
|
|
81
81
|
`):process.stdout.write(`${r} ${s}
|
|
82
82
|
`),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Di=async(e,t)=>{let n={},r=Object.keys(e);for(let i of r){let r=e[i],a=await r({results:n})?.catch(e=>{throw e});if(typeof t?.onCancel==`function`&&xr(a)){n[i]=`canceled`,t.onCancel({results:n});continue}n[i]=a}return n};function Oi(e,t,n){return{args:e,ask:mi,cancel(e=`Cancelled`){bi(e),process.exit(0)},choice:_i,async cleanup(){for(let[,e]of Object.entries(n.db))await e.$client.end();for(let[,e]of Object.entries(n.cache))await e.disconnect();await n.eventBus.close(),n.logger.flush()},comment(e){Ci.message(F.default.dim(e))},confirm:gi,container:n,error(e){Ci.error(e)},async exec(e,t){return new Promise((n,r)=>{let i=Qe(e,t,{stdio:[`inherit`,`pipe`,`pipe`],cwd:process.cwd()}),a=``;i.stderr?.on(`data`,e=>{a+=e.toString()}),i.on(`close`,e=>{e===0?n():r(Error(a||`Command failed with exit code ${e}`))}),i.on(`error`,r)})},fail(e){Ci.error(e),Si(F.default.red(`Failed`)),process.exit(1)},group:Di,info(e){Ci.info(e)},intro(e){xi(e)},isCancel:xr,line(e){Ci.message(e)},multiselect:vi,note(e,t){yi(e,t)},opts:t,outro(e=`Done`){Si(e)},secret:hi,async spinner(e,t){let n=Ei();n.start(e);try{let r=await t();return n.stop(e),r}catch(t){throw n.stop(e,1),t}},step(e){Ci.step(e)},success(e){Ci.success(e)},table(e,t){let n=e.map((e,n)=>Math.max(e.length,...t.map(e=>(e[n]||``).length)));yi([e.map((e,t)=>e.padEnd(n[t])).join(` │ `),n.map(e=>`─`.repeat(e)).join(`─┼─`),...t.map(e=>e.map((e,t)=>(e||``).padEnd(n[t])).join(` │ `))].join(`
|
|
83
|
-
`))},async task(e,t){let n=Date.now(),r=await t(),i=`${Date.now()-n}ms DONE`,a=`.`.repeat(Math.max(1,45-e.length-i.length));return Ci.message(`${e} ${F.default.dim(a)} ${F.default.green(i)}`,{symbol:F.default.green(`◆`)}),r},taskStatus(e,t){let n=`.`.repeat(Math.max(1,45-e.length-t.length));Ci.message(`${e} ${F.default.dim(n)} ${F.default.dim(t)}`,{symbol:F.default.dim(`◇`)})},warn(e){Ci.warn(e)}}}function ki(e){return{aliases:e.aliases||[],description:e.description,devOnly:e.devOnly??!1,args:e.args||[],opts:e.opts||{},run:e.run}}const Ai=[`canvas`,`esbuild`,`lightningcss`,`sharp`,`ultimate-express`,`uWebSockets.js`,`pino`,`pino-pretty`,`thread-stream`,`youch`],ji=[`@esbuild/`,`@img/`,`@opentelemetry/`,`@dbos-inc/`,`@aws-sdk/`,`@smithy/`];function Mi(){return[...Ai,...ji.map(e=>`${e}*`)]}async function Ni(){let e=[];try{await N(`./main.ts`),e.push(`./main.ts`)}catch{}for await(let t of st(`./api/**/*.ts`))t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||t.includes(`/__fixtures__/`)||t.includes(`/databases/`)||e.push(t);return e}var Pi=ki({description:`Build the application for production deployment`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`build`);let t=await Ni();e.step(`Found ${t.length} entry points`),await e.spinner(`Building production bundle`,async()=>{await lt(`./dist`,{recursive:!0,force:!0});let{build:e}=await import(`esbuild`);await e({banner:{js:`import{createRequire as __appos_createRequire}from"module";import{fileURLToPath as __appos_fileURLToPath}from"node:url";import{dirname as __appos_dirname}from"node:path";const __filename=__appos_fileURLToPath(import.meta.url);const __dirname=__appos_dirname(__filename);const require=__appos_createRequire(import.meta.url);`},bundle:!0,entryPoints:t,external:Mi(),format:`esm`,minify:!0,outdir:`./dist`,outbase:`.`,platform:`node`,sourcemap:!0,splitting:!0,target:`node24`}),await ot(`./api/databases`,`./dist/api/databases`,{recursive:!0})}),e.success(`Built to ./dist`),await e.cleanup(),e.outro()}}),I=t(i(((e,t)=>{var n=class e extends Array{constructor(t,n){if(super(t),this.sign=n,Object.setPrototypeOf(this,e.prototype),t>e.__kMaxLength)throw RangeError(`Maximum BigInt size exceeded`)}static BigInt(t){var n=Math.floor,r=Number.isFinite;if(typeof t==`number`){if(t===0)return e.__zero();if(e.__isOneDigitInt(t))return 0>t?e.__oneDigit(-t,!0):e.__oneDigit(t,!1);if(!r(t)||n(t)!==t)throw RangeError(`The number `+t+` cannot be converted to BigInt because it is not an integer`);return e.__fromDouble(t)}if(typeof t==`string`){let n=e.__fromString(t);if(n===null)throw SyntaxError(`Cannot convert `+t+` to a BigInt`);return n}if(typeof t==`boolean`)return!0===t?e.__oneDigit(1,!1):e.__zero();if(typeof t==`object`){if(t.constructor===e)return t;let n=e.__toPrimitive(t);return e.BigInt(n)}throw TypeError(`Cannot convert `+t+` to a BigInt`)}toDebugString(){let e=[`BigInt[`];for(let t of this)e.push((t&&(t>>>0).toString(16))+`, `);return e.push(`]`),e.join(``)}toString(t=10){if(2>t||36<t)throw RangeError(`toString() radix argument must be between 2 and 36`);return this.length===0?`0`:t&t-1?e.__toStringGeneric(this,t,!1):e.__toStringBasePowerOfTwo(this,t)}valueOf(){throw Error("Convert JSBI instances to native numbers using `toNumber`.")}static toNumber(t){let n=t.length;if(n===0)return 0;if(n===1){let e=t.__unsignedDigit(0);return t.sign?-e:e}let r=t.__digit(n-1),i=e.__clz30(r),a=30*n-i;if(1024<a)return t.sign?-1/0:1/0;let o=a-1,s=r,c=n-1,l=i+3,u=l===32?0:s<<l;u>>>=12;let d=l-12,f=12<=l?0:s<<20+l,p=20+l;for(0<d&&0<c&&(c--,s=t.__digit(c),u|=s>>>30-d,f=s<<d+2,p=d+2);0<p&&0<c;)c--,s=t.__digit(c),f|=30<=p?s<<p-30:s>>>30-p,p-=30;let m=e.__decideRounding(t,p,c,s);if((m===1||m===0&&(1&f)==1)&&(f=f+1>>>0,f===0&&(u++,u>>>20&&(u=0,o++,1023<o))))return t.sign?-1/0:1/0;let h=t.sign?-2147483648:0;return o=o+1023<<20,e.__kBitConversionInts[e.__kBitConversionIntHigh]=h|o|u,e.__kBitConversionInts[e.__kBitConversionIntLow]=f,e.__kBitConversionDouble[0]}static unaryMinus(e){if(e.length===0)return e;let t=e.__copy();return t.sign=!e.sign,t}static bitwiseNot(t){return t.sign?e.__absoluteSubOne(t).__trim():e.__absoluteAddOne(t,!0)}static exponentiate(t,n){if(n.sign)throw RangeError(`Exponent must be positive`);if(n.length===0)return e.__oneDigit(1,!1);if(t.length===0)return t;if(t.length===1&&t.__digit(0)===1)return t.sign&&!(1&n.__digit(0))?e.unaryMinus(t):t;if(1<n.length)throw RangeError(`BigInt too big`);let r=n.__unsignedDigit(0);if(r===1)return t;if(r>=e.__kMaxLengthBits)throw RangeError(`BigInt too big`);if(t.length===1&&t.__digit(0)===2){let n=1+(0|r/30),i=new e(n,t.sign&&(1&r)!=0);i.__initializeDigits();let a=1<<r%30;return i.__setDigit(n-1,a),i}let i=null,a=t;for(1&r&&(i=t),r>>=1;r!==0;r>>=1)a=e.multiply(a,a),1&r&&(i=i===null?a:e.multiply(i,a));return i}static multiply(t,n){if(t.length===0)return t;if(n.length===0)return n;let r=t.length+n.length;30<=t.__clzmsd()+n.__clzmsd()&&r--;let i=new e(r,t.sign!==n.sign);i.__initializeDigits();for(let r=0;r<t.length;r++)e.__multiplyAccumulate(n,t.__digit(r),i,r);return i.__trim()}static divide(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return e.__zero();let r=t.sign!==n.sign,i=n.__unsignedDigit(0),a;if(n.length===1&&32767>=i){if(i===1)return r===t.sign?t:e.unaryMinus(t);a=e.__absoluteDivSmall(t,i,null)}else a=e.__absoluteDivLarge(t,n,!0,!1);return a.sign=r,a.__trim()}static remainder(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return t;let r=n.__unsignedDigit(0);if(n.length===1&&32767>=r){if(r===1)return e.__zero();let n=e.__absoluteModSmall(t,r);return n===0?e.__zero():e.__oneDigit(n,t.sign)}let i=e.__absoluteDivLarge(t,n,!1,!0);return i.sign=t.sign,i.__trim()}static add(t,n){let r=t.sign;return r===n.sign?e.__absoluteAdd(t,n,r):0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r)}static subtract(t,n){let r=t.sign;return r===n.sign?0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r):e.__absoluteAdd(t,n,r)}static leftShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__rightShiftByAbsolute(t,n):e.__leftShiftByAbsolute(t,n)}static signedRightShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__leftShiftByAbsolute(t,n):e.__rightShiftByAbsolute(t,n)}static unsignedRightShift(){throw TypeError(`BigInts have no unsigned right shift; use >> instead`)}static lessThan(t,n){return 0>e.__compareToBigInt(t,n)}static lessThanOrEqual(t,n){return 0>=e.__compareToBigInt(t,n)}static greaterThan(t,n){return 0<e.__compareToBigInt(t,n)}static greaterThanOrEqual(t,n){return 0<=e.__compareToBigInt(t,n)}static equal(e,t){if(e.sign!==t.sign||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e.__digit(n)!==t.__digit(n))return!1;return!0}static notEqual(t,n){return!e.equal(t,n)}static bitwiseAnd(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteAnd(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length)+1,a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return a=e.__absoluteOr(a,o,a),e.__absoluteAddOne(a,!0,a).__trim()}return t.sign&&([t,n]=[n,t]),e.__absoluteAndNot(t,e.__absoluteSubOne(n)).__trim()}static bitwiseXor(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteXor(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length),a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return e.__absoluteXor(a,o,a).__trim()}let i=r(t.length,n.length)+1;t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteXor(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static bitwiseOr(t,n){var r=Math.max;let i=r(t.length,n.length);if(!t.sign&&!n.sign)return e.__absoluteOr(t,n).__trim();if(t.sign&&n.sign){let r=e.__absoluteSubOne(t,i),a=e.__absoluteSubOne(n);return r=e.__absoluteAnd(r,a,r),e.__absoluteAddOne(r,!0,r).__trim()}t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteAndNot(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static asIntN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=n.__unsignedDigit(i-1),o=1<<(t-1)%30;if(n.length===i&&a<o)return n;if((a&o)!==o)return e.__truncateToNBits(t,n);if(!n.sign)return e.__truncateAndSubFromPowerOfTwo(t,n,!0);if(!(a&o-1)){for(let r=i-2;0<=r;r--)if(n.__digit(r)!==0)return e.__truncateAndSubFromPowerOfTwo(t,n,!1);return n.length===i&&a===o?n:e.__truncateToNBits(t,n)}return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}static asUintN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(n.sign){if(t>e.__kMaxLengthBits)throw RangeError(`BigInt too big`);return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=t%30;return n.length==i&&(a===0||!(n.__digit(i-1)>>>a))?n:e.__truncateToNBits(t,n)}static ADD(t,n){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`)return typeof n!=`string`&&(n=n.toString()),t+n;if(typeof n==`string`)return t.toString()+n;if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)&&e.__isBigInt(n))return e.add(t,n);if(typeof t==`number`&&typeof n==`number`)return t+n;throw TypeError(`Cannot mix BigInt and other types, use explicit conversions`)}static LT(t,n){return e.__compare(t,n,0)}static LE(t,n){return e.__compare(t,n,1)}static GT(t,n){return e.__compare(t,n,2)}static GE(t,n){return e.__compare(t,n,3)}static EQ(t,n){for(;;){if(e.__isBigInt(t))return e.__isBigInt(n)?e.equal(t,n):e.EQ(n,t);if(typeof t==`number`){if(e.__isBigInt(n))return e.__equalToNumber(n,t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`string`){if(e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.equal(t,n);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`boolean`){if(e.__isBigInt(n))return e.__equalToNumber(n,+t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`symbol`){if(e.__isBigInt(n))return!1;if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`object`){if(typeof n==`object`&&n.constructor!==e)return t==n;t=e.__toPrimitive(t)}else return t==n}}static NE(t,n){return!e.EQ(t,n)}static DataViewGetBigInt64(t,n,r=!1){return e.asIntN(64,e.DataViewGetBigUint64(t,n,r))}static DataViewGetBigUint64(t,n,r=!1){let[i,a]=r?[4,0]:[0,4],o=t.getUint32(n+i,r),s=t.getUint32(n+a,r),c=new e(3,!1);return c.__setDigit(0,1073741823&s),c.__setDigit(1,(268435455&o)<<2|s>>>30),c.__setDigit(2,o>>>28),c.__trim()}static DataViewSetBigInt64(t,n,r,i=!1){e.DataViewSetBigUint64(t,n,r,i)}static DataViewSetBigUint64(t,n,r,i=!1){r=e.asUintN(64,r);let a=0,o=0;if(0<r.length&&(o=r.__digit(0),1<r.length)){let e=r.__digit(1);o|=e<<30,a=e>>>2,2<r.length&&(a|=r.__digit(2)<<28)}let[s,c]=i?[4,0]:[0,4];t.setUint32(n+s,a,i),t.setUint32(n+c,o,i)}static __zero(){return new e(0,!1)}static __oneDigit(t,n){let r=new e(1,n);return r.__setDigit(0,t),r}__copy(){let t=new e(this.length,this.sign);for(let e=0;e<this.length;e++)t[e]=this[e];return t}__trim(){let e=this.length,t=this[e-1];for(;t===0;)e--,t=this[e-1],this.pop();return e===0&&(this.sign=!1),this}__initializeDigits(){for(let e=0;e<this.length;e++)this[e]=0}static __decideRounding(e,t,n,r){if(0<t)return-1;let i;if(0>t)i=-t-1;else{if(n===0)return-1;n--,r=e.__digit(n),i=29}let a=1<<i;if((r&a)==0)return-1;if(--a,(r&a)!=0)return 1;for(;0<n;)if(n--,e.__digit(n)!==0)return 1;return 0}static __fromDouble(t){e.__kBitConversionDouble[0]=t;let n=(2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20)-1023,r=(0|n/30)+1,i=new e(r,0>t),a=1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh]|1048576,o=e.__kBitConversionInts[e.__kBitConversionIntLow],s=n%30,c,l=0;if(s<20){let e=20-s;l=e+32,c=a>>>e,a=a<<32-e|o>>>e,o<<=32-e}else if(s===20)l=32,c=a,a=o,o=0;else{let e=s-20;l=32-e,c=a<<e|o>>>32-e,a=o<<e,o=0}i.__setDigit(r-1,c);for(let e=r-2;0<=e;e--)0<l?(l-=30,c=a>>>2,a=a<<30|o>>>2,o<<=30):c=0,i.__setDigit(e,c);return i.__trim()}static __isWhitespace(e){return 13>=e&&9<=e||(159>=e?e==32:131071>=e?e==160||e==5760:196607>=e?(e&=131071,10>=e||e==40||e==41||e==47||e==95||e==4096):e==65279)}static __fromString(t,n=0){let r=0,i=t.length,a=0;if(a===i)return e.__zero();let o=t.charCodeAt(a);for(;e.__isWhitespace(o);){if(++a===i)return e.__zero();o=t.charCodeAt(a)}if(o===43){if(++a===i)return null;o=t.charCodeAt(a),r=1}else if(o===45){if(++a===i)return null;o=t.charCodeAt(a),r=-1}if(n===0){if(n=10,o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(n=16,++a===i)return null;o=t.charCodeAt(a)}else if(o===79||o===111){if(n=8,++a===i)return null;o=t.charCodeAt(a)}else if(o===66||o===98){if(n=2,++a===i)return null;o=t.charCodeAt(a)}}}else if(n===16&&o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(++a===i)return null;o=t.charCodeAt(a)}}if(r!=0&&n!==10)return null;for(;o===48;){if(++a===i)return e.__zero();o=t.charCodeAt(a)}let s=i-a,c=e.__kMaxBitsPerChar[n],l=e.__kBitsPerCharTableMultiplier-1;if(s>1073741824/c)return null;let u=new e(0|((c*s+l>>>e.__kBitsPerCharTableShift)+29)/30,!1),d=10>n?n:10,f=10<n?n-10:0;if(n&n-1){u.__initializeDigits();let r=!1,s=0;do{let p=0,m=1;for(;;){let e;if(o-48>>>0<d)e=o-48;else if((32|o)-97>>>0<f)e=(32|o)-87;else{r=!0;break}let c=m*n;if(1073741823<c)break;if(m=c,p=p*n+e,s++,++a===i){r=!0;break}o=t.charCodeAt(a)}l=30*e.__kBitsPerCharTableMultiplier-1;let h=0|(c*s+l>>>e.__kBitsPerCharTableShift)/30;u.__inplaceMultiplyAdd(m,p,h)}while(!r)}else{c>>=e.__kBitsPerCharTableShift;let n=[],r=[],s=!1;do{let e=0,l=0;for(;;){let n;if(o-48>>>0<d)n=o-48;else if((32|o)-97>>>0<f)n=(32|o)-87;else{s=!0;break}if(l+=c,e=e<<c|n,++a===i){s=!0;break}if(o=t.charCodeAt(a),30<l+c)break}n.push(e),r.push(l)}while(!s);e.__fillFromParts(u,n,r)}if(a!==i){if(!e.__isWhitespace(o))return null;for(a++;a<i;a++)if(o=t.charCodeAt(a),!e.__isWhitespace(o))return null}return u.sign=r==-1,u.__trim()}static __fillFromParts(e,t,n){let r=0,i=0,a=0;for(let o=t.length-1;0<=o;o--){let s=t[o],c=n[o];i|=s<<a,a+=c,a===30?(e.__setDigit(r++,i),a=0,i=0):30<a&&(e.__setDigit(r++,1073741823&i),a-=30,i=s>>>c-a)}if(i!==0){if(r>=e.length)throw Error(`implementation bug`);e.__setDigit(r++,i)}for(;r<e.length;r++)e.__setDigit(r,0)}static __toStringBasePowerOfTwo(t,n){let r=t.length,i=n-1;i=(85&i>>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);let a=i,o=n-1,s=t.__digit(r-1),c=e.__clz30(s),l=0|(30*r-c+a-1)/a;if(t.sign&&l++,268435456<l)throw Error(`string too long`);let u=Array(l),d=l-1,f=0,p=0;for(let n=0;n<r-1;n++){let r=t.__digit(n),i=(f|r<<p)&o;u[d--]=e.__kConversionChars[i];let s=a-p;for(f=r>>>s,p=30-s;p>=a;)u[d--]=e.__kConversionChars[f&o],f>>>=a,p-=a}let m=(f|s<<p)&o;for(u[d--]=e.__kConversionChars[m],f=s>>>a-p;f!==0;)u[d--]=e.__kConversionChars[f&o],f>>>=a;if(t.sign&&(u[d--]=`-`),d!=-1)throw Error(`implementation bug`);return u.join(``)}static __toStringGeneric(t,n,r){let i=t.length;if(i===0)return``;if(i===1){let e=t.__unsignedDigit(0).toString(n);return!1===r&&t.sign&&(e=`-`+e),e}let a=30*i-e.__clz30(t.__digit(i-1)),o=e.__kMaxBitsPerChar[n]-1,s=a*e.__kBitsPerCharTableMultiplier;s+=o-1,s=0|s/o;let c=s+1>>1,l=e.exponentiate(e.__oneDigit(n,!1),e.__oneDigit(c,!1)),u,d,f=l.__unsignedDigit(0);if(l.length===1&&32767>=f){u=new e(t.length,!1),u.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){let n=r<<15|t.__halfDigit(e);u.__setHalfDigit(e,0|n/f),r=0|n%f}d=r.toString(n)}else{let r=e.__absoluteDivLarge(t,l,!0,!0);u=r.quotient;let i=r.remainder.__trim();d=e.__toStringGeneric(i,n,!0)}u.__trim();let p=e.__toStringGeneric(u,n,!0);for(;d.length<c;)d=`0`+d;return!1===r&&t.sign&&(p=`-`+p),p+d}static __unequalSign(e){return e?-1:1}static __absoluteGreater(e){return e?-1:1}static __absoluteLess(e){return e?1:-1}static __compareToBigInt(t,n){let r=t.sign;if(r!==n.sign)return e.__unequalSign(r);let i=e.__absoluteCompare(t,n);return 0<i?e.__absoluteGreater(r):0>i?e.__absoluteLess(r):0}static __compareToNumber(t,n){if(e.__isOneDigitInt(n)){let r=t.sign,i=0>n;if(r!==i)return e.__unequalSign(r);if(t.length===0){if(i)throw Error(`implementation bug`);return n===0?0:-1}if(1<t.length)return e.__absoluteGreater(r);let a=Math.abs(n),o=t.__unsignedDigit(0);return o>a?e.__absoluteGreater(r):o<a?e.__absoluteLess(r):0}return e.__compareToDouble(t,n)}static __compareToDouble(t,n){if(n!==n)return n;if(n===1/0)return-1;if(n===-1/0)return 1;let r=t.sign;if(r!==0>n)return e.__unequalSign(r);if(n===0)throw Error(`implementation bug: should be handled elsewhere`);if(t.length===0)return-1;e.__kBitConversionDouble[0]=n;let i=2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20;if(i==2047)throw Error(`implementation bug: handled elsewhere`);let a=i-1023;if(0>a)return e.__absoluteGreater(r);let o=t.length,s=t.__digit(o-1),c=e.__clz30(s),l=30*o-c,u=a+1;if(l<u)return e.__absoluteLess(r);if(l>u)return e.__absoluteGreater(r);let d=1048576|1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh],f=e.__kBitConversionInts[e.__kBitConversionIntLow],p=29-c;if(p!==(0|(l-1)%30))throw Error(`implementation bug`);let m,h=0;if(20>p){let e=20-p;h=e+32,m=d>>>e,d=d<<32-e|f>>>e,f<<=32-e}else if(p===20)h=32,m=d,d=f,f=0;else{let e=p-20;h=32-e,m=d<<e|f>>>32-e,d=f<<e,f=0}if(s>>>=0,m>>>=0,s>m)return e.__absoluteGreater(r);if(s<m)return e.__absoluteLess(r);for(let n=o-2;0<=n;n--){0<h?(h-=30,m=d>>>2,d=d<<30|f>>>2,f<<=30):m=0;let i=t.__unsignedDigit(n);if(i>m)return e.__absoluteGreater(r);if(i<m)return e.__absoluteLess(r)}if(d!==0||f!==0){if(h===0)throw Error(`implementation bug`);return e.__absoluteLess(r)}return 0}static __equalToNumber(t,n){var r=Math.abs;return e.__isOneDigitInt(n)?n===0?t.length===0:t.length===1&&t.sign===0>n&&t.__unsignedDigit(0)===r(n):e.__compareToDouble(t,n)===0}static __comparisonResultToBool(e,t){return t===0?0>e:t===1?0>=e:t===2?0<e:t===3?0<=e:void 0}static __compare(t,n,r){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`&&typeof n==`string`)switch(r){case 0:return t<n;case 1:return t<=n;case 2:return t>n;case 3:return t>=n}if(e.__isBigInt(t)&&typeof n==`string`)return n=e.__fromString(n),n!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof t==`string`&&e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)){if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof n!=`number`)throw Error(`implementation bug`);return e.__comparisonResultToBool(e.__compareToNumber(t,n),r)}if(typeof t!=`number`)throw Error(`implementation bug`);if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToNumber(n,t),2^r);if(typeof n!=`number`)throw Error(`implementation bug`);return r===0?t<n:r===1?t<=n:r===2?t>n:r===3?t>=n:void 0}__clzmsd(){return e.__clz30(this.__digit(this.length-1))}static __absoluteAdd(t,n,r){if(t.length<n.length)return e.__absoluteAdd(n,t,r);if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=t.length;(t.__clzmsd()===0||n.length===t.length&&n.__clzmsd()===0)&&i++;let a=new e(i,r),o=0,s=0;for(;s<n.length;s++){let e=t.__digit(s)+n.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}for(;s<t.length;s++){let e=t.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}return s<a.length&&a.__setDigit(s,o),a.__trim()}static __absoluteSub(t,n,r){if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=new e(t.length,r),a=0,o=0;for(;o<n.length;o++){let e=t.__digit(o)-n.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}for(;o<t.length;o++){let e=t.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}return i.__trim()}static __absoluteAddOne(t,n,r=null){let i=t.length;r===null?r=new e(i,n):r.sign=n;let a=1;for(let e=0;e<i;e++){let n=t.__digit(e)+a;a=n>>>30,r.__setDigit(e,1073741823&n)}return a!=0&&r.__setDigitGrow(i,1),r}static __absoluteSubOne(t,n){let r=t.length;n||=r;let i=new e(n,!1),a=1;for(let e=0;e<r;e++){let n=t.__digit(e)-a;a=1&n>>>30,i.__setDigit(e,1073741823&n)}if(a!=0)throw Error(`implementation bug`);for(let e=r;e<n;e++)i.__setDigit(e,0);return i}static __absoluteAnd(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=o;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&n.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteAndNot(t,n,r=null){let i=t.length,a=n.length,o=a;i<a&&(o=i);let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&~n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteOr(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)|n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteXor(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)^n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteCompare(e,t){let n=e.length-t.length;if(n!=0)return n;let r=e.length-1;for(;0<=r&&e.__digit(r)===t.__digit(r);)r--;return 0>r?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}static __multiplyAccumulate(t,n,r,i){if(n===0)return;let a=32767&n,o=n>>>15,s=0,c=0;for(let n,l=0;l<t.length;l++,i++){n=r.__digit(i);let u=t.__digit(l),d=32767&u,f=u>>>15,p=e.__imul(d,a),m=e.__imul(d,o),h=e.__imul(f,a),g=e.__imul(f,o);n+=c+p+s,s=n>>>30,n&=1073741823,n+=((32767&m)<<15)+((32767&h)<<15),s+=n>>>30,c=g+(m>>>15)+(h>>>15),r.__setDigit(i,1073741823&n)}for(;s!=0||c!==0;i++){let e=r.__digit(i);e+=s+c,c=0,s=e>>>30,r.__setDigit(i,1073741823&e)}}static __internalMultiplyAdd(t,n,r,i,a){let o=r,s=0;for(let r=0;r<i;r++){let i=t.__digit(r),c=e.__imul(32767&i,n),l=e.__imul(i>>>15,n),u=c+((32767&l)<<15)+s+o;o=u>>>30,s=l>>>15,a.__setDigit(r,1073741823&u)}if(a.length>i)for(a.__setDigit(i++,o+s);i<a.length;)a.__setDigit(i++,0);else if(o+s!==0)throw Error(`implementation bug`)}__inplaceMultiplyAdd(t,n,r){r>this.length&&(r=this.length);let i=32767&t,a=t>>>15,o=0,s=n;for(let t=0;t<r;t++){let n=this.__digit(t),r=32767&n,c=n>>>15,l=e.__imul(r,i),u=e.__imul(r,a),d=e.__imul(c,i),f=e.__imul(c,a),p=s+l+o;o=p>>>30,p&=1073741823,p+=((32767&u)<<15)+((32767&d)<<15),o+=p>>>30,s=f+(u>>>15)+(d>>>15),this.__setDigit(t,1073741823&p)}if(o!=0||s!==0)throw Error(`implementation bug`)}static __absoluteDivSmall(t,n,r=null){r===null&&(r=new e(t.length,!1));let i=0;for(let e,a=2*t.length-1;0<=a;a-=2){e=(i<<15|t.__halfDigit(a))>>>0;let o=0|e/n;i=0|e%n,e=(i<<15|t.__halfDigit(a-1))>>>0;let s=0|e/n;i=0|e%n,r.__setDigit(a>>>1,o<<15|s)}return r}static __absoluteModSmall(e,t){let n=0;for(let r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}static __absoluteDivLarge(t,n,r,i){let a=n.__halfDigitLength(),o=n.length,s=t.__halfDigitLength()-a,c=null;r&&(c=new e(s+2>>>1,!1),c.__initializeDigits());let l=new e(a+2>>>1,!1);l.__initializeDigits();let u=e.__clz15(n.__halfDigit(a-1));0<u&&(n=e.__specialLeftShift(n,u,0));let d=e.__specialLeftShift(t,u,1),f=n.__halfDigit(a-1),p=0;for(let t,i=s;0<=i;i--){t=32767;let s=d.__halfDigit(i+a);if(s!==f){let r=(s<<15|d.__halfDigit(i+a-1))>>>0;t=0|r/f;let o=0|r%f,c=n.__halfDigit(a-2),l=d.__halfDigit(i+a-2);for(;e.__imul(t,c)>>>0>(o<<16|l)>>>0&&(t--,o+=f,!(32767<o)););}e.__internalMultiplyAdd(n,t,0,o,l);let u=d.__inplaceSub(l,i,a+1);u!==0&&(u=d.__inplaceAdd(n,i,a),d.__setHalfDigit(i+a,32767&d.__halfDigit(i+a)+u),t--),r&&(1&i?p=t<<15:c.__setDigit(i>>>1,p|t))}if(i)return d.__inplaceRightShift(u),r?{quotient:c,remainder:d}:d;if(r)return c;throw Error(`unreachable`)}static __clz15(t){return e.__clz30(t)-15}__inplaceAdd(e,t,n){let r=0;for(let i=0;i<n;i++){let n=this.__halfDigit(t+i)+e.__halfDigit(i)+r;r=n>>>15,this.__setHalfDigit(t+i,32767&n)}return r}__inplaceSub(e,t,n){let r=0;if(1&t){t>>=1;let i=this.__digit(t),a=32767&i,o=0;for(;o<n-1>>>1;o++){let n=e.__digit(o),s=(i>>>15)-(32767&n)-r;r=1&s>>>15,this.__setDigit(t+o,(32767&s)<<15|32767&a),i=this.__digit(t+o+1),a=(32767&i)-(n>>>15)-r,r=1&a>>>15}let s=e.__digit(o),c=(i>>>15)-(32767&s)-r;if(r=1&c>>>15,this.__setDigit(t+o,(32767&c)<<15|32767&a),t+o+1>=this.length)throw RangeError(`out of bounds`);!(1&n)&&(i=this.__digit(t+o+1),a=(32767&i)-(s>>>15)-r,r=1&a>>>15,this.__setDigit(t+e.length,1073709056&i|32767&a))}else{t>>=1;let i=0;for(;i<e.length-1;i++){let n=this.__digit(t+i),a=e.__digit(i),o=(32767&n)-(32767&a)-r;r=1&o>>>15;let s=(n>>>15)-(a>>>15)-r;r=1&s>>>15,this.__setDigit(t+i,(32767&s)<<15|32767&o)}let a=this.__digit(t+i),o=e.__digit(i),s=(32767&a)-(32767&o)-r;r=1&s>>>15;let c=0;!(1&n)&&(c=(a>>>15)-(o>>>15)-r,r=1&c>>>15),this.__setDigit(t+i,(32767&c)<<15|32767&s)}return r}__inplaceRightShift(e){if(e===0)return;let t=this.__digit(0)>>>e,n=this.length-1;for(let r=0;r<n;r++){let n=this.__digit(r+1);this.__setDigit(r,1073741823&n<<30-e|t),t=n>>>e}this.__setDigit(n,t)}static __specialLeftShift(t,n,r){let i=t.length,a=new e(i+r,!1);if(n===0){for(let e=0;e<i;e++)a.__setDigit(e,t.__digit(e));return 0<r&&a.__setDigit(i,0),a}let o=0;for(let e=0;e<i;e++){let r=t.__digit(e);a.__setDigit(e,1073741823&r<<n|o),o=r>>>30-n}return 0<r&&a.__setDigit(i,o),a}static __leftShiftByAbsolute(t,n){let r=e.__toShiftAmount(n);if(0>r)throw RangeError(`BigInt too big`);let i=0|r/30,a=r%30,o=t.length,s=a!==0&&t.__digit(o-1)>>>30-a!=0,c=o+i+(s?1:0),l=new e(c,t.sign);if(a===0){let e=0;for(;e<i;e++)l.__setDigit(e,0);for(;e<c;e++)l.__setDigit(e,t.__digit(e-i))}else{let e=0;for(let e=0;e<i;e++)l.__setDigit(e,0);for(let n=0;n<o;n++){let r=t.__digit(n);l.__setDigit(n+i,1073741823&r<<a|e),e=r>>>30-a}if(s)l.__setDigit(o+i,e);else if(e!==0)throw Error(`implementation bug`)}return l.__trim()}static __rightShiftByAbsolute(t,n){let r=t.length,i=t.sign,a=e.__toShiftAmount(n);if(0>a)return e.__rightShiftByMaximum(i);let o=0|a/30,s=a%30,c=r-o;if(0>=c)return e.__rightShiftByMaximum(i);let l=!1;if(i){if(t.__digit(o)&(1<<s)-1)l=!0;else for(let e=0;e<o;e++)if(t.__digit(e)!==0){l=!0;break}}l&&s===0&&~t.__digit(r-1)==0&&c++;let u=new e(c,i);if(s===0){u.__setDigit(c-1,0);for(let e=o;e<r;e++)u.__setDigit(e-o,t.__digit(e))}else{let e=t.__digit(o)>>>s,n=r-o-1;for(let r=0;r<n;r++){let n=t.__digit(r+o+1);u.__setDigit(r,1073741823&n<<30-s|e),e=n>>>s}u.__setDigit(n,e)}return l&&(u=e.__absoluteAddOne(u,!0,u)),u.__trim()}static __rightShiftByMaximum(t){return t?e.__oneDigit(1,!0):e.__zero()}static __toShiftAmount(t){if(1<t.length)return-1;let n=t.__unsignedDigit(0);return n>e.__kMaxLengthBits?-1:n}static __toPrimitive(t,n=`default`){if(typeof t!=`object`||t.constructor===e)return t;if(typeof Symbol<`u`&&typeof Symbol.toPrimitive==`symbol`&&t[Symbol.toPrimitive]){let e=t[Symbol.toPrimitive](n);if(typeof e!=`object`)return e;throw TypeError(`Cannot convert object to primitive value`)}let r=t.valueOf;if(r){let e=r.call(t);if(typeof e!=`object`)return e}let i=t.toString;if(i){let e=i.call(t);if(typeof e!=`object`)return e}throw TypeError(`Cannot convert object to primitive value`)}static __toNumeric(t){return e.__isBigInt(t)?t:+t}static __isBigInt(t){return typeof t==`object`&&!!t&&t.constructor===e}static __truncateToNBits(t,n){let r=0|(t+29)/30,i=new e(r,n.sign),a=r-1;for(let e=0;e<a;e++)i.__setDigit(e,n.__digit(e));let o=n.__digit(a);if(t%30!=0){let e=32-t%30;o=o<<e>>>e}return i.__setDigit(a,o),i.__trim()}static __truncateAndSubFromPowerOfTwo(t,n,r){var i=Math.min;let a=0|(t+29)/30,o=new e(a,r),s=0,c=a-1,l=0;for(let e=i(c,n.length);s<e;s++){let e=0-n.__digit(s)-l;l=1&e>>>30,o.__setDigit(s,1073741823&e)}for(;s<c;s++)o.__setDigit(s,0|1073741823&-l);let u=c<n.length?n.__digit(c):0,d=t%30,f;if(d==0)f=0-u-l,f&=1073741823;else{let e=32-d;u=u<<e>>>e;let t=1<<32-e;f=t-u-l,f&=t-1}return o.__setDigit(c,f),o.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,t){this[e]=0|t}__setDigitGrow(e,t){this[e]=0|t}__halfDigitLength(){let e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,t){let n=e>>>1,r=this.__digit(n),i=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,i)}static __digitPow(e,t){let n=1;for(;0<t;)1&t&&(n*=e),t>>>=1,e*=e;return n}static __detectBigEndian(){return e.__kBitConversionDouble[0]=-0,e.__kBitConversionInts[0]!==0}static __isOneDigitInt(e){return(1073741823&e)===e}};n.__kMaxLength=33554432,n.__kMaxLengthBits=n.__kMaxLength<<5,n.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],n.__kBitsPerCharTableShift=5,n.__kBitsPerCharTableMultiplier=1<<n.__kBitsPerCharTableShift,n.__kConversionChars=`0123456789abcdefghijklmnopqrstuvwxyz`.split(``),n.__kBitConversionBuffer=new ArrayBuffer(8),n.__kBitConversionDouble=new Float64Array(n.__kBitConversionBuffer),n.__kBitConversionInts=new Int32Array(n.__kBitConversionBuffer),n.__kBitConversionIntHigh=n.__detectBigEndian()?0:1,n.__kBitConversionIntLow=n.__detectBigEndian()?1:0,n.__clz30=Math.clz32?function(e){return Math.clz32(e)-2}:function(e){return e===0?30:0|29-(0|Math.log(e>>>0)/Math.LN2)},n.__imul=Math.imul||function(e,t){return 0|e*t},t.exports=n}))(),1);const Fi=I.default.BigInt(0),Ii=I.default.BigInt(1),Li=I.default.BigInt(2),Ri=I.default.BigInt(10),zi=I.default.BigInt(24),Bi=I.default.BigInt(60),Vi=I.default.BigInt(1e3),Hi=I.default.BigInt(1e6),Ui=I.default.BigInt(1e9),Wi=I.default.multiply(I.default.BigInt(3600),Ui),Gi=I.default.multiply(Bi,Ui),Ki=I.default.multiply(Wi,zi);function qi(e){return typeof e==`bigint`?I.default.BigInt(e.toString(10)):e}function Ji(e){return I.default.equal(I.default.remainder(e,Li),Fi)}function Yi(e){return I.default.lessThan(e,Fi)?I.default.unaryMinus(e):e}function Xi(e,t){return I.default.lessThan(e,t)?-1:I.default.greaterThan(e,t)?1:0}function Zi(e,t){return{quotient:I.default.divide(e,t),remainder:I.default.remainder(e,t)}}var Qi,$i;const ea=`slot-epochNanoSeconds`,ta=`slot-iso-date`,na=`slot-iso-date-time`,ra=`slot-time`,ia=`slot-calendar`,aa=`slot-date-brand`,oa=`slot-year-month-brand`,sa=`slot-month-day-brand`,ca=`slot-time-zone`,la=`slot-years`,ua=`slot-months`,da=`slot-weeks`,fa=`slot-days`,pa=`slot-hours`,ma=`slot-minutes`,ha=`slot-seconds`,ga=`slot-milliseconds`,_a=`slot-microseconds`,va=`slot-nanoseconds`,ya=`date`,ba=`time`,xa=`datetime`,Sa=`instant`,Ca=`original`,wa=`timezone-canonical`,Ta=`timezone-original`,Ea=`calendar-id`,Da=`locale`,Oa=`options`,ka=new WeakMap,Aa=Symbol.for(`@@Temporal__GetSlots`);(Qi=globalThis)[Aa]||(Qi[Aa]=function(e){return ka.get(e)});const ja=globalThis[Aa],Ma=Symbol.for(`@@Temporal__CreateSlots`);($i=globalThis)[Ma]||($i[Ma]=function(e){ka.set(e,Object.create(null))});const Na=globalThis[Ma];function Pa(e,...t){if(!e||typeof e!=`object`)return!1;let n=ja(e);return!!n&&t.every((e=>e in n))}function L(e,t){let n=ja(e)?.[t];if(n===void 0)throw TypeError(`Missing internal slot ${t}`);return n}function Fa(e,t,n){let r=ja(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t])throw TypeError(`${t} already has set`);r[t]=n}const Ia={};function La(e,t){Object.defineProperty(e.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let n=Object.getOwnPropertyNames(e);for(let t=0;t<n.length;t++){let r=n[t],i=Object.getOwnPropertyDescriptor(e,r);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e,r,i))}let r=Object.getOwnPropertyNames(e.prototype);for(let t=0;t<r.length;t++){let n=r[t],i=Object.getOwnPropertyDescriptor(e.prototype,n);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e.prototype,n,i))}Ra(t,e),Ra(`${t}.prototype`,e.prototype)}function Ra(e,t){let n=`%${e}%`;if(Ia[n]!==void 0)throw Error(`intrinsic ${e} already exists`);Ia[n]=t}function za(e){return Ia[e]}function Ba(e,t){let n=e;if(n===0)return{div:n,mod:n};let r=Math.sign(n);n=Math.abs(n);let i=Math.trunc(1+Math.log10(n));if(t>=i)return{div:0*r,mod:r*n};if(t===0)return{div:r*n,mod:0*r};let a=n.toPrecision(i);return{div:r*Number.parseInt(a.slice(0,i-t),10),mod:r*Number.parseInt(a.slice(i-t),10)}}function Va(e,t,n){let r=e,i=n;if(r===0)return i;let a=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let o=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return a*Number.parseInt(o+`0`.repeat(t),10);let s=o+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,`0`);return a*Number.parseInt(s,10)}function Ha(e,t){let n=t===`negative`;switch(e){case`ceil`:return n?`zero`:`infinity`;case`floor`:return n?`infinity`:`zero`;case`expand`:return`infinity`;case`trunc`:return`zero`;case`halfCeil`:return n?`half-zero`:`half-infinity`;case`halfFloor`:return n?`half-infinity`:`half-zero`;case`halfExpand`:return`half-infinity`;case`halfTrunc`:return`half-zero`;case`halfEven`:return`half-even`}}function Ua(e,t,n,r,i){return i===`zero`?e:i===`infinity`?t:n<0?e:n>0?t:i===`half-zero`?e:i===`half-infinity`?t:r?e:t}var Wa=class e{constructor(e){this.totalNs=qi(e),this.sec=I.default.toNumber(I.default.divide(this.totalNs,Ui)),this.subsec=I.default.toNumber(I.default.remainder(this.totalNs,Ui))}static validateNew(t,n){if(I.default.greaterThan(Yi(t),e.MAX))throw RangeError(`${n} of duration time units cannot exceed ${e.MAX} s`);return new e(t)}static fromEpochNsDiff(t,n){return new e(I.default.subtract(qi(t),qi(n)))}static fromComponents(t,n,r,i,a,o){let s=I.default.add(I.default.add(I.default.add(I.default.add(I.default.add(I.default.BigInt(o),I.default.multiply(I.default.BigInt(a),Vi)),I.default.multiply(I.default.BigInt(i),Hi)),I.default.multiply(I.default.BigInt(r),Ui)),I.default.multiply(I.default.BigInt(n),Gi)),I.default.multiply(I.default.BigInt(t),Wi));return e.validateNew(s,`total`)}abs(){return new e(Yi(this.totalNs))}add(t){return e.validateNew(I.default.add(this.totalNs,t.totalNs),`sum`)}add24HourDays(t){return e.validateNew(I.default.add(this.totalNs,I.default.multiply(I.default.BigInt(t),Ki)),`sum`)}addToEpochNs(e){return I.default.add(qi(e),this.totalNs)}cmp(e){return Xi(this.totalNs,e.totalNs)}divmod(t){let{quotient:n,remainder:r}=Zi(this.totalNs,I.default.BigInt(t));return{quotient:I.default.toNumber(n),remainder:new e(r)}}fdiv(e){let t=qi(e),n=I.default.BigInt(t),{quotient:r,remainder:i}=Zi(this.totalNs,n),a=[],o,s=(I.default.lessThan(this.totalNs,Fi)?-1:1)*Math.sign(I.default.toNumber(t));for(;!I.default.equal(i,Fi)&&a.length<50;)i=I.default.multiply(i,Ri),{quotient:o,remainder:i}=Zi(i,n),a.push(Math.abs(I.default.toNumber(o)));return s*Number(Yi(r).toString()+`.`+a.join(``))}isZero(){return I.default.equal(this.totalNs,Fi)}round(t,n){let r=qi(t);if(I.default.equal(r,Ii))return this;let{quotient:i,remainder:a}=Zi(this.totalNs,r),o=I.default.lessThan(this.totalNs,Fi)?`negative`:`positive`,s=I.default.multiply(Yi(i),r),c=I.default.add(s,r),l=Xi(Yi(I.default.multiply(a,Li)),r),u=Ha(n,o),d=I.default.equal(Yi(this.totalNs),s)?s:Ua(s,c,l,Ji(i),u),f=o===`positive`?d:I.default.unaryMinus(d);return e.validateNew(f,`rounding`)}sign(){return this.cmp(new e(Fi))}subtract(t){return e.validateNew(I.default.subtract(this.totalNs,t.totalNs),`difference`)}};Wa.MAX=I.default.BigInt(`9007199254740991999999999`),Wa.ZERO=new Wa(Fi);const Ga=/[A-Za-z._][A-Za-z._0-9+-]*/,Ka=RegExp(`(?:(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)|(?:${Ga.source})(?:\\/(?:${Ga.source}))*)`),qa=/(?:[+-]\d{6}|\d{4})/,Ja=/(?:0[1-9]|1[0-2])/,Ya=/(?:0[1-9]|[12]\d|3[01])/,Xa=RegExp(`(${qa.source})(?:-(${Ja.source})-(${Ya.source})|(${Ja.source})(${Ya.source}))`),Za=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Qa=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,$a=RegExp(`([zZ])|${Qa.source}?`),eo=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,to=new RegExp([`^${Xa.source}`,`(?:(?:[tT]|\\s+)${Za.source}(?:${$a.source})?)?`,`(?:\\[!?(${Ka.source})\\])?`,`((?:${eo.source})*)$`].join(``)),no=new RegExp([`^[tT]?${Za.source}`,`(?:${$a.source})?`,`(?:\\[!?${Ka.source}\\])?`,`((?:${eo.source})*)$`].join(``)),ro=RegExp(`^(${qa.source})-?(${Ja.source})(?:\\[!?${Ka.source}\\])?((?:${eo.source})*)$`),io=RegExp(`^(?:--)?(${Ja.source})-?(${Ya.source})(?:\\[!?${Ka.source}\\])?((?:${eo.source})*)$`),ao=/(\d+)(?:[.,](\d{1,9}))?/,oo=RegExp(`(?:${ao.source}H)?(?:${ao.source}M)?(?:${ao.source}S)?`),so=RegExp(`^([+-])?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?!$)${oo.source})?$`,`i`),co=864e5,lo=1e6*co,uo=1e8*co,fo=Ql(uo),po=I.default.unaryMinus(fo),mo=I.default.add(I.default.subtract(po,Ki),Ii),ho=I.default.subtract(I.default.add(fo,Ki),Ii);146097*co;const go=-271821,_o=275760,vo=Date.UTC(1847,0,1),yo=[`iso8601`,`hebrew`,`islamic`,`islamic-umalqura`,`islamic-tbla`,`islamic-civil`,`islamic-rgsa`,`islamicc`,`persian`,`ethiopic`,`ethioaa`,`ethiopic-amete-alem`,`coptic`,`chinese`,`dangi`,`roc`,`indian`,`buddhist`,`japanese`,`gregory`],bo=new Set([`ACT`,`AET`,`AGT`,`ART`,`AST`,`BET`,`BST`,`CAT`,`CNT`,`CST`,`CTT`,`EAT`,`ECT`,`IET`,`IST`,`JST`,`MIT`,`NET`,`NST`,`PLT`,`PNT`,`PRT`,`PST`,`SST`,`VST`]);function xo(e){return typeof e==`object`&&!!e||typeof e==`function`}function So(e){if(typeof e==`bigint`)throw TypeError(`Cannot convert BigInt to number`);return Number(e)}function Co(e){if(typeof e==`symbol`)throw TypeError(`Cannot convert a Symbol value to a String`);return String(e)}function wo(e){let t=So(e);if(t===0)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw RangeError(`invalid number value`);let n=Math.trunc(t);return n===0?0:n}function To(e,t){let n=wo(e);if(n<=0)throw t===void 0?RangeError(`Cannot convert a number less than one to a positive integer`):RangeError(`property '${t}' cannot be a a number less than one`);return n}function Eo(e){let t=So(e);if(Number.isNaN(t))throw RangeError(`not a number`);if(t===1/0||t===-1/0)throw RangeError(`infinity is out of range`);if(!function(e){if(typeof e!=`number`||Number.isNaN(e)||e===1/0||e===-1/0)return!1;let t=Math.abs(e);return Math.floor(t)===t}(t))throw RangeError(`unsupported fractional value ${e}`);return t===0?0:t}function Do(e,t){return String(e).padStart(t,`0`)}function Oo(e){if(typeof e!=`string`)throw TypeError(`expected a string, not ${String(e)}`);return e}function ko(e,t){if(xo(e)){let t=e?.toString();if(typeof t==`string`||typeof t==`number`)return t;throw TypeError(`Cannot convert object to primitive value`)}return e}const Ao=[`era`,`eraYear`,`year`,`month`,`monthCode`,`day`,`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],jo={era:Co,eraYear:wo,year:wo,month:To,monthCode:function(e){let t=Oo(ko(e));if(t.length<3||t.length>4||t[0]!==`M`||`0123456789`.indexOf(t[1])===-1||`0123456789`.indexOf(t[2])===-1||t[1]+t[2]===`00`&&t[3]!==`L`||t[3]!==`L`&&t[3]!==void 0)throw RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:To,hour:wo,minute:wo,second:wo,millisecond:wo,microsecond:wo,nanosecond:wo,offset:function(e){let t=Oo(ko(e));return jc(t),t},timeZone:fc},Mo={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},No=[[`years`,`year`,`date`],[`months`,`month`,`date`],[`weeks`,`week`,`date`],[`days`,`day`,`date`],[`hours`,`hour`,`time`],[`minutes`,`minute`,`time`],[`seconds`,`second`,`time`],[`milliseconds`,`millisecond`,`time`],[`microseconds`,`microsecond`,`time`],[`nanoseconds`,`nanosecond`,`time`]],Po=Object.fromEntries(No.map((e=>[e[0],e[1]]))),Fo=Object.fromEntries(No.map((([e,t])=>[t,e]))),Io=No.map((([,e])=>e)),Lo={day:lo,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},Ro=[`days`,`hours`,`microseconds`,`milliseconds`,`minutes`,`months`,`nanoseconds`,`seconds`,`weeks`,`years`],zo=Intl.DateTimeFormat,Bo=new Map;function Vo(e){let t=su(e),n=Bo.get(t);return n===void 0&&(n=new zo(`en-us`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),Bo.set(t,n)),n}function Ho(e){return Pa(e,ea)&&!Pa(e,ca,ia)}function Uo(e){return Pa(e,la,ua,fa,pa,ma,ha,ga,_a,va)}function Wo(e){return Pa(e,aa)}function Go(e){return Pa(e,ra)}function Ko(e){return Pa(e,na)}function qo(e){return Pa(e,oa)}function Jo(e){return Pa(e,sa)}function Yo(e){return Pa(e,ea,ca,ia)}function R(e,t){if(!t(e))throw TypeError(`invalid receiver: method called with the wrong type of this-object`)}function Xo(e){if(Pa(e,ia)||Pa(e,ca))throw TypeError(`with() does not support a calendar or timeZone property`);if(Go(e))throw TypeError(`with() does not accept Temporal.PlainTime, use withPlainTime() instead`);if(e.calendar!==void 0)throw TypeError(`with() does not support a calendar property`);if(e.timeZone!==void 0)throw TypeError(`with() does not support a timeZone property`)}function Zo(e,t){return t===`never`||t===`auto`&&e===`iso8601`?``:`[${t===`critical`?`!`:``}u-ca=${e}]`}function Qo(e){let t,n,r=!1;for(eo.lastIndex=0;n=eo.exec(e);){let{1:i,2:a,3:o}=n;if(a===`u-ca`){if(t===void 0)t=o,r=i===`!`;else if(i===`!`||r)throw RangeError(`Invalid annotations in ${e}: more than one u-ca present with critical flag`)}else if(i===`!`)throw RangeError(`Unrecognized annotation: !${a}=${o}`)}return t}function $o(e){let t=to.exec(e);if(!t)throw RangeError(`invalid RFC 9557 string: ${e}`);let n=Qo(t[16]),r=t[1];if(r===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);let i=+r,a=+(t[2]??t[4]??1),o=+(t[3]??t[5]??1),s=t[6]!==void 0,c=+(t[6]??0),l=+(t[7]??t[10]??0),u=+(t[8]??t[11]??0);u===60&&(u=59);let d=(t[9]??t[12]??``)+`000000000`,f=+d.slice(0,3),p=+d.slice(3,6),m=+d.slice(6,9),h,g=!1;t[13]?(h=void 0,g=!0):t[14]&&(h=t[14]);let _=t[15];return al(i,a,o,c,l,u,f,p,m),{year:i,month:a,day:o,time:s?{hour:c,minute:l,second:u,millisecond:f,microsecond:p,nanosecond:m}:`start-of-day`,tzAnnotation:_,offset:h,z:g,calendar:n}}function es(e){let t=no.exec(e),n,r,i,a,o,s,c;if(t){c=Qo(t[10]),n=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let e=(t[4]??t[7]??``)+`000000000`;if(a=+e.slice(0,3),o=+e.slice(3,6),s=+e.slice(6,9),t[8])throw RangeError(`Z designator not supported for PlainTime`)}else{let t,l;if({time:t,z:l,calendar:c}=$o(e),t===`start-of-day`)throw RangeError(`time is missing in string: ${e}`);if(l)throw RangeError(`Z designator not supported for PlainTime`);({hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s}=t)}if(il(n,r,i,a,o,s),/[tT ][0-9][0-9]/.test(e))return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c};try{let{month:t,day:n}=ns(e);nl(1972,t,n)}catch{try{let{year:t,month:n}=ts(e);nl(t,n,1)}catch{return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c}}}throw RangeError(`invalid RFC 9557 time-only string ${e}; may need a T prefix`)}function ts(e){let t=ro.exec(e),n,r,i,a;if(t){i=Qo(t[3]);let o=t[1];if(o===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);if(n=+o,r=+t[2],a=1,i!==void 0&&i!==`iso8601`)throw RangeError(`YYYY-MM format is only valid with iso8601 calendar`)}else{let t;if({year:n,month:r,calendar:i,day:a,z:t}=$o(e),t)throw RangeError(`Z designator not supported for PlainYearMonth`)}return{year:n,month:r,calendar:i,referenceISODay:a}}function ns(e){let t=io.exec(e),n,r,i,a;if(t){if(i=Qo(t[3]),n=+t[1],r=+t[2],i!==void 0&&i!==`iso8601`)throw RangeError(`MM-DD format is only valid with iso8601 calendar`)}else{let t;if({month:n,day:r,calendar:i,year:a,z:t}=$o(e),t)throw RangeError(`Z designator not supported for PlainMonthDay`)}return{month:n,day:r,calendar:i,referenceISOYear:a}}const rs=RegExp(`^${Ka.source}$`,`i`),is=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?$`);function as(e){let t=dee.test(e)?`Seconds not allowed in offset time zone`:`Invalid time zone`;throw RangeError(`${t}: ${e}`)}function os(e){return rs.test(e)||as(e),is.test(e)?{offsetMinutes:jc(e)/6e10}:{tzName:e}}function ss(e,t,n,r){let i=e,a=t,o=n;switch(r){case`reject`:nl(i,a,o);break;case`constrain`:({year:i,month:a,day:o}=el(i,a,o))}return{year:i,month:a,day:o}}function cs(e,t,n,r,i,a,o){let s=e,c=t,l=n,u=r,d=i,f=a;switch(o){case`reject`:il(s,c,l,u,d,f);break;case`constrain`:s=$c(s,0,23),c=$c(c,0,59),l=$c(l,0,59),u=$c(u,0,999),d=$c(d,0,999),f=$c(f,0,999)}return{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function ls(e){if(!xo(e))throw TypeError(`invalid duration-like`);let t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0},n=!1;for(let r=0;r<Ro.length;r++){let i=Ro[r],a=e[i];a!==void 0&&(n=!0,t[i]=Eo(a))}if(!n)throw TypeError(`invalid duration-like`);return t}function us({years:e,months:t,weeks:n,days:r},i,a,o){return{years:e,months:o??t,weeks:a??n,days:i??r}}function ds(e,t){return{isoDate:e,time:t}}function fs(e){return au(e,`overflow`,[`constrain`,`reject`],`constrain`)}function ps(e){return au(e,`disambiguation`,[`compatible`,`earlier`,`later`,`reject`],`compatible`)}function ms(e,t){return au(e,`roundingMode`,[`ceil`,`floor`,`expand`,`trunc`,`halfCeil`,`halfFloor`,`halfExpand`,`halfTrunc`,`halfEven`],t)}function hs(e,t){return au(e,`offset`,[`prefer`,`use`,`ignore`,`reject`],t)}function gs(e){return au(e,`calendarName`,[`auto`,`always`,`never`,`critical`],`auto`)}function _s(e){let t=e.roundingIncrement;if(t===void 0)return 1;let n=wo(t);if(n<1||n>1e9)throw RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return n}function vs(e,t,n){let r=n?t:t-1;if(e>r)throw RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${e}`);if(t%e!=0)throw RangeError(`Rounding increment must divide evenly into ${t}`)}function ys(e){let t=e.fractionalSecondDigits;if(t===void 0)return`auto`;if(typeof t!=`number`){if(Co(t)!==`auto`)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return`auto`}let n=Math.floor(t);if(!Number.isFinite(n)||n<0||n>9)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return n}function bs(e,t){switch(e){case`minute`:return{precision:`minute`,unit:`minute`,increment:1};case`second`:return{precision:0,unit:`second`,increment:1};case`millisecond`:return{precision:3,unit:`millisecond`,increment:1};case`microsecond`:return{precision:6,unit:`microsecond`,increment:1};case`nanosecond`:return{precision:9,unit:`nanosecond`,increment:1}}switch(t){case`auto`:return{precision:t,unit:`nanosecond`,increment:1};case 0:return{precision:t,unit:`second`,increment:1};case 1:case 2:case 3:return{precision:t,unit:`millisecond`,increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:`microsecond`,increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:`nanosecond`,increment:10**(9-t)};default:throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}const xs=Symbol(`~required~`);function Ss(e,t,n,r,i=[]){let a=[];for(let e=0;e<No.length;e++){let t=No[e],r=t[1],i=t[2];n!==`datetime`&&n!==i||a.push(r)}a=a.concat(i);let o=r;o===xs?o=void 0:o!==void 0&&a.push(o);let s=[];s=s.concat(a);for(let e=0;e<a.length;e++){let t=Fo[a[e]];t!==void 0&&s.push(t)}let c=au(e,t,s,o);if(c===void 0&&r===xs)throw RangeError(`${t} is required`);return c&&c in Po?Po[c]:c}function Cs(e){let t=e.relativeTo;if(t===void 0)return{};let n,r,i,a,o,s=`option`,c=!1;if(xo(t)){if(Yo(t))return{zonedRelativeTo:t};if(Wo(t))return{plainRelativeTo:t};if(Ko(t))return{plainRelativeTo:Gs(L(t,na).isoDate,L(t,ia))};i=sc(t);let e=js(i,t,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[]);({isoDate:n,time:r}=Ps(i,e,`constrain`)),{offset:o,timeZone:a}=e,o===void 0&&(s=`wall`)}else{let e,l,u,d,f;if({year:u,month:d,day:f,time:r,calendar:i,tzAnnotation:e,offset:o,z:l}=$o(Oo(t)),e)a=fc(e),l?s=`exact`:o||(s=`wall`),c=!0;else if(l)throw RangeError(`Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone`);i||=`iso8601`,i=ou(i),n={year:u,month:d,day:f}}return a===void 0?{plainRelativeTo:Gs(n,i)}:{zonedRelativeTo:nc(Hs(n,r,s,s===`option`?jc(o):0,a,`compatible`,`reject`,c),a,i)}}function ws(e){return L(e,la)===0?L(e,ua)===0?L(e,da)===0?L(e,fa)===0?L(e,pa)===0?L(e,ma)===0?L(e,ha)===0?L(e,ga)===0?L(e,_a)===0?`nanosecond`:`microsecond`:`millisecond`:`second`:`minute`:`hour`:`day`:`week`:`month`:`year`}function Ts(e,t){return Io.indexOf(e)>Io.indexOf(t)?t:e}function Es(e){return e===`year`||e===`month`||e===`week`}function Ds(e){return Es(e)||e===`day`?`date`:`time`}function Os(e){return za(`%calendarImpl%`)(e)}function ks(e){return za(`%calendarImpl%`)(L(e,ia))}function As(e,t,n=`date`){let r=Object.create(null),i=Os(e).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,n!==`month-day`&&n!==`date`||(r.day=i.day),n!==`year-month`&&n!==`date`||(r.year=i.year),r}function js(e,t,n,r,i){let a=Os(e).extraFields(n),o=n.concat(r,a),s=Object.create(null),c=!1;o.sort();for(let e=0;e<o.length;e++){let n=o[e],r=t[n];if(r!==void 0)c=!0,s[n]=(0,jo[n])(r);else if(i!==`partial`){if(i.includes(n))throw TypeError(`required property '${n}' missing or undefined`);s[n]=Mo[n]}}if(i===`partial`&&!c)throw TypeError(`no supported properties found`);return s}function Ms(e,t=`complete`){let n=[`hour`,`microsecond`,`millisecond`,`minute`,`nanosecond`,`second`],r=!1,i=Object.create(null);for(let a=0;a<n.length;a++){let o=n[a],s=e[o];s===void 0?t===`complete`&&(i[o]=0):(i[o]=wo(s),r=!0)}if(!r)throw TypeError(`invalid time-like`);return i}function Ns(e,t){if(xo(e)){if(Wo(e))return fs(ru(t)),Gs(L(e,ta),L(e,ia));if(Yo(e)){let n=gc(L(e,ca),L(e,ea));return fs(ru(t)),Gs(n.isoDate,L(e,ia))}if(Ko(e))return fs(ru(t)),Gs(L(e,na).isoDate,L(e,ia));let n=sc(e);return Gs(lc(n,js(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),fs(ru(t))),n)}let{year:n,month:r,day:i,calendar:a,z:o}=$o(Oo(e));if(o)throw RangeError(`Z designator not supported for PlainDate`);return a||=`iso8601`,a=ou(a),fs(ru(t)),Gs({year:n,month:r,day:i},a)}function Ps(e,t,n){return ds(lc(e,t,n),cs(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,n))}function Fs(e,t){let n,r,i;if(xo(e)){if(Ko(e))return fs(ru(t)),qs(L(e,na),L(e,ia));if(Yo(e)){let n=gc(L(e,ca),L(e,ea));return fs(ru(t)),qs(n,L(e,ia))}if(Wo(e))return fs(ru(t)),qs(ds(L(e,ta),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),L(e,ia));i=sc(e);let a=js(i,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],[]),o=fs(ru(t));({isoDate:n,time:r}=Ps(i,a,o))}else{let a,o,s,c;if({year:o,month:s,day:c,time:r,calendar:i,z:a}=$o(Oo(e)),a)throw RangeError(`Z designator not supported for PlainDateTime`);r===`start-of-day`&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),al(o,s,c,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||=`iso8601`,i=ou(i),fs(ru(t)),n={year:o,month:s,day:c}}return qs(ds(n,r),i)}function Is(e){let t=za(`%Temporal.Duration%`);if(Uo(e))return new t(L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va));if(!xo(e))return function(e){let{years:t,months:n,weeks:r,days:i,hours:a,minutes:o,seconds:s,milliseconds:c,microseconds:l,nanoseconds:u}=function(e){let t=so.exec(e);if(!t||t.every(((e,t)=>t<2||e===void 0)))throw RangeError(`invalid duration: ${e}`);let n=t[1]===`-`?-1:1,r=t[2]===void 0?0:wo(t[2])*n,i=t[3]===void 0?0:wo(t[3])*n,a=t[4]===void 0?0:wo(t[4])*n,o=t[5]===void 0?0:wo(t[5])*n,s=t[6]===void 0?0:wo(t[6])*n,c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=0,m=0,h=0;if(c!==void 0){if(l??u??d??f)throw RangeError(`only the smallest unit can be fractional`);h=3600*wo((c+`000000000`).slice(0,9))*n}else if(p=l===void 0?0:wo(l)*n,u!==void 0){if(d??f)throw RangeError(`only the smallest unit can be fractional`);h=60*wo((u+`000000000`).slice(0,9))*n}else m=d===void 0?0:wo(d)*n,f!==void 0&&(h=wo((f+`000000000`).slice(0,9))*n);let g=h%1e3,_=Math.trunc(h/1e3)%1e3,v=Math.trunc(h/1e6)%1e3;return m+=Math.trunc(h/1e9)%60,p+=Math.trunc(h/6e10),ul(r,i,a,o,s,p,m,v,_,g),{years:r,months:i,weeks:a,days:o,hours:s,minutes:p,seconds:m,milliseconds:v,microseconds:_,nanoseconds:g}}(e);return new(za(`%Temporal.Duration%`))(t,n,r,i,a,o,s,c,l,u)}(Oo(e));let n={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=ls(e);for(let e=0;e<Ro.length;e++){let t=Ro[e],i=r[t];i!==void 0&&(n[t]=i)}return new t(n.years,n.months,n.weeks,n.days,n.hours,n.minutes,n.seconds,n.milliseconds,n.microseconds,n.nanoseconds)}function Ls(e){let t;if(xo(e)){if(Ho(e)||Yo(e))return tc(L(e,ea));t=ko(e)}else t=e;let{year:n,month:r,day:i,time:a,offset:o,z:s}=function(e){let t=$o(e);if(!t.z&&!t.offset)throw RangeError(`Temporal.Instant requires a time zone offset`);return t}(Oo(t)),{hour:c=0,minute:l=0,second:u=0,millisecond:d=0,microsecond:f=0,nanosecond:p=0}=a===`start-of-day`?{}:a,m=Yc(n,r,i,c,l,u,d,f,p-(s?0:jc(o)));return _l(m.isoDate),tc(Rc(m))}function Rs(e,t){if(xo(e)){if(Jo(e))return fs(ru(t)),Ys(L(e,ta),L(e,ia));let n;return Pa(e,ia)?n=L(e,ia):(n=e.calendar,n===void 0&&(n=`iso8601`),n=oc(n)),Ys(dc(n,js(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),fs(ru(t))),n)}let{month:n,day:r,referenceISOYear:i,calendar:a}=ns(Oo(e));if(a===void 0&&(a=`iso8601`),a=ou(a),fs(ru(t)),a===`iso8601`)return Ys({year:1972,month:n,day:r},a);let o={year:i,month:n,day:r};return rl(o),o=dc(a,As(a,o,`month-day`),`constrain`),Ys(o,a)}function zs(e,t){let n;if(xo(e)){if(Go(e))return fs(ru(t)),Zs(L(e,ra));if(Ko(e))return fs(ru(t)),Zs(L(e,na).time);if(Yo(e)){let n=gc(L(e,ca),L(e,ea));return fs(ru(t)),Zs(n.time)}let{hour:r,minute:i,second:a,millisecond:o,microsecond:s,nanosecond:c}=Ms(e);n=cs(r,i,a,o,s,c,fs(ru(t)))}else n=es(Oo(e)),fs(ru(t));return Zs(n)}function Bs(e){return e===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:L(zs(e),ra)}function Vs(e,t){if(xo(e)){if(qo(e))return fs(ru(t)),$s(L(e,ta),L(e,ia));let n=sc(e);return $s(uc(n,js(n,e,[`year`,`month`,`monthCode`],[],[]),fs(ru(t))),n)}let{year:n,month:r,referenceISODay:i,calendar:a}=ts(Oo(e));a===void 0&&(a=`iso8601`),a=ou(a),fs(ru(t));let o={year:n,month:r,day:i};return ll(o),o=uc(a,As(a,o,`year-month`),`constrain`),$s(o,a)}function Hs(e,t,n,r,i,a,o,s){if(t===`start-of-day`)return bc(i,e);let c=ds(e,t);if(n===`wall`||o===`ignore`)return _c(i,c,a);if(n===`exact`||o===`use`){let n=Yc(e.year,e.month,e.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);_l(n.isoDate);let i=Rc(n);return cl(i),i}_l(e);let l=Rc(c),u=yc(i,c);for(let e=0;e<u.length;e++){let t=u[e],n=I.default.toNumber(I.default.subtract(l,t)),i=Hl(n,6e10,`halfExpand`);if(n===r||s&&i===r)return t}if(o===`reject`){let e=hc(r),t=kc(c,`iso8601`,`auto`);throw RangeError(`Offset ${e} is invalid for ${t} in ${i}`)}return vc(u,i,c,a)}function Us(e,t){let n,r,i,a,o,s,c,l=!1,u=`option`;if(xo(e)){if(Yo(e)){let n=ru(t);return ps(n),hs(n,`reject`),fs(n),nc(L(e,ea),L(e,ca),L(e,ia))}o=sc(e);let l=js(o,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[`timeZone`]);({offset:a,timeZone:i}=l),a===void 0&&(u=`wall`);let d=ru(t);s=ps(d),c=hs(d,`reject`);let f=fs(d);({isoDate:n,time:r}=Ps(o,l,f))}else{let d,f,p,m,h;({year:p,month:m,day:h,time:r,tzAnnotation:d,offset:a,z:f,calendar:o}=function(e){let t=$o(e);if(!t.tzAnnotation)throw RangeError(`Temporal.ZonedDateTime requires a time zone ID in brackets`);return t}(Oo(e))),i=fc(d),f?u=`exact`:a||(u=`wall`),o||=`iso8601`,o=ou(o),l=!0;let g=ru(t);s=ps(g),c=hs(g,`reject`),fs(g),n={year:p,month:m,day:h}}let d=0;return u===`option`&&(d=jc(a)),nc(Hs(n,r,u,d,i,s,c,l),i,o)}function Ws(e,t,n){rl(t),Na(e),Fa(e,ta,t),Fa(e,ia,n),Fa(e,aa,!0)}function Gs(e,t){let n=za(`%Temporal.PlainDate%`),r=Object.create(n.prototype);return Ws(r,e,t),r}function Ks(e,t,n){ol(t),Na(e),Fa(e,na,t),Fa(e,ia,n)}function qs(e,t){let n=za(`%Temporal.PlainDateTime%`),r=Object.create(n.prototype);return Ks(r,e,t),r}function Js(e,t,n){rl(t),Na(e),Fa(e,ta,t),Fa(e,ia,n),Fa(e,sa,!0)}function Ys(e,t){let n=za(`%Temporal.PlainMonthDay%`),r=Object.create(n.prototype);return Js(r,e,t),r}function Xs(e,t){Na(e),Fa(e,ra,t)}function Zs(e){let t=za(`%Temporal.PlainTime%`),n=Object.create(t.prototype);return Xs(n,e),n}function Qs(e,t,n){ll(t),Na(e),Fa(e,ta,t),Fa(e,ia,n),Fa(e,oa,!0)}function $s(e,t){let n=za(`%Temporal.PlainYearMonth%`),r=Object.create(n.prototype);return Qs(r,e,t),r}function ec(e,t){cl(t),Na(e),Fa(e,ea,t)}function tc(e){let t=za(`%Temporal.Instant%`),n=Object.create(t.prototype);return ec(n,e),n}function eee(e,t,n,r){cl(t),Na(e),Fa(e,ea,t),Fa(e,ca,n),Fa(e,ia,r)}function nc(e,t,n=`iso8601`){let r=za(`%Temporal.ZonedDateTime%`),i=Object.create(r.prototype);return eee(i,e,t,n),i}function tee(e){return Ao.filter((t=>e[t]!==void 0))}function rc(e,t,n){let r=tee(n),i=Os(e).fieldKeysToIgnore(r),a=Object.create(null),o=tee(t);for(let e=0;e<Ao.length;e++){let s,c=Ao[e];o.includes(c)&&!i.includes(c)&&(s=t[c]),r.includes(c)&&(s=n[c]),s!==void 0&&(a[c]=s)}return a}function ic(e,t,n,r){let i=Os(e).dateAdd(t,n,r);return rl(i),i}function ac(e,t,n,r){return Os(e).dateUntil(t,n,r)}function oc(e){if(xo(e)&&Pa(e,ia))return L(e,ia);let t=Oo(e);try{return ou(t)}catch{}let n;try{({calendar:n}=$o(t))}catch{try{({calendar:n}=es(t))}catch{try{({calendar:n}=ts(t))}catch{({calendar:n}=ns(t))}}}return n||=`iso8601`,ou(n)}function sc(e){if(Pa(e,ia))return L(e,ia);let{calendar:t}=e;return t===void 0?`iso8601`:oc(t)}function cc(e,t){return ou(e)===ou(t)}function lc(e,t,n){let r=Os(e);r.resolveFields(t,`date`);let i=r.dateToISO(t,n);return rl(i),i}function uc(e,t,n){let r=Os(e);r.resolveFields(t,`year-month`),t.day=1;let i=r.dateToISO(t,n);return ll(i),i}function dc(e,t,n){let r=Os(e);r.resolveFields(t,`month-day`);let i=r.monthDayToISOReferenceDate(t,n);return rl(i),i}function fc(e){if(xo(e)&&Yo(e))return L(e,ca);let t=Oo(e);if(t===`UTC`)return`UTC`;let{tzName:n,offsetMinutes:r}=function(e){let{tzAnnotation:t,offset:n,z:r}=function(e){if(rs.test(e))return{tzAnnotation:e,offset:void 0,z:!1};try{let{tzAnnotation:t,offset:n,z:r}=$o(e);if(r||t||n)return{tzAnnotation:t,offset:n,z:r}}catch{}as(e)}(e);return t?os(t):r?os(`UTC`):n?os(n):void 0}(t);if(r!==void 0)return Ic(r);let i=Nc(n);if(!i)throw RangeError(`Unrecognized time zone ${n}`);return i.identifier}function pc(e,t){if(e===t)return!0;let n=os(e).offsetMinutes,r=os(t).offsetMinutes;if(n===void 0&&r===void 0){let n=Nc(t);if(!n)return!1;let r=Nc(e);return!!r&&r.primaryIdentifier===n.primaryIdentifier}return n===r}function mc(e,t){let n=os(e).offsetMinutes;return n===void 0?Fc(e,t):6e10*n}function hc(e){let t=e<0?`-`:`+`,n=Math.abs(e),r=Math.floor(n/36e11),i=Math.floor(n/6e10)%60,a=Math.floor(n/1e9)%60,o=n%1e9;return`${t}${wc(r,i,a,o,a===0&&o===0?`minute`:`auto`)}`}function gc(e,t){let n=mc(e,t),{isoDate:{year:r,month:i,day:a},time:{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d}}=see(t);return Yc(r,i,a,o,s,c,l,u,d+n)}function _c(e,t,n){return vc(yc(e,t),e,t,n)}function vc(e,t,n,r){let i=e.length;if(i===1)return e[0];if(i)switch(r){case`compatible`:case`earlier`:return e[0];case`later`:return e[i-1];case`reject`:throw RangeError(`multiple instants found`)}if(r===`reject`)throw RangeError(`multiple instants found`);let a=Rc(n),o=I.default.subtract(a,Ki);cl(o);let s=mc(t,o),c=I.default.add(a,Ki);cl(c);let l=mc(t,c)-s;switch(r){case`earlier`:{let e=Wa.fromComponents(0,0,0,0,0,-l),r=Pl(n.time,e);return yc(t,ds(Jc(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r))[0]}case`compatible`:case`later`:{let e=Wa.fromComponents(0,0,0,0,0,l),r=Pl(n.time,e),i=yc(t,ds(Jc(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r));return i[i.length-1]}}}function yc(e,t){if(e===`UTC`)return _l(t.isoDate),[Rc(t)];let n=os(e).offsetMinutes;if(n!==void 0){let e=Yc(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-n,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);_l(e.isoDate);let r=Rc(e);return cl(r),[r]}return _l(t.isoDate),function(e,t){let n=Rc(t),r=I.default.subtract(n,Ki);I.default.lessThan(r,po)&&(r=n);let i=I.default.add(n,Ki);I.default.greaterThan(i,fo)&&(i=n);let a=Fc(e,r),o=Fc(e,i);return(a===o?[a]:[a,o]).map((r=>{let i=I.default.subtract(n,I.default.BigInt(r));if(Xl(t,function(e,t){let{epochMilliseconds:n,time:{millisecond:r,microsecond:i,nanosecond:a}}=see(t),{year:o,month:s,day:c,hour:l,minute:u,second:d}=Vc(e,n);return Yc(o,s,c,l,u,d,r,i,a)}(e,i))===0)return cl(i),i})).filter((e=>e!==void 0))}(e,t)}function bc(e,t){let n=ds(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=yc(e,n);if(r.length)return r[0];let i=Rc(n),a=I.default.subtract(i,Ki);return cl(a),zc(e,a)}function xc(e){let t;return t=e<0||e>9999?(e<0?`-`:`+`)+Do(Math.abs(e),6):Do(e,4),t}function Sc(e){return Do(e,2)}function Cc(e,t){let n;if(t===`auto`){if(e===0)return``;n=Do(e,9).replace(/0+$/,``)}else{if(t===0)return``;n=Do(e,9).slice(0,t)}return`.${n}`}function wc(e,t,n,r,i){let a=`${Sc(e)}:${Sc(t)}`;return i===`minute`||(a+=`:${Sc(n)}`,a+=Cc(r,i)),a}function Tc(e,t,n){let r=t;r===void 0&&(r=`UTC`);let i=L(e,ea),a=kc(gc(r,i),`iso8601`,n,`never`),o=`Z`;return t!==void 0&&(o=oee(mc(r,i))),`${a}${o}`}function Ec(e,t){let n=L(e,la),r=L(e,ua),i=L(e,da),a=L(e,fa),o=L(e,pa),s=L(e,ma),c=Wc(e),l=``;n!==0&&(l+=`${Math.abs(n)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),a!==0&&(l+=`${Math.abs(a)}D`);let u=``;o!==0&&(u+=`${Math.abs(o)}H`),s!==0&&(u+=`${Math.abs(s)}M`);let d=Wa.fromComponents(0,0,L(e,ha),L(e,ga),L(e,_a),L(e,va));d.isZero()&&![`second`,`millisecond`,`microsecond`,`nanosecond`].includes(ws(e))&&t===`auto`||(u+=`${Math.abs(d.sec)}${Cc(Math.abs(d.subsec),t)}S`);let f=`${c<0?`-`:``}P${l}`;return u&&(f=`${f}T${u}`),f}function Dc(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ta);return`${xc(n)}-${Sc(r)}-${Sc(i)}${Zo(L(e,ia),t)}`}function Oc({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){return wc(e,t,n,1e6*r+1e3*i+a,o)}function kc(e,t,n,r=`auto`){let{isoDate:{year:i,month:a,day:o},time:{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}=e;return`${xc(i)}-${Sc(a)}-${Sc(o)}T${wc(s,c,l,1e6*u+1e3*d+f,n)}${Zo(t,r)}`}function Ac(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ta),a=`${Sc(r)}-${Sc(i)}`,o=L(e,ia);t!==`always`&&t!==`critical`&&o===`iso8601`||(a=`${xc(n)}-${a}`);let s=Zo(o,t);return s&&(a+=s),a}function nee(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ta),a=`${xc(n)}-${Sc(r)}`,o=L(e,ia);t!==`always`&&t!==`critical`&&o===`iso8601`||(a+=`-${Sc(i)}`);let s=Zo(o,t);return s&&(a+=s),a}function ree(e,t,n=`auto`,r=`auto`,i=`auto`,a=void 0){let o=L(e,ea);if(a){let{unit:e,increment:t,roundingMode:n}=a;o=Ul(o,t,e,n)}let s=L(e,ca),c=mc(s,o),l=kc(gc(s,o),`iso8601`,t,`never`);return i!==`never`&&(l+=oee(c)),r!==`never`&&(l+=`[${r===`critical`?`!`:``}${s}]`),l+=Zo(L(e,ia),n),l}function iee(e){return is.test(e)}function jc(e){let t=fee.exec(e);if(!t)throw RangeError(`invalid time zone offset: ${e}; must match ±HH:MM[:SS.SSSSSSSSS]`);return(t[1]===`-`?-1:1)*(1e9*(60*(60*t[2]+ +(t[3]||0))+ +(t[4]||0))+ +((t[5]||0)+`000000000`).slice(0,9))}let Mc;const aee=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function Nc(e){if(Mc===void 0){let e=Intl.supportedValuesOf?.(`timeZone`);if(e){Mc=new Map;for(let t=0;t<e.length;t++){let n=e[t];Mc.set(su(n),n)}}else Mc=null}let t=su(e),n=Mc?.get(t);if(n)return{identifier:n,primaryIdentifier:n};try{n=Vo(e).resolvedOptions().timeZone}catch{return}if(t===`antarctica/south_pole`&&(n=`Antarctica/McMurdo`),bo.has(e))throw RangeError(`${e} is a legacy time zone identifier from ICU. Use ${n} instead`);let r=[...t].map(((e,n)=>n===0||aee[t[n-1]]?e.toUpperCase():e)).join(``).split(`/`);if(r.length===1)return t===`gb-eire`?{identifier:`GB-Eire`,primaryIdentifier:n}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:n};if(r[0]===`Etc`)return{identifier:`Etc/${[`Zulu`,`Greenwich`,`Universal`].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:n};if(r[0]===`Us`)return{identifier:`US/${r[1]}`,primaryIdentifier:n};let i=new Map([[`Act`,`ACT`],[`Lhi`,`LHI`],[`Nsw`,`NSW`],[`Dar_Es_Salaam`,`Dar_es_Salaam`],[`Port_Of_Spain`,`Port_of_Spain`],[`Port-Au-Prince`,`Port-au-Prince`],[`Isle_Of_Man`,`Isle_of_Man`],[`Comodrivadavia`,`ComodRivadavia`],[`Knox_In`,`Knox_IN`],[`Dumontdurville`,`DumontDUrville`],[`Mcmurdo`,`McMurdo`],[`Denoronha`,`DeNoronha`],[`Easterisland`,`EasterIsland`],[`Bajanorte`,`BajaNorte`],[`Bajasur`,`BajaSur`]]);return r[1]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join(`/`),primaryIdentifier:n}}function Pc(e,t){let{year:n,month:r,day:i,hour:a,minute:o,second:s}=Vc(e,t),c=t%1e3;return c<0&&(c+=1e3),1e6*(Lc({isoDate:{year:n,month:r,day:i},time:{hour:a,minute:o,second:s,millisecond:c}})-t)}function Fc(e,t){return Pc(e,Zl(t,`floor`))}function Ic(e){let t=e<0?`-`:`+`,n=Math.abs(e);return`${t}${wc(Math.floor(n/60),n%60,0,0,`minute`)}`}function oee(e){return Ic(Hl(e,6e10,`halfExpand`)/6e10)}function Lc({isoDate:{year:e,month:t,day:n},time:{hour:r,minute:i,second:a,millisecond:o}}){let s=e%400,c=(e-s)/400,l=new Date;return l.setUTCHours(r,i,a,o),l.setUTCFullYear(s,t-1,n),l.getTime()+0xb7af85d9c00*c}function Rc(e){let t=Lc(e),n=1e3*e.time.microsecond+e.time.nanosecond;return I.default.add(Ql(t),I.default.BigInt(n))}function see(e){let t=Zl(e,`trunc`),n=I.default.toNumber(I.default.remainder(e,Hi));n<0&&(n+=1e6,--t);let r=Math.floor(n/1e3)%1e3,i=n%1e3,a=new Date(t);return{epochMilliseconds:t,isoDate:{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate()},time:{hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function zc(e,t){if(e===`UTC`)return null;let n=Zl(t,`floor`);if(n<vo)return zc(e,Ql(vo));let r=Date.now(),i=Math.max(n,r)+366*co*3,a=n,o=Pc(e,a),s=a,c=o;for(;o===c&&a<i;){if(s=a+2*co*7,s>uo)return null;c=Pc(e,s),o===c&&(a=s)}return o===c?null:Ql(lu((t=>Pc(e,t)),a,s,o,c))}function Bc(e,t){if(e===`UTC`)return null;let n=Zl(t,`ceil`),r=Date.now(),i=r+366*co*3;if(n>i){let t=Bc(e,Ql(i));if(t===null||I.default.lessThan(t,Ql(r)))return t}if(e===`Africa/Casablanca`||e===`Africa/El_Aaiun`){let t=Date.UTC(2088,0,1);if(t<n)return Bc(e,Ql(t))}let a=n-1;if(a<vo)return null;let o=Pc(e,a),s=a,c=o;for(;o===c&&a>vo;){if(s=a-2*co*7,s<vo)return null;c=Pc(e,s),o===c&&(a=s)}return o===c?null:Ql(lu((t=>Pc(e,t)),s,a,c,o))}function Vc(e,t){return function(e){let t=e.split(/[^\w]+/);if(t.length!==7)throw RangeError(`expected 7 parts in "${e}`);let n=+t[0],r=+t[1],i=+t[2],a=t[3];if(a[0]===`b`||a[0]===`B`)i=1-i;else if(a[0]!==`a`&&a[0]!==`A`)throw RangeError(`Unknown era ${a} in "${e}`);let o=t[4]===`24`?0:+t[4],s=+t[5],c=+t[6];if(!(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)&&Number.isFinite(c)))throw RangeError(`Invalid number in "${e}`);return{year:i,month:n,day:r,hour:o,minute:s,second:c}}(Vo(e).format(t))}function Hc(e){return e!==void 0&&!(e%4!=0||e%100==0&&e%400!=0)}function Uc(e,t){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[Hc(e)?`leapyear`:`standard`][t-1]}function Wc(e){let t=[L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va)];for(let e=0;e<t.length;e++){let n=t[e];if(n!==0)return n<0?-1:1}return 0}function Gc(e){let t=[`years`,`months`,`weeks`,`days`];for(let n=0;n<t.length;n++){let r=e[t[n]];if(r!==0)return r<0?-1:1}return 0}function Kc(e){let t=Gc(e.date);return t===0?e.time.sign():t}function qc(e,t){let n=e,r=t;if(!Number.isFinite(n)||!Number.isFinite(r))throw RangeError(`infinity is out of range`);return--r,n+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:n,month:r}}function Jc(e,t,n){let r=e,i=t,a=n;if(!Number.isFinite(a))throw RangeError(`infinity is out of range`);({year:r,month:i}=qc(r,i));let o=146097;if(Math.abs(a)>o){let e=Math.trunc(a/o);r+=400*e,a-=e*o}let s=0,c=i>2?r:r-1;for(;s=Hc(c)?366:365,a<-s;)--r,--c,a+=s;for(c+=1;s=Hc(c)?366:365,a>s;)r+=1,c+=1,a-=s;for(;a<1;)({year:r,month:i}=qc(r,i-1)),a+=Uc(r,i);for(;a>Uc(r,i);)a-=Uc(r,i),{year:r,month:i}=qc(r,i+1);return{year:r,month:i,day:a}}function Yc(e,t,n,r,i,a,o,s,c){let l=Xc(r,i,a,o,s,c);return ds(Jc(e,t,n+l.deltaDays),l)}function Xc(e,t,n,r,i,a){let o,s=e,c=t,l=n,u=r,d=i,f=a;({div:o,mod:f}=Ba(f,3)),d+=o,f<0&&(--d,f+=1e3),{div:o,mod:d}=Ba(d,3),u+=o,d<0&&(--u,d+=1e3),l+=Math.trunc(u/1e3),u%=1e3,u<0&&(--l,u+=1e3),c+=Math.trunc(l/60),l%=60,l<0&&(--c,l+=60),s+=Math.trunc(c/60),c%=60,c<0&&(--s,c+=60);let p=Math.trunc(s/24);return s%=24,s<0&&(--p,s+=24),p+=0,s+=0,c+=0,l+=0,u+=0,d+=0,f+=0,{deltaDays:p,hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function Zc(e,t){let n=us(e,0);if(Gc(n)===0)return e.days;let r=L(t,ta),i=ic(L(t,ia),r,n,`constrain`),a=gl(r.year,r.month-1,r.day),o=gl(i.year,i.month-1,i.day)-a;return e.days+o}function Qc(e){return new(za(`%Temporal.Duration%`))(-L(e,la),-L(e,ua),-L(e,da),-L(e,fa),-L(e,pa),-L(e,ma),-L(e,ha),-L(e,ga),-L(e,_a),-L(e,va))}function $c(e,t,n){return Math.min(n,Math.max(t,e))}function el(e,t,n){let r=$c(t,1,12);return{year:e,month:r,day:$c(n,1,Uc(e,r))}}function tl(e,t,n){if(e<t||e>n)throw RangeError(`value out of range: ${t} <= ${e} <= ${n}`)}function nl(e,t,n){tl(t,1,12),tl(n,1,Uc(e,t))}function rl(e){ol(ds(e,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function il(e,t,n,r,i,a){tl(e,0,23),tl(t,0,59),tl(n,0,59),tl(r,0,999),tl(i,0,999),tl(a,0,999)}function al(e,t,n,r,i,a,o,s,c){nl(e,t,n),il(r,i,a,o,s,c)}function ol(e){let t=Rc(e);(I.default.lessThan(t,mo)||I.default.greaterThan(t,ho))&&cl(t)}function sl(e){Rc(e)}function cl(e){if(I.default.lessThan(e,po)||I.default.greaterThan(e,fo))throw RangeError(`date/time value is outside of supported range`)}function ll({year:e,month:t}){tl(e,go,_o),e===go?tl(t,4,12):e===_o&&tl(t,1,9)}function ul(e,t,n,r,i,a,o,s,c,l){let u=0,d=[e,t,n,r,i,a,o,s,c,l];for(let e=0;e<d.length;e++){let t=d[e];if(t===1/0||t===-1/0)throw RangeError(`infinite values not allowed as duration fields`);if(t!==0){let e=t<0?-1:1;if(u!==0&&e!==u)throw RangeError(`mixed-sign values not allowed as duration fields`);u=e}}if(Math.abs(e)>=2**32||Math.abs(t)>=2**32||Math.abs(n)>=2**32)throw RangeError(`years, months, and weeks must be < 2³²`);let f=Ba(s,3),p=Ba(c,6),m=Ba(l,9),h=Ba(1e6*f.mod+1e3*p.mod+m.mod,9).div,g=86400*r+3600*i+60*a+o+f.div+p.div+m.div+h;if(!Number.isSafeInteger(g))throw RangeError(`total of duration time units cannot exceed 9007199254740991.999999999 s`)}function dl(e){return{date:{years:L(e,la),months:L(e,ua),weeks:L(e,da),days:L(e,fa)},time:Wa.fromComponents(L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va))}}function fl(e){let t=Wa.fromComponents(L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va)).add24HourDays(L(e,fa));return{date:{years:L(e,la),months:L(e,ua),weeks:L(e,da),days:0},time:t}}function pl(e){let t=fl(e),n=Math.trunc(t.time.sec/86400);return ul(t.date.years,t.date.months,t.date.weeks,n,0,0,0,0,0,0),{...t.date,days:n}}function ml(e,t){let n=e.time.sign(),r=e.time.abs().subsec,i=0,a=0,o=e.time.abs().sec,s=0,c=0,l=0;switch(t){case`year`:case`month`:case`week`:case`day`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60,l=Math.trunc(c/24),c%=24;break;case`hour`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60;break;case`minute`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60;break;case`second`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3;break;case`millisecond`:i=Math.trunc(r/1e3),r%=1e3,a=Va(o,3,Math.trunc(i/1e3)),i%=1e3,o=0;break;case`microsecond`:i=Va(o,6,Math.trunc(r/1e3)),r%=1e3,o=0;break;case`nanosecond`:r=Va(o,9,r),o=0}return new(za(`%Temporal.Duration%`))(e.date.years,e.date.months,e.date.weeks,e.date.days+n*l,n*c,n*s,n*o,n*a,n*i,n*r)}function hl(e,t){return Gc(e),t.sign(),{date:e,time:t}}function gl(e,t,n){return Lc({isoDate:{year:e,month:t+1,day:n},time:{hour:0,minute:0,second:0,millisecond:0}})/co}function _l({year:e,month:t,day:n}){if(Math.abs(gl(e,t-1,n))>1e8)throw RangeError(`date/time value is outside the supported range`)}function vl(e,t){let n=t.hour-e.hour,r=t.minute-e.minute,i=t.second-e.second,a=t.millisecond-e.millisecond,o=t.microsecond-e.microsecond,s=t.nanosecond-e.nanosecond;return Wa.fromComponents(n,r,i,a,o,s)}function yl(e,t,n,r,i){let a=Wa.fromEpochNsDiff(t,e);return a=Kl(a,n,r,i),hl({years:0,months:0,weeks:0,days:0},a)}function bl(e,t,n,r){sl(e),sl(t);let i=vl(e.time,t.time),a=i.sign(),o=Jl(e.isoDate,t.isoDate),s=t.isoDate;o===a&&(s=Jc(s.year,s.month,s.day+a),i=i.add24HourDays(-a));let c=Ts(`day`,r),l=ac(n,e.isoDate,s,c);return r!==c&&(i=i.add24HourDays(l.days),l.days=0),hl(l,i)}function xl(e,t,n,r,i){let a=I.default.subtract(t,e);if(I.default.equal(a,Fi))return{date:{years:0,months:0,weeks:0,days:0},time:Wa.ZERO};let o=I.default.lessThan(a,Fi)?-1:1,s=gc(n,e),c=gc(n,t),l,u=0,d=o===1?2:1,f=vl(s.time,c.time);for(f.sign()===-o&&u++;u<=d;u++){l=ds(Jc(c.isoDate.year,c.isoDate.month,c.isoDate.day-u*o),s.time);let e=_c(n,l,`compatible`);if(f=Wa.fromEpochNsDiff(t,e),f.sign()!==-o)break}let p=Ts(`day`,i);return hl(ac(r,s.isoDate,l.isoDate,p),f)}function Sl(e,t,n,r,i,a,o,s,c){let l,u,d,f,p=t;switch(s){case`year`:{let t=Hl(p.date.years,o,`trunc`);l=t,u=t+o*e,d={years:l,months:0,weeks:0,days:0},f={...d,years:u};break}case`month`:{let t=Hl(p.date.months,o,`trunc`);l=t,u=t+o*e,d=us(p.date,0,0,l),f=us(p.date,0,0,u);break}case`week`:{let t=us(p.date,0,0),n=ic(a,r.isoDate,t,`constrain`),i=ac(a,n,Jc(n.year,n.month,n.day+p.date.days),`week`),s=Hl(p.date.weeks+i.weeks,o,`trunc`);l=s,u=s+o*e,d=us(p.date,0,l),f=us(p.date,0,u);break}case`day`:{let t=Hl(p.date.days,o,`trunc`);l=t,u=t+o*e,d=us(p.date,l),f=us(p.date,u);break}}let m=ic(a,r.isoDate,d,`constrain`),h=ic(a,r.isoDate,f,`constrain`),g,_,v=ds(m,r.time),y=ds(h,r.time);i?(g=_c(i,v,`compatible`),_=_c(i,y,`compatible`)):(g=Rc(v),_=Rc(y));let b=Wa.fromEpochNsDiff(n,g),x=Wa.fromEpochNsDiff(_,g),S=Ha(c,e<0?`negative`:`positive`),C=b.add(b).abs().subtract(x.abs()).sign(),w=Math.abs(l)/o%2==0,T=b.isZero()?Math.abs(l):b.cmp(x)?Ua(Math.abs(l),Math.abs(u),C,w,S):Math.abs(u),E=new Wa(I.default.add(I.default.multiply(x.totalNs,I.default.BigInt(l)),I.default.multiply(b.totalNs,I.default.BigInt(o*e)))).fdiv(x.totalNs),ee=T===Math.abs(u);return p={date:ee?f:d,time:Wa.ZERO},{nudgeResult:{duration:p,nudgedEpochNs:ee?_:g,didExpandCalendarUnit:ee},total:E}}function Cl(e,t,n,r,i,a,o,s,c){let l=e,u=Es(s)||r&&s===`day`,d=Kc(l)<0?-1:1,f;return u?{nudgeResult:f}=Sl(d,l,t,n,r,i,o,s,c):f=r?function(e,t,n,r,i,a,o,s){let c=t,l=ic(i,n.isoDate,c.date,`constrain`),u=ds(l,n.time),d=ds(Jc(l.year,l.month,l.day+e),n.time),f=_c(r,u,`compatible`),p=_c(r,d,`compatible`),m=Wa.fromEpochNsDiff(p,f);if(m.sign()!==e)throw RangeError(`time zone returned inconsistent Instants`);let h=I.default.BigInt(Lo[o]*a),g=c.time.round(h,s),_=g.subtract(m),v=_.sign()!==-e,y,b;return v?(y=e,g=_.round(h,s),b=g.addToEpochNs(p)):(y=0,b=g.addToEpochNs(f)),{duration:hl(us(c.date,c.date.days+y),g),nudgedEpochNs:b,didExpandCalendarUnit:v}}(d,l,n,r,i,o,s,c):function(e,t,n,r,i,a){let o=e,s=o.time.add24HourDays(o.date.days),c=s.round(I.default.BigInt(r*Lo[i]),a),l=c.subtract(s),{quotient:u}=s.divmod(lo),{quotient:d}=c.divmod(lo),f=Math.sign(d-u)===s.sign(),p=l.addToEpochNs(t),m=0,h=c;return Ds(n)===`date`&&(m=d,h=c.add(Wa.fromComponents(24*-d,0,0,0,0,0))),{duration:{date:us(o.date,m),time:h},nudgedEpochNs:p,didExpandCalendarUnit:f}}(l,t,a,o,s,c),l=f.duration,f.didExpandCalendarUnit&&s!==`week`&&(l=function(e,t,n,r,i,a,o,s){let c=t;if(s===o)return c;let l=Io.indexOf(o);for(let t=Io.indexOf(s)-1;t>=l;t--){let s=Io[t];if(s===`week`&&o!==`week`)continue;let l;switch(s){case`year`:l={years:c.date.years+e,months:0,weeks:0,days:0};break;case`month`:{let t=c.date.months+e;l=us(c.date,0,0,t);break}case`week`:{let t=c.date.weeks+e;l=us(c.date,0,t);break}}let u=ds(ic(a,r.isoDate,l,`constrain`),r.time),d;if(d=i?_c(i,u,`compatible`):Rc(u),Xi(n,d)===-e)break;c={date:l,time:Wa.ZERO}}return c}(d,l,f.nudgedEpochNs,n,r,i,a,Ts(s,`day`))),l}function wl(e,t,n,r,i,a){return Es(a)||r&&a===`day`?Sl(Kc(e)<0?-1:1,e,t,n,r,i,1,a,`trunc`).total:ql(e.time.add24HourDays(e.date.days),a)}function Tl(e,t,n,r,i,a,o){if(Xl(e,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Wa.ZERO};ol(e),ol(t);let s=bl(e,t,n,r);return a===`nanosecond`&&i===1?s:Cl(s,Rc(t),e,null,n,r,i,a,o)}function El(e,t,n,r,i,a,o,s){if(Ds(i)===`time`)return yl(e,t,a,o,s);let c=xl(e,t,n,r,i);return o===`nanosecond`&&a===1?c:Cl(c,t,gc(n,e),n,r,i,a,o,s)}function Dl(e,t,n,r,i,a){let o=No.reduce(((e,t)=>{let i=t[0],a=t[1],o=t[2];return n!==`datetime`&&o!==n||r.includes(a)||e.push(a,i),e}),[]),s=Ss(t,`largestUnit`,n,`auto`);if(r.includes(s))throw RangeError(`largestUnit must be one of ${o.join(`, `)}, not ${s}`);let c=_s(t),l=ms(t,`trunc`);e===`since`&&(l=function(e){switch(e){case`ceil`:return`floor`;case`floor`:return`ceil`;case`halfCeil`:return`halfFloor`;case`halfFloor`:return`halfCeil`;default:return e}}(l));let u=Ss(t,`smallestUnit`,n,i);if(r.includes(u))throw RangeError(`smallestUnit must be one of ${o.join(`, `)}, not ${u}`);let d=Ts(a,u);if(s===`auto`&&(s=d),Ts(s,u)!==s)throw RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${u}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];return f!==void 0&&vs(c,f,!1),{largestUnit:s,roundingIncrement:c,roundingMode:l,smallestUnit:u}}function Ol(e,t,n,r){let i=Ls(n),a=Dl(e,ru(r),`time`,[],`nanosecond`,`second`),o=ml(yl(L(t,ea),L(i,ea),a.roundingIncrement,a.smallestUnit,a.roundingMode),a.largestUnit);return e===`since`&&(o=Qc(o)),o}function kl(e,t,n,r){let i=Ns(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`date`,[],`day`,`day`),c=za(`%Temporal.Duration%`),l=L(t,ta),u=L(i,ta);if(Jl(l,u)===0)return new c;let d={date:ac(a,l,u,s.largestUnit),time:Wa.ZERO};if(s.smallestUnit!==`day`||s.roundingIncrement!==1){let e=ds(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});d=Cl(d,Rc(ds(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let f=ml(d,`day`);return e===`since`&&(f=Qc(f)),f}function Al(e,t,n,r){let i=Fs(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`datetime`,[],`nanosecond`,`day`),c=za(`%Temporal.Duration%`),l=L(t,na),u=L(i,na);if(Xl(l,u)===0)return new c;let d=ml(Tl(l,u,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return e===`since`&&(d=Qc(d)),d}function jl(e,t,n,r){let i=zs(n),a=Dl(e,ru(r),`time`,[],`nanosecond`,`hour`),o=vl(L(t,ra),L(i,ra));o=Kl(o,a.roundingIncrement,a.smallestUnit,a.roundingMode);let s=ml(hl({years:0,months:0,weeks:0,days:0},o),a.largestUnit);return e===`since`&&(s=Qc(s)),s}function Ml(e,t,n,r){let i=Vs(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between months of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`date`,[`week`,`day`],`month`,`year`),c=za(`%Temporal.Duration%`);if(Jl(L(t,ta),L(i,ta))==0)return new c;let l=As(a,L(t,ta),`year-month`);l.day=1;let u=lc(a,l,`constrain`),d=As(a,L(i,ta),`year-month`);d.day=1;let f=lc(a,d,`constrain`),p={date:us(ac(a,u,f,s.largestUnit),0,0),time:Wa.ZERO};if(s.smallestUnit!==`month`||s.roundingIncrement!==1){let e=ds(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Cl(p,Rc(ds(f,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let m=ml(p,`day`);return e===`since`&&(m=Qc(m)),m}function Nl(e,t,n,r){let i=Us(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`datetime`,[],`nanosecond`,`hour`),c=L(t,ea),l=L(i,ea),u=za(`%Temporal.Duration%`),d;if(Ds(s.largestUnit)!==`date`)d=ml(yl(c,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let e=L(t,ca);if(!pc(e,L(i,ca)))throw RangeError(`When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.`);if(I.default.equal(c,l))return new u;d=ml(El(c,l,e,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),`hour`)}return e===`since`&&(d=Qc(d)),d}function Pl({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){let s=n,c=a;return s+=o.sec,c+=o.subsec,Xc(e,t,s,r,i,c)}function Fl(e,t){let n=t.addToEpochNs(e);return cl(n),n}function Il(e,t,n,r,i=`constrain`){if(Gc(r.date)===0)return Fl(e,r.time);let a=gc(t,e);return Fl(_c(t,ds(ic(n,a.isoDate,r.date,i),a.time),`compatible`),r.time)}function Ll(e,t,n){let r=Is(n);e===`subtract`&&(r=Qc(r));let i=Ts(ws(t),ws(r));if(Es(i))throw RangeError(`For years, months, or weeks arithmetic, use date arithmetic relative to a starting point`);let a=fl(t),o=fl(r);return ml(hl({years:0,months:0,weeks:0,days:0},a.time.add(o.time)),i)}function Rl(e,t,n){let r=Is(n);e===`subtract`&&(r=Qc(r));let i=ws(r);if(Ds(i)===`date`)throw RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let a=fl(r);return tc(Fl(L(t,ea),a.time))}function zl(e,t,n,r){let i=L(t,ia),a=Is(n);e===`subtract`&&(a=Qc(a));let o=pl(a),s=fs(ru(r));return Gs(ic(i,L(t,ta),o,s),i)}function Bl(e,t,n,r){let i=Is(n);e===`subtract`&&(i=Qc(i));let a=fs(ru(r)),o=L(t,ia),s=fl(i),c=L(t,na),l=Pl(c.time,s.time),u=us(s.date,l.deltaDays);return ul(u.years,u.months,u.weeks,u.days,0,0,0,0,0,0),qs(ds(ic(o,c.isoDate,u,a),l),o)}function Vl(e,t,n){let r=Is(n);e===`subtract`&&(r=Qc(r));let i=fl(r),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Pl(L(t,ra),i.time);return Zs(cs(a,o,s,c,l,u,`reject`))}function cee(e,t,n,r){let i=Is(n);e===`subtract`&&(i=Qc(i));let a=fs(ru(r)),o=Wc(i),s=L(t,ia),c=As(s,L(t,ta),`year-month`);c.day=1;let l=lc(s,c,`constrain`);if(o<0){let e=ic(s,l,{months:1},`constrain`);l=Jc(e.year,e.month,e.day-1)}let u=pl(i);return rl(l),$s(uc(s,As(s,ic(s,l,u,a),`year-month`),a),s)}function lee(e,t,n,r){let i=Is(n);e===`subtract`&&(i=Qc(i));let a=fs(ru(r)),o=L(t,ca),s=L(t,ia),c=dl(i);return nc(Il(L(t,ea),o,s,c,a),o,s)}function Hl(e,t,n){let r=Math.trunc(e/t),i=e%t,a=e<0?`negative`:`positive`,o=Math.abs(r),s=o+1,c=nu(Math.abs(2*i)-t),l=o%2==0,u=Ha(n,a),d=i===0?o:Ua(o,s,c,l,u);return t*(a===`positive`?d:-d)}function Ul(e,t,n,r){let i=Lo[n]*t;return function(e,t,n){let r=qi(e),i=qi(t),a=I.default.divide(r,i),o=I.default.remainder(r,i),s=Ha(n,`positive`),c,l;I.default.lessThan(r,Fi)?(c=I.default.subtract(a,Ii),l=a):(c=a,l=I.default.add(a,Ii));let u=Xi(Yi(I.default.multiply(o,Li)),i)*(I.default.lessThan(r,Fi)?-1:1)+0,d=I.default.equal(o,Fi)?a:Ua(c,l,u,Ji(c),s);return I.default.multiply(d,i)}(e,I.default.BigInt(i),r)}function Wl(e,t,n,r){sl(e);let{year:i,month:a,day:o}=e.isoDate,s=Gl(e.time,t,n,r);return ds(Jc(i,a,o+s.deltaDays),s)}function Gl({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o,s,c){let l;switch(s){case`day`:case`hour`:l=1e3*(1e3*(1e3*(60*(60*e+t)+n)+r)+i)+a;break;case`minute`:l=1e3*(1e3*(1e3*(60*t+n)+r)+i)+a;break;case`second`:l=1e3*(1e3*(1e3*n+r)+i)+a;break;case`millisecond`:l=1e3*(1e3*r+i)+a;break;case`microsecond`:l=1e3*i+a;break;case`nanosecond`:l=a}let u=Lo[s],d=Hl(l,u*o,c)/u;switch(s){case`day`:return{deltaDays:d,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case`hour`:return Xc(d,0,0,0,0,0);case`minute`:return Xc(e,d,0,0,0,0);case`second`:return Xc(e,t,d,0,0,0);case`millisecond`:return Xc(e,t,n,d,0,0);case`microsecond`:return Xc(e,t,n,r,d,0);case`nanosecond`:return Xc(e,t,n,r,i,d);default:throw Error(`Invalid unit ${s}`)}}function Kl(e,t,n,r){let i=Lo[n];return e.round(I.default.BigInt(i*t),r)}function ql(e,t){let n=Lo[t];return e.fdiv(I.default.BigInt(n))}function Jl(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:nu(e.day-t.day):nu(e.month-t.month):nu(e.year-t.year)}function Yl(e,t){return e.hour===t.hour?e.minute===t.minute?e.second===t.second?e.millisecond===t.millisecond?e.microsecond===t.microsecond?e.nanosecond===t.nanosecond?0:nu(e.nanosecond-t.nanosecond):nu(e.microsecond-t.microsecond):nu(e.millisecond-t.millisecond):nu(e.second-t.second):nu(e.minute-t.minute):nu(e.hour-t.hour)}function Xl(e,t){let n=Jl(e.isoDate,t.isoDate);return n===0?Yl(e.time,t.time):n}function uee(e){let t=$l(e);return globalThis.BigInt===void 0?t:globalThis.BigInt(t.toString(10))}function Zl(e,t){let{quotient:n,remainder:r}=Zi(qi(e),Hi),i=I.default.toNumber(n);return t===`floor`&&I.default.toNumber(r)<0&&--i,t===`ceil`&&I.default.toNumber(r)>0&&(i+=1),i}function Ql(e){if(!Number.isInteger(e))throw RangeError(`epoch milliseconds must be an integer`);return I.default.multiply(I.default.BigInt(e),Hi)}function $l(e){let t=e;if(typeof e==`object`){let n=e[Symbol.toPrimitive];n&&typeof n==`function`&&(t=n.call(e,`number`))}if(typeof t==`number`)throw TypeError(`cannot convert number to bigint`);return typeof t==`bigint`?I.default.BigInt(t.toString(10)):I.default.BigInt(t)}const eu=(()=>{let e=I.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),n=I.default.BigInt(t),r=I.default.add(Ql(t),e);return e=I.default.remainder(n,Hi),I.default.greaterThan(r,fo)?fo:I.default.lessThan(r,po)?po:r}})();function tu(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function nu(e){return e<0?-1:e>0?1:e}function ru(e){if(e===void 0)return Object.create(null);if(xo(e)&&e!==null)return e;throw TypeError(`Options parameter must be an object, not `+(e===null?`null`:typeof e))}function iu(e,t){let n=Object.create(null);return n[e]=t,n}function au(e,t,n,r){let i=e[t];if(i!==void 0){if(i=Co(i),!n.includes(i))throw RangeError(`${t} must be one of ${n.join(`, `)}, not ${i}`);return i}if(r===xs)throw RangeError(`${t} option is required`);return r}function ou(e){let t=su(e);if(!yo.includes(su(t)))throw RangeError(`invalid calendar identifier ${t}`);switch(t){case`ethiopic-amete-alem`:return`ethioaa`;case`islamicc`:return`islamic-civil`}return t}function su(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function cu(e){throw TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${e===`PlainMonthDay`?`Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))`:`Temporal.${e}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}const dee=RegExp(`^${Qa.source}$`),fee=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\\d{1,9}))?)?)?$`);function lu(e,t,n,r=e(t),i=e(n)){let a=t,o=n,s=r,c=i;for(;o-a>1;){let t=Math.trunc((a+o)/2),n=e(t);n===s?(a=t,s=n):n===c&&(o=t,c=n)}return o}function uu(e){return[...e]}function du(e,t){if(e!==`gregory`&&e!==`iso8601`)return;let n=pu[e],r=t.year,{dayOfWeek:i,dayOfYear:a,daysInYear:o}=n.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=n.getFirstDayOfWeek(),c=n.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,u=(i-a+7001-s)%7,d=Math.floor((a-1+u)/7);if(7-u>=c&&++d,d==0)d=function(e,t,n,r){let i=(r-e-n+1)%7;i<0&&(i+=7);let a=Math.floor((n+i-1)/7);return 7-i>=t&&++a,a}(s,c,a+n.isoToDate(n.dateAdd(t,{years:-1},`constrain`),{daysInYear:!0}).daysInYear,i),r--;else if(a>=o-5){let e=(l+o-a)%7;e<0&&(e+=7),6-e>=c&&a+7-l>o&&(d=1,r++)}return{week:d,year:r}}function fu(e,t,n,r,i){if(t!==i.year){if(e*(t-i.year)>0)return!0}else if(n!==i.month){if(e*(n-i.month)>0)return!0}else if(r!==i.day&&e*(r-i.day)>0)return!0;return!1}const pu={};function mu(e){if(!e.startsWith(`M`))throw RangeError(`Invalid month code: ${e}. Month codes must start with M.`);let t=+e.slice(1);if(Number.isNaN(t))throw RangeError(`Invalid month code: ${e}`);return t}function hu(e,t=!1){return`M${`${e}`.padStart(2,`0`)}${t?`L`:``}`}function gu(e,t=void 0,n=12){let{month:r,monthCode:i}=e;if(i===void 0){if(r===void 0)throw TypeError(`Either month or monthCode are required`);t===`reject`&&tl(r,1,n),t===`constrain`&&(r=$c(r,1,n)),i=hu(r)}else{let e=mu(i);if(i!==hu(e))throw RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==e)throw RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=e,r<1||r>n)throw RangeError(`Invalid monthCode: ${i}`)}return{...e,month:r,monthCode:i}}pu.iso8601={resolveFields(e,t){if((t===`date`||t===`year-month`)&&e.year===void 0)throw TypeError(`year is required`);if((t===`date`||t===`month-day`)&&e.day===void 0)throw TypeError(`day is required`);Object.assign(e,gu(e))},dateToISO:(e,t)=>ss(e.year,e.month,e.day,t),monthDayToISOReferenceDate(e,t){let{month:n,day:r}=ss(e.year??1972,e.month,e.day,t);return{month:n,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];t.add(r),r===`month`?t.add(`monthCode`):r===`monthCode`&&t.add(`month`)}return uu(t)},dateAdd(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a){let{year:o,month:s,day:c}=e;return o+=t,s+=n,{year:o,month:s}=qc(o,s),{year:o,month:s,day:c}=ss(o,s,c,a),c+=i+7*r,Jc(o,s,c)},dateUntil(e,t,n){let r=-Jl(e,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,a=0,o=0;if(n===`year`||n===`month`){let s=t.year-e.year;for(s!==0&&(s-=r);!fu(r,e.year+s,e.month,e.day,t);)a=s,s+=r;let c=r;for(i=qc(e.year+a,e.month+c);!fu(r,i.year,i.month,e.day,t);)o=c,c+=r,i=qc(i.year,i.month+r);n===`month`&&(o+=12*a,a=0)}i=qc(e.year+a,e.month+o);let s=el(i.year,i.month,e.day),c=0,l=gl(t.year,t.month-1,t.day)-gl(s.year,s.month-1,s.day);return n===`week`&&(c=Math.trunc(l/7),l%=7),{years:a,months:o,weeks:c,days:l}},isoToDate({year:e,month:t,day:n},r){let i={era:void 0,eraYear:void 0,year:e,month:t,day:n,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=hu(t)),r.dayOfWeek){let r=t+(t<3?10:-2),a=e-(t<3?1:0),o=Math.floor(a/100),s=a-100*o,c=(n+Math.floor(2.6*r-.2)+(s+Math.floor(s/4))+(Math.floor(o/4)-2*o))%7;i.dayOfWeek=c+(c<=0?7:0)}if(r.dayOfYear){let r=n;for(let n=t-1;n>0;n--)r+=Uc(e,n);i.dayOfYear=r}return r.weekOfYear&&(i.weekOfYear=du(`iso8601`,{year:e,month:t,day:n})),r.daysInMonth&&(i.daysInMonth=Uc(e,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=Hc(e),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var _u=class e{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let n=0;for(let r of t.map.entries()){if(++n>e.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(e){let t=this.map.get(e);return t&&(this.hits++,this.report()),this.calls++,t}set(e,t){this.map.set(e,t),this.misses++,this.report()}report(){}setObject(t){if(e.objectMap.get(t))throw RangeError(`object already cached`);e.objectMap.set(t,this),this.report()}static getCacheForObject(t){let n=e.objectMap.get(t);return n||(n=new e,e.objectMap.set(t,n)),n}};function vu({isoYear:e,isoMonth:t,isoDay:n}){return`${xc(e)}-${Sc(t)}-${Sc(n)}T00:00Z`}function yu(e,t){return{years:e.year-t.year,months:e.month-t.month,days:e.day-t.day}}_u.objectMap=new WeakMap,_u.MAX_CACHE_ENTRIES=1e3;var bu=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:`numeric`,month:`numeric`,year:`numeric`,era:`short`,timeZone:`UTC`})),this.formatter}getCalendarParts(e){let t=this.getFormatter(),n=new Date(e);if(e===`-271821-04-19T00:00Z`){let e=t.resolvedOptions();t=new Intl.DateTimeFormat(e.locale,{...e,timeZone:`Etc/GMT+1`}),n=new Date(`-271821-04-20T00:00Z`)}try{return t.formatToParts(n)}catch{throw RangeError(`Invalid ISO date: ${e}`)}}isoToCalendarDate(e,t){let{year:n,month:r,day:i}=e,a=JSON.stringify({func:`isoToCalendarDate`,isoYear:n,isoMonth:r,isoDay:i,id:this.id}),o=t.get(a);if(o)return o;let s=vu({isoYear:n,isoMonth:r,isoDay:i}),c=this.getCalendarParts(s),l={};for(let e=0;e<c.length;e++){let{type:t,value:n}=c[e];if(t!==`year`&&t!==`relatedYear`||(this.hasEra?l.eraYear=+n:l.year=+n),t===`month`){let e=/^([0-9]*)(.*?)$/.exec(n);if(!e||e.length!=3||!e[1]&&!e[2])throw RangeError(`Unexpected month: ${n}`);if(l.month=e[1]?+e[1]:1,l.month<1)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(l.month>13)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);e[2]&&(l.monthExtra=e[2])}t===`day`&&(l.day=+n),this.hasEra&&t===`era`&&n!=null&&n!==``&&(l.era=n.split(` (`)[0].normalize(`NFD`).replace(/[^-0-9 \p{L}]/gu,``).replace(/ /g,`-`).toLowerCase())}if(this.hasEra&&l.eraYear===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let e=this.eras.find((e=>l.era===e.genericName));e&&(l.era=e.code)}if(this.reviseIntlEra){let{era:t,eraYear:n}=this.reviseIntlEra(l,e);l.era=t,l.eraYear=n}this.checkIcuBugs&&this.checkIcuBugs(e);let u=this.adjustCalendarDate(l,t,`constrain`,!0);if(u.year===void 0)throw RangeError(`Missing year converting ${JSON.stringify(e)}`);if(u.month===void 0)throw RangeError(`Missing month converting ${JSON.stringify(e)}`);if(u.day===void 0)throw RangeError(`Missing day converting ${JSON.stringify(e)}`);return t.set(a,u),[`constrain`,`reject`].forEach((n=>{let r=JSON.stringify({func:`calendarToIsoDate`,year:u.year,month:u.month,day:u.day,overflow:n,id:this.id});t.set(r,e)})),u}validateCalendarDate(e){let{month:t,year:n,day:r,eraYear:i,monthCode:a,monthExtra:o}=e;if(o!==void 0)throw RangeError("Unexpected `monthExtra` value");if(n===void 0&&i===void 0)throw TypeError(`year or eraYear is required`);if(t===void 0&&a===void 0)throw TypeError(`month or monthCode is required`);if(r===void 0)throw RangeError(`Missing day`);if(a!==void 0){if(typeof a!=`string`)throw RangeError(`monthCode must be a string, not `+typeof a);if(!/^M([01]?\d)(L?)$/.test(a))throw RangeError(`Invalid monthCode: ${a}`)}if(this.hasEra&&e.era===void 0!=(e.eraYear===void 0))throw TypeError(`properties era and eraYear must be provided together`)}adjustCalendarDate(e,t=void 0,n=`constrain`,r=!1){if(this.calendarType===`lunisolar`)throw RangeError(`Override required for lunisolar calendars`);let i=e;this.validateCalendarDate(i);let a=this.monthsInYear(i,t),{month:o,monthCode:s}=i;return{month:o,monthCode:s}=gu(i,n,a),{...i,month:o,monthCode:s}}regulateMonthDayNaive(e,t,n){let r=this.monthsInYear(e,n),{month:i,day:a}=e;return t===`reject`?(tl(i,1,r),tl(a,1,this.maximumMonthLength(e))):(i=$c(i,1,r),a=$c(a,1,this.maximumMonthLength({...e,month:i}))),{...e,month:i,day:a}}calendarToIsoDate(e,t=`constrain`,n){let r=e,i=this.adjustCalendarDate(e,n,t,!1);i=this.regulateMonthDayNaive(i,t,n);let{year:a,month:o,day:s}=i,c=JSON.stringify({func:`calendarToIsoDate`,year:a,month:o,day:s,overflow:t,id:this.id}),l,u=n.get(c);if(u||r.year!==void 0&&r.month!==void 0&&r.day!==void 0&&(r.year!==i.year||r.month!==i.month||r.day!==i.day)&&(l=JSON.stringify({func:`calendarToIsoDate`,year:r.year,month:r.month,day:r.day,overflow:t,id:this.id}),u=n.get(l),u))return u;let d=this.estimateIsoDate({year:a,month:o,day:s}),f=e=>{let r=this.addDaysIso(d,e);if(i.day>this.minimumMonthLength(i)){let e=this.isoToCalendarDate(r,n);for(;e.month!==o||e.year!==a;){if(t===`reject`)throw RangeError(`day ${s} does not exist in month ${o} of year ${a}`);r=this.addDaysIso(r,-1),e=this.isoToCalendarDate(r,n)}}return r},p=0,m=this.isoToCalendarDate(d,n),h=yu(i,m);if(h.years!==0||h.months!==0||h.days!==0){let e=365*h.years+30*h.months+h.days;d=this.addDaysIso(d,e),m=this.isoToCalendarDate(d,n),h=yu(i,m),h.years===0&&h.months===0?d=f(h.days):p=this.compareCalendarDates(i,m)}let g=8;for(;p;){d=this.addDaysIso(d,p*g);let e=m;m=this.isoToCalendarDate(d,n);let a=p;if(p=this.compareCalendarDates(i,m),p){if(h=yu(i,m),h.years===0&&h.months===0)d=f(h.days),p=0;else if(a&&p!==a)if(g>1)g/=2;else{if(t===`reject`)throw RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...r})}`);this.compareCalendarDates(m,e)>0&&(d=this.addDaysIso(d,-1)),p=0}}}if(n.set(c,d),l&&n.set(l,d),i.year===void 0||i.month===void 0||i.day===void 0||i.monthCode===void 0||this.hasEra&&(i.era===void 0||i.eraYear===void 0))throw RangeError(`Unexpected missing property`);return d}compareCalendarDates(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:nu(e.day-t.day):nu(e.month-t.month):nu(e.year-t.year)}regulateDate(e,t=`constrain`,n){let r=this.calendarToIsoDate(e,t,n);return this.isoToCalendarDate(r,n)}addDaysIso(e,t){return Jc(e.year,e.month,e.day+t)}addDaysCalendar(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.addDaysIso(r,t);return this.isoToCalendarDate(i,n)}addMonthsCalendar(e,t,n,r){let i=e,{day:a}=i;for(let e=0,n=Math.abs(t);e<n;e++){let{month:e}=i,n=i,o=t<0?-Math.max(a,this.daysInPreviousMonth(i,r)):this.daysInMonth(i,r),s=this.calendarToIsoDate(i,`constrain`,r),c=this.addDaysIso(s,o);if(i=this.isoToCalendarDate(c,r),t>0){let t=this.monthsInYear(n,r);for(;i.month-1!=e%t;)c=this.addDaysIso(c,-1),i=this.isoToCalendarDate(c,r)}i.day!==a&&(i=this.regulateDate({...i,day:a},`constrain`,r))}if(n===`reject`&&i.day!==a)throw RangeError(`Day ${a} does not exist in resulting calendar month`);return i}addCalendar(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a,o){let{year:s,day:c,monthCode:l}=e,u=this.adjustCalendarDate({year:s+t,monthCode:l,day:c},o),d=this.addMonthsCalendar(u,n,a,o),f=i+7*r;return this.addDaysCalendar(d,f,o)}untilCalendar(e,t,n,r){let i=0,a=0,o=0,s=0;switch(n){case`day`:i=this.calendarDaysUntil(e,t,r);break;case`week`:{let n=this.calendarDaysUntil(e,t,r);i=n%7,a=(n-i)/7;break}case`month`:case`year`:{let a=this.compareCalendarDates(t,e);if(!a)return{years:0,months:0,weeks:0,days:0};let c=t.year-e.year,l=t.day-e.day;if(n===`year`&&c){let n=0;t.monthCode>e.monthCode&&(n=1),t.monthCode<e.monthCode&&(n=-1),n||=Math.sign(l),s=n*a<0?c-a:c}let u,d=s?this.addCalendar(e,{years:s},`constrain`,r):e;do o+=a,u=d,d=this.addMonthsCalendar(u,a,`constrain`,r),d.day!==e.day&&(d=this.regulateDate({...d,day:e.day},`constrain`,r));while(this.compareCalendarDates(t,d)*a>=0);o-=a,i=this.calendarDaysUntil(u,t,r);break}}return{years:s,months:o,weeks:a,days:i}}daysInMonth(e,t){let{day:n}=e,r=this.maximumMonthLength(e),i=this.minimumMonthLength(e);if(i===r)return i;let a=n<=r-i?r:i,o=this.calendarToIsoDate(e,`constrain`,t),s=this.addDaysIso(o,a),c=this.isoToCalendarDate(s,t),l=this.addDaysIso(s,-c.day);return this.isoToCalendarDate(l,t).day}daysInPreviousMonth(e,t){let{day:n,month:r,year:i}=e,a={year:r>1?i:i-1,month:r,day:1},o=r>1?r-1:this.monthsInYear(a,t);a={...a,month:o};let s=this.minimumMonthLength(a),c=this.maximumMonthLength(a);if(s===c)return c;let l=this.calendarToIsoDate(e,`constrain`,t),u=this.addDaysIso(l,-n);return this.isoToCalendarDate(u,t).day}startOfCalendarYear(e){return{year:e.year,month:1,monthCode:`M01`,day:1}}startOfCalendarMonth(e){return{year:e.year,month:e.month,day:1}}calendarDaysUntil(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.calendarToIsoDate(t,`constrain`,n);return gl(i.year,i.month-1,i.day)-gl(r.year,r.month-1,r.day)}monthDaySearchStartYear(e,t){return 1972}monthDayFromFields(e,t,n){let r,i,a,o,s,{era:c,eraYear:l,year:u,month:d,monthCode:f,day:p}=e;if(d!==void 0&&u===void 0&&(!this.hasEra||c===void 0||l===void 0))throw TypeError(`when month is present, year (or era and eraYear) are required`);(f===void 0||u!==void 0||this.hasEra&&l!==void 0)&&({monthCode:f,day:p}=this.isoToCalendarDate(this.calendarToIsoDate(e,t,n),n));let m={year:this.monthDaySearchStartYear(f,p),month:12,day:31},h=this.isoToCalendarDate(m,n),g=h.monthCode>f||h.monthCode===f&&h.day>=p?h.year:h.year-1;for(let e=0;e<20;e++){let c=this.adjustCalendarDate({day:p,monthCode:f,year:g-e},n),l=this.calendarToIsoDate(c,`constrain`,n),u=this.isoToCalendarDate(l,n);if({year:r,month:i,day:a}=l,u.monthCode===f&&u.day===p)return{month:i,day:a,year:r};if(t===`constrain`){let e=this.maxLengthOfMonthCodeInAnyYear(u.monthCode);if(u.monthCode===f&&u.day===e&&p>e)return{month:i,day:a,year:r};(o===void 0||u.monthCode===o.monthCode&&u.day>o.day)&&(o=u,s=l)}}if(t===`constrain`&&s!==void 0)return s;throw RangeError(`No recent ${this.id} year with monthCode ${f} and day ${p}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},pee=class extends bu{constructor(){super(...arguments),this.id=`hebrew`,this.calendarType=`lunisolar`,this.months={Tishri:{leap:1,regular:1,monthCode:`M01`,days:30},Heshvan:{leap:2,regular:2,monthCode:`M02`,days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:`M03`,days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:`M04`,days:29},Shevat:{leap:5,regular:5,monthCode:`M05`,days:30},Adar:{leap:void 0,regular:6,monthCode:`M06`,days:29},"Adar I":{leap:6,regular:void 0,monthCode:`M05L`,days:30},"Adar II":{leap:7,regular:void 0,monthCode:`M06`,days:29},Nisan:{leap:8,regular:7,monthCode:`M07`,days:30},Iyar:{leap:9,regular:8,monthCode:`M08`,days:29},Sivan:{leap:10,regular:9,monthCode:`M09`,days:30},Tamuz:{leap:11,regular:10,monthCode:`M10`,days:29},Av:{leap:12,regular:11,monthCode:`M11`,days:30},Elul:{leap:13,regular:12,monthCode:`M12`,days:29}}}inLeapYear(e){let{year:t}=e;return(7*t+1)%19<7}monthsInYear(e){return this.inLeapYear(e)?13:12}minimumMonthLength(e){return this.minMaxMonthLength(e,`min`)}maximumMonthLength(e){return this.minMaxMonthLength(e,`max`)}minMaxMonthLength(e,t){let{month:n,year:r}=e,i=this.getMonthCode(r,n),a=Object.entries(this.months).find((e=>e[1].monthCode===i));if(a===void 0)throw RangeError(`unmatched Hebrew month: ${n}`);let o=a[1].days;return typeof o==`number`?o:o[t]}maxLengthOfMonthCodeInAnyYear(e){return[`M04`,`M06`,`M08`,`M10`,`M12`].includes(e)?29:30}estimateIsoDate(e){let{year:t}=e;return{year:t-3760,month:1,day:1}}getMonthCode(e,t){return this.inLeapYear({year:e})?t===6?hu(5,!0):hu(t<6?t:t-1):hu(t)}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthCode:o,day:s,monthExtra:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(c){let e=this.months[c];if(!e)throw RangeError(`Unrecognized month from formatToParts: ${c}`);a=this.inLeapYear({year:i})?e.leap:e.regular}return o=this.getMonthCode(i,a),{year:i,month:a,day:s,monthCode:o}}if(this.validateCalendarDate(e),a===void 0)if(o.endsWith(`L`)){if(o!==`M05L`)throw RangeError(`Hebrew leap month must have monthCode M05L, not ${o}`);if(a=6,!this.inLeapYear({year:i})){if(n===`reject`)throw RangeError(`Hebrew monthCode M05L is invalid in year ${i} which is not a leap year`);a=6,o=`M06`}}else{a=mu(o),this.inLeapYear({year:i})&&a>=6&&a++;let e=this.monthsInYear({year:i});if(a<1||a>e)throw RangeError(`Invalid monthCode: ${o}`)}else if(n===`reject`?(tl(a,1,this.monthsInYear({year:i})),tl(s,1,this.maximumMonthLength({year:i,month:a}))):(a=$c(a,1,this.monthsInYear({year:i})),s=$c(s,1,this.maximumMonthLength({year:i,month:a}))),o===void 0)o=this.getMonthCode(i,a);else if(this.getMonthCode(i,a)!==o)throw RangeError(`monthCode ${o} doesn't correspond to month ${a} in Hebrew year ${i}`);return{...e,day:s,month:a,monthCode:o,year:i}}},xu=class extends bu{constructor(){super(...arguments),this.calendarType=`lunar`,this.DAYS_PER_ISLAMIC_YEAR=354.3666666666667,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(e,t){let n={year:e.year,month:1,monthCode:`M01`,day:1},r={year:e.year+1,month:1,monthCode:`M01`,day:1};return this.calendarDaysUntil(n,r,t)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:Math.floor(t*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},mee=class extends xu{constructor(){super(...arguments),this.id=`islamic`}},hee=class extends xu{constructor(){super(...arguments),this.id=`islamic-umalqura`}},gee=class extends xu{constructor(){super(...arguments),this.id=`islamic-tbla`}},_ee=class extends xu{constructor(){super(...arguments),this.id=`islamic-civil`}},vee=class extends xu{constructor(){super(...arguments),this.id=`islamic-rgsa`}},yee=class extends xu{constructor(){super(...arguments),this.id=`islamicc`}},bee=class extends bu{constructor(){super(...arguments),this.id=`persian`,this.calendarType=`solar`}inLeapYear(e,t){return this.daysInMonth({year:e.year,month:12,day:1},t)===30}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===12?29:t<=6?31:30}maximumMonthLength(e){let{month:t}=e;return t===12?30:t<=6?31:30}maxLengthOfMonthCodeInAnyYear(e){return mu(e)<=6?31:30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:t+621,month:1,day:1}}},xee=class extends bu{constructor(){super(...arguments),this.id=`indian`,this.calendarType=`solar`,this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date(`0000-01-01T00:00Z`).toLocaleDateString(`en-US-u-ca-indian`,{timeZone:`UTC`})!==`10/11/-79 Saka`}inLeapYear(e){return Su(e.year+78)}monthsInYear(){return 12}minimumMonthLength(e){return this.getMonthInfo(e).length}maximumMonthLength(e){return this.getMonthInfo(e).length}maxLengthOfMonthCodeInAnyYear(e){let t=mu(e),n=this.months[t];return n=n.leap??n,n.length}getMonthInfo(e){let{month:t}=e,n=this.months[t];if(n===void 0)throw RangeError(`Invalid month: ${t}`);return this.inLeapYear(e)&&n.leap&&(n=n.leap),n}estimateIsoDate(e){let t=this.adjustCalendarDate(e),n=this.getMonthInfo(t);return Jc(t.year+78+(n.nextYear?1:0),n.month,n.day+t.day-1)}checkIcuBugs(e){if(this.vulnerableToBceBug&&e.year<1)throw RangeError(`calendar '${this.id}' is broken for ISO dates before 0001-01-01 (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)`)}};function Su(e){return e%4==0&&(e%100!=0||e%400==0)}var Cu=class extends bu{constructor(e,t){super(),this.calendarType=`solar`,this.id=e,this.isoEpoch=t}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Su(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][mu(e)-1]}estimateIsoDate(e){let t=this.adjustCalendarDate(e);return ss(t.year+this.isoEpoch.year,t.month+this.isoEpoch.month,t.day+this.isoEpoch.day,`constrain`)}},wu=class extends bu{constructor(e,t){super(),this.hasEra=!0,this.calendarType=`solar`,this.id=e;let{eras:n,anchorEra:r}=function(e){let t,n=e;if(n.length===0)throw RangeError(`Invalid era data: eras are required`);if(n.length===1&&n[0].reverseOf)throw RangeError(`Invalid era data: anchor era cannot count years backwards`);if(n.length===1&&!n[0].code)throw RangeError(`Invalid era data: at least one named era is required`);if(n.filter((e=>e.reverseOf!=null)).length>1)throw RangeError(`Invalid era data: only one era can count years backwards`);n.forEach((e=>{if(e.isAnchor||!e.anchorEpoch&&!e.reverseOf){if(t)throw RangeError(`Invalid era data: cannot have multiple anchor eras`);t=e,e.anchorEpoch={year:e.hasYearZero?0:1}}else if(!e.code)throw RangeError(`If era name is blank, it must be the anchor era`)})),n=n.filter((e=>e.code)),n.forEach((e=>{let{reverseOf:t}=e;if(t){let r=n.find((e=>e.code===t));if(r===void 0)throw RangeError(`Invalid era data: unmatched reverseOf era: ${t}`);e.reverseOf=r,e.anchorEpoch=r.anchorEpoch,e.isoEpoch=r.isoEpoch}e.anchorEpoch.month===void 0&&(e.anchorEpoch.month=1),e.anchorEpoch.day===void 0&&(e.anchorEpoch.day=1)})),n.sort(((e,t)=>{if(e.reverseOf)return 1;if(t.reverseOf)return-1;if(!e.isoEpoch||!t.isoEpoch)throw RangeError(`Invalid era data: missing ISO epoch`);return t.isoEpoch.year-e.isoEpoch.year}));let r=n[n.length-1].reverseOf;if(r&&r!==n[n.length-2])throw RangeError(`Invalid era data: invalid reverse-sign era`);return n.forEach(((e,t)=>{e.genericName=`era`+(n.length-1-t)})),{eras:n,anchorEra:t||n[0]}}(t);this.anchorEra=r,this.eras=n}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Su(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][mu(e)-1]}completeEraYear(e){let t=(t,n,r)=>{let i=e[t];if(i!=null&&i!=n&&!(r||[]).includes(i)){let e=r?.[0];throw RangeError(`Input ${t} ${i} doesn't match calculated value ${e?`${n} (also called ${e})`:n}`)}},n=t=>{let n,r={...e,year:t},i=this.eras.find(((e,i)=>{if(i===this.eras.length-1){if(e.reverseOf){if(t>0)throw RangeError(`Signed year ${t} is invalid for era ${e.code}`);return n=e.anchorEpoch.year-t,!0}return n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0}return this.compareCalendarDates(r,e.anchorEpoch)>=0&&(n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0)}));if(!i)throw RangeError(`Year ${t} was not matched by any era`);return{eraYear:n,era:i.code,eraNames:i.names}},{year:r,eraYear:i,era:a}=e;if(r!=null){let e=n(r);({eraYear:i,era:a}=e),t(`era`,a,e?.eraNames),t(`eraYear`,i)}else{if(i==null)throw RangeError(`Either year or eraYear and era are required`);{if(a===void 0)throw RangeError(`era and eraYear must be provided together`);let e=this.eras.find((({code:e,names:t=[]})=>e===a||t.includes(a)));if(!e)throw RangeError(`Era ${a} (ISO year ${i}) was not matched by any era`);r=e.reverseOf?e.anchorEpoch.year-i:i+e.anchorEpoch.year-(e.hasYearZero?0:1),t(`year`,r),{eraYear:i,era:a}=n(r)}}return{...e,year:r,eraYear:i,era:a}}adjustCalendarDate(e,t,n=`constrain`){let r=e,{month:i,monthCode:a}=r;return i===void 0&&(r={...r,month:mu(a)}),this.validateCalendarDate(r),r=this.completeEraYear(r),super.adjustCalendarDate(r,t,n)}estimateIsoDate(e){let{year:t,month:n,day:r}=this.adjustCalendarDate(e),{anchorEra:i}=this;return ss(t+i.isoEpoch.year-(i.hasYearZero?0:1),n,r,`constrain`)}},Tu=class extends wu{constructor(e,t){super(e,t)}isoToCalendarDate(e){let{year:t,month:n,day:r}=e,i=hu(n),a=t-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:n,monthCode:i,day:r})}};const Eu={inLeapYear(e){let{year:t}=e;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(e){let{month:t}=e;return t===13?this.inLeapYear(e)?6:5:30},maximumMonthLength(e){return this.minimumMonthLength(e)},maxLengthOfMonthCodeInAnyYear:e=>e===`M13`?6:30};var See=class extends Cu{constructor(e,t){super(e,t),this.inLeapYear=Eu.inLeapYear,this.monthsInYear=Eu.monthsInYear,this.minimumMonthLength=Eu.minimumMonthLength,this.maximumMonthLength=Eu.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=Eu.maxLengthOfMonthCodeInAnyYear}},Du=class extends wu{constructor(e,t){super(e,t),this.inLeapYear=Eu.inLeapYear,this.monthsInYear=Eu.monthsInYear,this.minimumMonthLength=Eu.minimumMonthLength,this.maximumMonthLength=Eu.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=Eu.maxLengthOfMonthCodeInAnyYear}},Cee=class extends See{constructor(){super(`ethioaa`,{year:-5492,month:7,day:17})}},wee=class extends Du{constructor(){super(`coptic`,[{code:`coptic`,isoEpoch:{year:284,month:8,day:29}},{code:`coptic-inverse`,reverseOf:`coptic`}])}},Tee=class extends Du{constructor(){super(`ethiopic`,[{code:`ethioaa`,names:[`ethiopic-amete-alem`,`mundi`],isoEpoch:{year:-5492,month:7,day:17}},{code:`ethiopic`,names:[`incar`],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},Eee=class extends Tu{constructor(){super(`roc`,[{code:`roc`,names:[`minguo`],isoEpoch:{year:1912,month:1,day:1}},{code:`roc-inverse`,names:[`before-roc`],reverseOf:`roc`}])}},Dee=class extends Cu{constructor(){super(`buddhist`,{year:-543,month:1,day:1})}},Oee=class extends Tu{constructor(){super(`gregory`,[{code:`gregory`,names:[`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`gregory-inverse`,names:[`be`,`bce`],reverseOf:`gregory`}])}reviseIntlEra(e){let{era:t,eraYear:n}=e;return t===`b`&&(t=`gregory-inverse`),t===`a`&&(t=`gregory`),{era:t,eraYear:n}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},kee=class extends Tu{constructor(){super(`japanese`,[{code:`reiwa`,isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:`heisei`,isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:`showa`,isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:`taisho`,isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:`meiji`,isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:`japanese`,names:[`japanese`,`gregory`,`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`japanese-inverse`,names:[`japanese-inverse`,`gregory-inverse`,`bc`,`bce`],reverseOf:`japanese`}]),this.erasBeginMidYear=!0}reviseIntlEra(e,t){let{era:n,eraYear:r}=e,{year:i}=t;return this.eras.find((e=>e.code===n))?{era:n,eraYear:r}:i<1?{era:`japanese-inverse`,eraYear:1-i}:{era:`japanese`,eraYear:i}}},Ou=class extends bu{constructor(){super(...arguments),this.calendarType=`lunisolar`}inLeapYear(e,t){let n=this.getMonthList(e.year,t);return Object.entries(n).length===13}monthsInYear(e,t){return this.inLeapYear(e,t)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(e){return[`M01L`,`M09L`,`M10L`,`M11L`,`M12L`].includes(e)?29:30}monthDaySearchStartYear(e,t){let n={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[e]??[1972,1972];return t<30?n[0]:n[1]}getMonthList(e,t){if(e===void 0)throw TypeError(`Missing year`);let n=JSON.stringify({func:`getMonthList`,calendarYear:e,id:this.id}),r=t.get(n);if(r)return r;let i=this.getFormatter(),a=(e,t)=>{let n=vu({isoYear:e,isoMonth:2,isoDay:1}),r=new Date(n);r.setUTCDate(t+1);let a=i.formatToParts(r),o=a.find((e=>e.type===`month`)).value,s=+a.find((e=>e.type===`day`)).value,c=a.find((e=>e.type===`relatedYear`)),l;if(c===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return l=+c.value,{calendarMonthString:o,calendarDay:s,calendarYearToVerify:l}},o=17,{calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o);s!==`1`&&(o+=29,{calendarMonthString:s,calendarDay:c}=a(e,o)),o-=c-5;let u={},d,f,p=1,m=!1;do({calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o)),d&&(u[f].daysInMonth=d+30-c),l===e?(u[s]={monthIndex:p++},o+=30):m=!0,d=c,f=s;while(!m);return u[f].daysInMonth=d+30-c,t.set(n,u),u}estimateIsoDate(e){let{year:t,month:n}=e;return{year:t,month:n>=12?12:n+1,day:1}}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthExtra:o,day:s,monthCode:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(o&&o!==`bis`)throw RangeError(`Unexpected leap month suffix: ${o}`);let e=hu(a,o!==void 0),n=`${a}${o||``}`,r=this.getMonthList(i,t)[n];if(r===void 0)throw RangeError(`Unmatched month ${n} in Chinese year ${i}`);return a=r.monthIndex,{year:i,month:a,day:s,monthCode:e}}if(this.validateCalendarDate(e),a===void 0){let e=this.getMonthList(i,t),r=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));r[0]===`0`&&(r=r.slice(1));let o=e[r];if(a=o&&o.monthIndex,a===void 0&&c.endsWith(`L`)&&c!=`M13L`&&n===`constrain`){let t=+c.replace(/^M0?|L$/g,``);o=e[t],o&&(a=o.monthIndex,c=hu(t))}if(a===void 0)throw RangeError(`Unmatched month ${c} in Chinese year ${i}`)}else if(c===void 0){let e=this.getMonthList(i,t),r=Object.entries(e),o=r.length;n===`reject`?(tl(a,1,o),tl(s,1,this.maximumMonthLength())):(a=$c(a,1,o),s=$c(s,1,this.maximumMonthLength()));let l=r.find((e=>e[1].monthIndex===a));if(l===void 0)throw RangeError(`Invalid month ${a} in Chinese year ${i}`);c=hu(+l[0].replace(`bis`,``),l[0].indexOf(`bis`)!==-1)}else{let e=this.getMonthList(i,t),n=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));n[0]===`0`&&(n=n.slice(1));let r=e[n];if(!r)throw RangeError(`Unmatched monthCode ${c} in Chinese year ${i}`);if(a!==r.monthIndex)throw RangeError(`monthCode ${c} doesn't correspond to month ${a} in Chinese year ${i}`)}return{...e,year:i,month:a,monthCode:c,day:s}}},Aee=class extends Ou{constructor(){super(...arguments),this.id=`chinese`}},jee=class extends Ou{constructor(){super(...arguments),this.id=`dangi`}},Mee=class{constructor(e){this.helper=e}extraFields(e){return this.helper.hasEra&&e.includes(`year`)?[`era`,`eraYear`]:[]}resolveFields(e){if(this.helper.calendarType!==`lunisolar`){let t=new _u;gu(e,void 0,this.helper.monthsInYear({year:e.year??1972},t))}}dateToISO(e,t){let n=new _u,r=this.helper.calendarToIsoDate(e,t,n);return n.setObject(r),r}monthDayToISOReferenceDate(e,t){let n=new _u,r=this.helper.monthDayFromFields(e,t,n);return n.setObject(r),r}fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];switch(t.add(r),r){case`era`:t.add(`eraYear`),t.add(`year`);break;case`eraYear`:t.add(`era`),t.add(`year`);break;case`year`:t.add(`era`),t.add(`eraYear`);break;case`month`:t.add(`monthCode`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`monthCode`:t.add(`month`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`day`:this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`))}}return uu(t)}dateAdd(e,{years:t,months:n,weeks:r,days:i},a){let o=_u.getCacheForObject(e),s=this.helper.isoToCalendarDate(e,o),c=this.helper.addCalendar(s,{years:t,months:n,weeks:r,days:i},a,o),l=this.helper.calendarToIsoDate(c,`constrain`,o);return _u.getCacheForObject(l)||new _u(o).setObject(l),l}dateUntil(e,t,n){let r=_u.getCacheForObject(e),i=_u.getCacheForObject(t),a=this.helper.isoToCalendarDate(e,r),o=this.helper.isoToCalendarDate(t,i);return this.helper.untilCalendar(a,o,n,r)}isoToDate(e,t){let n=_u.getCacheForObject(e),r=this.helper.isoToCalendarDate(e,n);if(t.dayOfWeek&&(r.dayOfWeek=pu.iso8601.isoToDate(e,{dayOfWeek:!0}).dayOfWeek),t.dayOfYear){let e=this.helper.startOfCalendarYear(r);r.dayOfYear=this.helper.calendarDaysUntil(e,r,n)+1}if(t.weekOfYear&&(r.weekOfYear=du(this.helper.id,e)),r.daysInWeek=7,t.daysInMonth&&(r.daysInMonth=this.helper.daysInMonth(r,n)),t.daysInYear){let e=this.helper.startOfCalendarYear(r),t=this.helper.addCalendar(e,{years:1},`constrain`,n);r.daysInYear=this.helper.calendarDaysUntil(e,t,n)}return t.monthsInYear&&(r.monthsInYear=this.helper.monthsInYear(r,n)),t.inLeapYear&&(r.inLeapYear=this.helper.inLeapYear(r,n)),r}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let e of[pee,bee,Tee,Cee,wee,Aee,jee,Eee,xee,Dee,Oee,kee,mee,hee,gee,_ee,vee,yee]){let t=new e;pu[t.id]=new Mee(t)}Ra(`calendarImpl`,(function(e){return pu[e]}));const ku=Intl.DateTimeFormat;function Au(e,t){let n=L(e,t);return typeof n==`function`&&(n=new ku(L(e,Da),n(L(e,Oa))),function(e,t,n){let r=ja(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t]===void 0)throw TypeError(`tried to reset ${t} which was not set`);r[t]=n}(e,t,n)),n}function ju(e){return Pa(e,Ca)}var Mu=class{constructor(e=void 0,t=void 0){(function(e,t,n){let r=n!==void 0,i;if(r){let e=[`localeMatcher`,`calendar`,`numberingSystem`,`hour12`,`hourCycle`,`timeZone`,`weekday`,`era`,`year`,`month`,`day`,`dayPeriod`,`hour`,`minute`,`second`,`fractionalSecondDigits`,`timeZoneName`,`formatMatcher`,`dateStyle`,`timeStyle`];i=function(e){if(e==null)throw TypeError(`Expected object not ${e}`);return Object(e)}(n);let t=Object.create(null);for(let n=0;n<e.length;n++){let r=e[n];Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}i=t}else i=Object.create(null);let a=new ku(t,i),o=a.resolvedOptions();if(Na(e),r){let t=Object.assign(Object.create(null),o);for(let e in t)Object.prototype.hasOwnProperty.call(i,e)||delete t[e];t.hour12=i.hour12,t.hourCycle=i.hourCycle,Fa(e,Oa,t)}else Fa(e,Oa,i);Fa(e,Da,o.locale),Fa(e,Ca,a),Fa(e,wa,o.timeZone),Fa(e,Ea,o.calendar),Fa(e,ya,Vee),Fa(e,`ym`,zee),Fa(e,`md`,Bee),Fa(e,ba,Ree),Fa(e,xa,Hee),Fa(e,Sa,Uee);let s=r?i.timeZone:void 0;if(s===void 0)Fa(e,Ta,o.timeZone);else{let t=Co(s);if(t.startsWith(`−`))throw RangeError(`Unicode minus (U+2212) is not supported in time zone offsets`);Fa(e,Ta,fc(t))}})(this,e,t)}get format(){R(this,ju);let e=Pee.bind(this);return Object.defineProperties(e,{length:{value:1,enumerable:!1,writable:!1,configurable:!0},name:{value:``,enumerable:!1,writable:!1,configurable:!0}}),e}formatRange(e,t){return R(this,ju),Iee.call(this,e,t)}formatToParts(e,...t){return R(this,ju),Fee.call(this,e,...t)}formatRangeToParts(e,t){return R(this,ju),Lee.call(this,e,t)}resolvedOptions(){return R(this,ju),Nee.call(this)}};`formatToParts`in ku.prototype||delete Mu.prototype.formatToParts,`formatRangeToParts`in ku.prototype||delete Mu.prototype.formatRangeToParts;const Nu=function(e=void 0,t=void 0){return new Mu(e,t)};function Nee(){let e=L(this,Ca).resolvedOptions();return e.timeZone=L(this,Ta),e}function Pee(e,...t){let n,r,i=Vu(e,this);return i.formatter?(n=i.formatter,r=[Zl(i.epochNs,`floor`)]):(n=L(this,Ca),r=[e,...t]),n.format(...r)}function Fee(e,...t){let n,r,i=Vu(e,this);return i.formatter?(n=i.formatter,r=[Zl(i.epochNs,`floor`)]):(n=L(this,Ca),r=[e,...t]),n.formatToParts(...r)}function Iee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=zu(e),r=zu(t),i,a=[n,r];if(Ru(n)!==Ru(r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);if(Ru(n)){if(!Bu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);let{epochNs:e,formatter:t}=Vu(n,this),{epochNs:o,formatter:s}=Vu(r,this);t&&(i=t,a=[Zl(e,`floor`),Zl(o,`floor`)])}return i||=L(this,Ca),i.formatRange(...a)}function Lee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=zu(e),r=zu(t),i,a=[n,r];if(Ru(n)!==Ru(r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);if(Ru(n)){if(!Bu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);let{epochNs:e,formatter:t}=Vu(n,this),{epochNs:o,formatter:s}=Vu(r,this);t&&(i=t,a=[Zl(e,`floor`),Zl(o,`floor`)])}return i||=L(this,Ca),i.formatRangeToParts(...a)}function Pu(e={},t={}){let n=Object.assign({},e),r=[`year`,`month`,`day`,`hour`,`minute`,`second`,`weekday`,`dayPeriod`,`timeZoneName`,`dateStyle`,`timeStyle`];for(let e=0;e<r.length;e++){let i=r[e];n[i]=i in t?t[i]:n[i],!1!==n[i]&&n[i]!==void 0||delete n[i]}return n}function Ree(e){let t=Pu(e,{year:!1,month:!1,day:!1,weekday:!1,timeZoneName:!1,dateStyle:!1});if(t.timeStyle!==`long`&&t.timeStyle!==`full`||(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})),!Iu(t)){if(Lu(e))throw TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(e)}]`);Object.assign(t,{hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function zee(e){let t={short:{year:`2-digit`,month:`numeric`},medium:{year:`numeric`,month:`short`},long:{year:`numeric`,month:`long`},full:{year:`numeric`,month:`long`}},n=Pu(e,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`year`in n||`month`in n||`era`in n)){if(Lu(e))throw TypeError(`cannot format PlainYearMonth with options [${Object.keys(e)}]`);Object.assign(n,{year:`numeric`,month:`numeric`})}return n}function Bee(e){let t={short:{month:`numeric`,day:`numeric`},medium:{month:`short`,day:`numeric`},long:{month:`long`,day:`numeric`},full:{month:`long`,day:`numeric`}},n=Pu(e,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`month`in n)&&!(`day`in n)){if(Lu(e))throw TypeError(`cannot format PlainMonthDay with options [${Object.keys(e)}]`);Object.assign(n,{month:`numeric`,day:`numeric`})}return n}function Vee(e){let t=Pu(e,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!Fu(t)){if(Lu(e))throw TypeError(`cannot format PlainDate with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`})}return t}function Hee(e){let t=Pu(e,{timeZoneName:!1});if((t.timeStyle===`long`||t.timeStyle===`full`)&&(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`}),t.dateStyle)&&(Object.assign(t,{short:{year:`numeric`,month:`numeric`,day:`numeric`},medium:{year:`numeric`,month:`short`,day:`numeric`},long:{year:`numeric`,month:`long`,day:`numeric`},full:{year:`numeric`,month:`long`,day:`numeric`,weekday:`long`}}[t.dateStyle]),delete t.dateStyle),!Iu(t)&&!Fu(t)){if(Lu(e))throw TypeError(`cannot format PlainDateTime with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function Uee(e){let t=e;return Iu(t)||Fu(t)||(t=Object.assign({},t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})),t}function Fu(e){return`year`in e||`month`in e||`day`in e||`weekday`in e||`dateStyle`in e||`era`in e}function Iu(e){return`hour`in e||`minute`in e||`second`in e||`timeStyle`in e||`dayPeriod`in e||`fractionalSecondDigits`in e}function Lu(e){return Fu(e)||Iu(e)||`dateStyle`in e||`timeStyle`in e||`timeZoneName`in e}function Ru(e){return Wo(e)||Go(e)||Ko(e)||Yo(e)||qo(e)||Jo(e)||Ho(e)}function zu(e){return Ru(e)?e:So(e)}function Bu(e,t){return!(!Ru(e)||!Ru(t)||Go(e)&&!Go(t)||Wo(e)&&!Wo(t)||Ko(e)&&!Ko(t)||Yo(e)&&!Yo(t)||qo(e)&&!qo(t)||Jo(e)&&!Jo(t)||Ho(e)&&!Ho(t))}function Vu(e,t){if(Go(e)){let n={isoDate:{year:1970,month:1,day:1},time:L(e,ra)};return{epochNs:_c(L(t,wa),n,`compatible`),formatter:Au(t,ba)}}if(qo(e)){let n=L(e,ia),r=L(t,Ea);if(n!==r)throw RangeError(`cannot format PlainYearMonth with calendar ${n} in locale with calendar ${r}`);let i=ds(L(e,ta),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,`ym`)}}if(Jo(e)){let n=L(e,ia),r=L(t,Ea);if(n!==r)throw RangeError(`cannot format PlainMonthDay with calendar ${n} in locale with calendar ${r}`);let i=ds(L(e,ta),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,`md`)}}if(Wo(e)){let n=L(e,ia),r=L(t,Ea);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDate with calendar ${n} in locale with calendar ${r}`);let i=ds(L(e,ta),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,ya)}}if(Ko(e)){let n=L(e,ia),r=L(t,Ea);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDateTime with calendar ${n} in locale with calendar ${r}`);let i=L(e,na);return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,xa)}}if(Yo(e))throw TypeError(`Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.`);return Ho(e)?{epochNs:L(e,ea),formatter:Au(t,Sa)}:{}}function Hu(e){let t=Object.create(null);return t.years=L(e,la),t.months=L(e,ua),t.weeks=L(e,da),t.days=L(e,fa),t.hours=L(e,pa),t.minutes=L(e,ma),t.seconds=L(e,ha),t.milliseconds=L(e,ga),t.microseconds=L(e,_a),t.nanoseconds=L(e,va),t}Mu.prototype.constructor=Nu,Object.defineProperty(Nu,`prototype`,{value:Mu.prototype,writable:!1,enumerable:!1,configurable:!1}),Nu.supportedLocalesOf=ku.supportedLocalesOf,La(Nu,`Intl.DateTimeFormat`);const{format:Wee,formatToParts:Gee}=Intl.DurationFormat?.prototype??Object.create(null);function Uu(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Hu(Is(e));return Wee.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Uu,Intl.DurationFormat.prototype.formatToParts=function(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Hu(Is(e));return Gee.call(this,t)}),Object.freeze({__proto__:null,DateTimeFormat:Nu,ModifiedIntlDurationFormatPrototypeFormat:Uu});var Wu=class{constructor(e){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);ec(this,$l(e))}get epochMilliseconds(){return R(this,Ho),Zl(L(this,ea),`floor`)}get epochNanoseconds(){return R(this,Ho),uee(I.default.BigInt(L(this,ea)))}add(e){return R(this,Ho),Rl(`add`,this,e)}subtract(e){return R(this,Ho),Rl(`subtract`,this,e)}until(e,t=void 0){return R(this,Ho),Ol(`until`,this,e,t)}since(e,t=void 0){return R(this,Ho),Ol(`since`,this,e,t)}round(e){if(R(this,Ho),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs);return vs(n,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[i],!0),tc(Ul(L(this,ea),n,i,r))}equals(e){R(this,Ho);let t=Ls(e),n=L(this,ea),r=L(t,ea);return I.default.equal(I.default.BigInt(n),I.default.BigInt(r))}toString(e=void 0){R(this,Ho);let t=ru(e),n=ys(t),r=ms(t,`trunc`),i=Ss(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let a=t.timeZone;a!==void 0&&(a=fc(a));let{precision:o,unit:s,increment:c}=bs(i,n);return Tc(tc(Ul(L(this,ea),c,s,r)),a,o)}toJSON(){return R(this,Ho),Tc(this,void 0,`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Ho),new Nu(e,t).format(this)}valueOf(){cu(`Instant`)}toZonedDateTimeISO(e){R(this,Ho);let t=fc(e);return nc(L(this,ea),t,`iso8601`)}static fromEpochMilliseconds(e){return tc(Ql(So(e)))}static fromEpochNanoseconds(e){return tc($l(e))}static from(e){return Ls(e)}static compare(e,t){let n=Ls(e),r=Ls(t),i=L(n,ea),a=L(r,ea);return I.default.lessThan(i,a)?-1:I.default.greaterThan(i,a)?1:0}};La(Wu,`Temporal.Instant`);var Gu=class{constructor(e,t,n,r=`iso8601`){let i=wo(e),a=wo(t),o=wo(n),s=ou(r===void 0?`iso8601`:Oo(r));nl(i,a,o),Ws(this,{year:i,month:a,day:o},s)}get calendarId(){return R(this,Wo),L(this,ia)}get era(){return Ku(this,`era`)}get eraYear(){return Ku(this,`eraYear`)}get year(){return Ku(this,`year`)}get month(){return Ku(this,`month`)}get monthCode(){return Ku(this,`monthCode`)}get day(){return Ku(this,`day`)}get dayOfWeek(){return Ku(this,`dayOfWeek`)}get dayOfYear(){return Ku(this,`dayOfYear`)}get weekOfYear(){return Ku(this,`weekOfYear`)?.week}get yearOfWeek(){return Ku(this,`weekOfYear`)?.year}get daysInWeek(){return Ku(this,`daysInWeek`)}get daysInMonth(){return Ku(this,`daysInMonth`)}get daysInYear(){return Ku(this,`daysInYear`)}get monthsInYear(){return Ku(this,`monthsInYear`)}get inLeapYear(){return Ku(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Wo),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=As(n,L(this,ta));return r=rc(n,r,js(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Gs(lc(n,r,fs(ru(t))),n)}withCalendar(e){R(this,Wo);let t=oc(e);return Gs(L(this,ta),t)}add(e,t=void 0){return R(this,Wo),zl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Wo),zl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Wo),kl(`until`,this,e,t)}since(e,t=void 0){return R(this,Wo),kl(`since`,this,e,t)}equals(e){R(this,Wo);let t=Ns(e);return Jl(L(this,ta),L(t,ta))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){return R(this,Wo),Dc(this,gs(ru(e)))}toJSON(){return R(this,Wo),Dc(this)}toLocaleString(e=void 0,t=void 0){return R(this,Wo),new Nu(e,t).format(this)}valueOf(){cu(`PlainDate`)}toPlainDateTime(e=void 0){R(this,Wo);let t=Bs(e);return qs(ds(L(this,ta),t),L(this,ia))}toZonedDateTime(e){let t,n;if(R(this,Wo),xo(e)){let r=e.timeZone;r===void 0?t=fc(e):(t=fc(r),n=e.plainTime)}else t=fc(e);let r=L(this,ta),i;return n===void 0?i=bc(t,r):(n=zs(n),i=_c(t,ds(r,L(n,ra)),`compatible`)),nc(i,t,L(this,ia))}toPlainYearMonth(){R(this,Wo);let e=L(this,ia);return $s(uc(e,As(e,L(this,ta)),`constrain`),e)}toPlainMonthDay(){R(this,Wo);let e=L(this,ia);return Ys(dc(e,As(e,L(this,ta)),`constrain`),e)}static from(e,t=void 0){return Ns(e,t)}static compare(e,t){let n=Ns(e),r=Ns(t);return Jl(L(n,ta),L(r,ta))}};function Ku(e,t){R(e,Wo);let n=L(e,ta);return ks(e).isoToDate(n,{[t]:!0})[t]}La(Gu,`Temporal.PlainDate`);var qu=class{constructor(e,t,n,r=0,i=0,a=0,o=0,s=0,c=0,l=`iso8601`){let u=wo(e),d=wo(t),f=wo(n),p=r===void 0?0:wo(r),m=i===void 0?0:wo(i),h=a===void 0?0:wo(a),g=o===void 0?0:wo(o),_=s===void 0?0:wo(s),v=c===void 0?0:wo(c),y=ou(l===void 0?`iso8601`:Oo(l));al(u,d,f,p,m,h,g,_,v),Ks(this,{isoDate:{year:u,month:d,day:f},time:{hour:p,minute:m,second:h,millisecond:g,microsecond:_,nanosecond:v}},y)}get calendarId(){return R(this,Ko),L(this,ia)}get year(){return Ju(this,`year`)}get month(){return Ju(this,`month`)}get monthCode(){return Ju(this,`monthCode`)}get day(){return Ju(this,`day`)}get hour(){return Yu(this,`hour`)}get minute(){return Yu(this,`minute`)}get second(){return Yu(this,`second`)}get millisecond(){return Yu(this,`millisecond`)}get microsecond(){return Yu(this,`microsecond`)}get nanosecond(){return Yu(this,`nanosecond`)}get era(){return Ju(this,`era`)}get eraYear(){return Ju(this,`eraYear`)}get dayOfWeek(){return Ju(this,`dayOfWeek`)}get dayOfYear(){return Ju(this,`dayOfYear`)}get weekOfYear(){return Ju(this,`weekOfYear`)?.week}get yearOfWeek(){return Ju(this,`weekOfYear`)?.year}get daysInWeek(){return Ju(this,`daysInWeek`)}get daysInYear(){return Ju(this,`daysInYear`)}get daysInMonth(){return Ju(this,`daysInMonth`)}get monthsInYear(){return Ju(this,`monthsInYear`)}get inLeapYear(){return Ju(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Ko),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=L(this,na),i={...As(n,r.isoDate),...r.time};return i=rc(n,i,js(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],`partial`)),qs(Ps(n,i,fs(ru(t))),n)}withPlainTime(e=void 0){R(this,Ko);let t=Bs(e);return qs(ds(L(this,na).isoDate,t),L(this,ia))}withCalendar(e){R(this,Ko);let t=oc(e);return qs(L(this,na),t)}add(e,t=void 0){return R(this,Ko),Bl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Ko),Bl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Ko),Al(`until`,this,e,t)}since(e,t=void 0){return R(this,Ko),Al(`since`,this,e,t)}round(e){if(R(this,Ko),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];vs(n,a,a===1);let o=L(this,na);return qs(n===1&&i===`nanosecond`?o:Wl(o,n,i,r),L(this,ia))}equals(e){R(this,Ko);let t=Fs(e);return Xl(L(this,na),L(t,na))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){R(this,Ko);let t=ru(e),n=gs(t),r=ys(t),i=ms(t,`trunc`),a=Ss(t,`smallestUnit`,`time`,void 0);if(a===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:o,unit:s,increment:c}=bs(a,r),l=Wl(L(this,na),c,s,i);return ol(l),kc(l,L(this,ia),o,n)}toJSON(){return R(this,Ko),kc(L(this,na),L(this,ia),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Ko),new Nu(e,t).format(this)}valueOf(){cu(`PlainDateTime`)}toZonedDateTime(e,t=void 0){R(this,Ko);let n=fc(e),r=ps(ru(t));return nc(_c(n,L(this,na),r),n,L(this,ia))}toPlainDate(){return R(this,Ko),Gs(L(this,na).isoDate,L(this,ia))}toPlainTime(){return R(this,Ko),Zs(L(this,na).time)}static from(e,t=void 0){return Fs(e,t)}static compare(e,t){let n=Fs(e),r=Fs(t);return Xl(L(n,na),L(r,na))}};function Ju(e,t){R(e,Ko);let n=L(e,na).isoDate;return ks(e).isoToDate(n,{[t]:!0})[t]}function Yu(e,t){return R(e,Ko),L(e,na).time[t]}La(qu,`Temporal.PlainDateTime`);var Xu=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0){let u=e===void 0?0:Eo(e),d=t===void 0?0:Eo(t),f=n===void 0?0:Eo(n),p=r===void 0?0:Eo(r),m=i===void 0?0:Eo(i),h=a===void 0?0:Eo(a),g=o===void 0?0:Eo(o),_=s===void 0?0:Eo(s),v=c===void 0?0:Eo(c),y=l===void 0?0:Eo(l);ul(u,d,f,p,m,h,g,_,v,y),Na(this),Fa(this,la,u),Fa(this,ua,d),Fa(this,da,f),Fa(this,fa,p),Fa(this,pa,m),Fa(this,ma,h),Fa(this,ha,g),Fa(this,ga,_),Fa(this,_a,v),Fa(this,va,y)}get years(){return R(this,Uo),L(this,la)}get months(){return R(this,Uo),L(this,ua)}get weeks(){return R(this,Uo),L(this,da)}get days(){return R(this,Uo),L(this,fa)}get hours(){return R(this,Uo),L(this,pa)}get minutes(){return R(this,Uo),L(this,ma)}get seconds(){return R(this,Uo),L(this,ha)}get milliseconds(){return R(this,Uo),L(this,ga)}get microseconds(){return R(this,Uo),L(this,_a)}get nanoseconds(){return R(this,Uo),L(this,va)}get sign(){return R(this,Uo),Wc(this)}get blank(){return R(this,Uo),Wc(this)===0}with(t){R(this,Uo);let{years:n=L(this,la),months:r=L(this,ua),weeks:i=L(this,da),days:a=L(this,fa),hours:o=L(this,pa),minutes:s=L(this,ma),seconds:c=L(this,ha),milliseconds:l=L(this,ga),microseconds:u=L(this,_a),nanoseconds:d=L(this,va)}=ls(t);return new e(n,r,i,a,o,s,c,l,u,d)}negated(){return R(this,Uo),Qc(this)}abs(){return R(this,Uo),new e(Math.abs(L(this,la)),Math.abs(L(this,ua)),Math.abs(L(this,da)),Math.abs(L(this,fa)),Math.abs(L(this,pa)),Math.abs(L(this,ma)),Math.abs(L(this,ha)),Math.abs(L(this,ga)),Math.abs(L(this,_a)),Math.abs(L(this,va)))}add(e){return R(this,Uo),Ll(`add`,this,e)}subtract(e){return R(this,Uo),Ll(`subtract`,this,e)}round(e){if(R(this,Uo),e===void 0)throw TypeError(`options parameter is required`);let t=ws(this),n=typeof e==`string`?iu(`smallestUnit`,e):ru(e),r=Ss(n,`largestUnit`,`datetime`,void 0,[`auto`]),{plainRelativeTo:i,zonedRelativeTo:a}=Cs(n),o=_s(n),s=ms(n,`halfExpand`),c=Ss(n,`smallestUnit`,`datetime`,void 0),l=!0;c||=(l=!1,`nanosecond`);let u=Ts(t,c),d=!0;if(r||=(d=!1,u),r===`auto`&&(r=u),!l&&!d)throw RangeError(`at least one of smallestUnit or largestUnit is required`);if(Ts(r,c)!==r)throw RangeError(`largestUnit ${r} cannot be smaller than smallestUnit ${c}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[c];if(f!==void 0&&vs(o,f,!1),o>1&&Ds(c)===`date`&&r!==c)throw RangeError(`For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit`);if(a){let e=dl(this),t=L(a,ca),n=L(a,ia),i=L(a,ea);return e=El(i,Il(i,t,n,e),t,n,r,o,c,s),Ds(r)===`date`&&(r=`hour`),ml(e,r)}if(i){let e=fl(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),n=L(i,ta),a=L(i,ia),l=ic(a,n,us(e.date,t.deltaDays),`constrain`);return e=Tl(ds(n,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),ds(l,t),a,r,o,c,s),ml(e,r)}if(Es(t))throw RangeError(`a starting point is required for ${t}s balancing`);if(Es(r))throw RangeError(`a starting point is required for ${r}s balancing`);let p=fl(this);if(c===`day`){let{quotient:e,remainder:t}=p.time.divmod(lo),n=p.date.days+e+ql(t,`day`);n=Hl(n,o,s),p=hl({years:0,months:0,weeks:0,days:n},Wa.ZERO)}else p=hl({years:0,months:0,weeks:0,days:0},Kl(p.time,o,c,s));return ml(p,r)}total(e){if(R(this,Uo),e===void 0)throw TypeError(`options argument is required`);let t=typeof e==`string`?iu(`unit`,e):ru(e),{plainRelativeTo:n,zonedRelativeTo:r}=Cs(t),i=Ss(t,`unit`,`datetime`,xs);if(r){let e=dl(this),t=L(r,ca),n=L(r,ia),a=L(r,ea);return function(e,t,n,r,i){return Ds(i)===`time`?ql(Wa.fromEpochNsDiff(t,e),i):wl(xl(e,t,n,r,i),t,gc(n,e),n,r,i)}(a,Il(a,t,n,e),t,n,i)}if(n){let e=fl(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),r=L(n,ta),a=L(n,ia),o=ic(a,r,us(e.date,t.deltaDays),`constrain`);return function(e,t,n,r){if(Xl(e,t)==0)return 0;ol(e),ol(t);let i=bl(e,t,n,r);return r===`nanosecond`?I.default.toNumber(i.time.totalNs):wl(i,Rc(t),e,null,n,r)}(ds(r,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),ds(o,t),a,i)}let a=ws(this);if(Es(a))throw RangeError(`a starting point is required for ${a}s total`);if(Es(i))throw RangeError(`a starting point is required for ${i}s total`);return ql(fl(this).time,i)}toString(e=void 0){R(this,Uo);let t=ru(e),n=ys(t),r=ms(t,`trunc`),i=Ss(t,`smallestUnit`,`time`,void 0);if(i===`hour`||i===`minute`)throw RangeError(`smallestUnit must be a time unit other than "hours" or "minutes"`);let{precision:a,unit:o,increment:s}=bs(i,n);if(o===`nanosecond`&&s===1)return Ec(this,a);let c=ws(this),l=dl(this),u=Kl(l.time,s,o,r);return l=hl(l.date,u),Ec(ml(l,Ts(c,`second`)),a)}toJSON(){return R(this,Uo),Ec(this,`auto`)}toLocaleString(e=void 0,t=void 0){if(R(this,Uo),typeof Intl.DurationFormat==`function`){let n=new Intl.DurationFormat(e,t);return Uu.call(n,this)}return console.warn(`Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat.`),Ec(this,`auto`)}valueOf(){cu(`Duration`)}static from(e){return Is(e)}static compare(e,t,n=void 0){let r=Is(e),i=Is(t),{plainRelativeTo:a,zonedRelativeTo:o}=Cs(ru(n));if(L(r,la)===L(i,la)&&L(r,ua)===L(i,ua)&&L(r,da)===L(i,da)&&L(r,fa)===L(i,fa)&&L(r,pa)===L(i,pa)&&L(r,ma)===L(i,ma)&&L(r,ha)===L(i,ha)&&L(r,ga)===L(i,ga)&&L(r,_a)===L(i,_a)&&L(r,va)===L(i,va))return 0;let s=ws(r),c=ws(i),l=dl(r),u=dl(i);if(o&&(Ds(s)===`date`||Ds(c)===`date`)){let e=L(o,ca),t=L(o,ia),n=L(o,ea),r=Il(n,e,t,l),i=Il(n,e,t,u);return nu(I.default.toNumber(I.default.subtract(r,i)))}let d=l.date.days,f=u.date.days;if(Es(s)||Es(c)){if(!a)throw RangeError(`A starting point is required for years, months, or weeks comparison`);d=Zc(l.date,a),f=Zc(u.date,a)}let p=l.time.add24HourDays(d),m=u.time.add24HourDays(f);return p.cmp(m)}};La(Xu,`Temporal.Duration`);var Zu=class{constructor(e,t,n=`iso8601`,r=1972){let i=wo(e),a=wo(t),o=ou(n===void 0?`iso8601`:Oo(n)),s=wo(r);nl(s,i,a),Js(this,{year:s,month:i,day:a},o)}get monthCode(){return Qu(this,`monthCode`)}get day(){return Qu(this,`day`)}get calendarId(){return R(this,Jo),L(this,ia)}with(e,t=void 0){if(R(this,Jo),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=As(n,L(this,ta),`month-day`);return r=rc(n,r,js(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Ys(dc(n,r,fs(ru(t))),n)}equals(e){R(this,Jo);let t=Rs(e);return Jl(L(this,ta),L(t,ta))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){return R(this,Jo),Ac(this,gs(ru(e)))}toJSON(){return R(this,Jo),Ac(this)}toLocaleString(e=void 0,t=void 0){return R(this,Jo),new Nu(e,t).format(this)}valueOf(){cu(`PlainMonthDay`)}toPlainDate(e){if(R(this,Jo),!xo(e))throw TypeError(`argument should be an object`);let t=L(this,ia);return Gs(lc(t,rc(t,As(t,L(this,ta),`month-day`),js(t,e,[`year`],[],[])),`constrain`),t)}static from(e,t=void 0){return Rs(e,t)}};function Qu(e,t){R(e,Jo);let n=L(e,ta);return ks(e).isoToDate(n,{[t]:!0})[t]}function $u(e){return gc(e,eu())}La(Zu,`Temporal.PlainMonthDay`);const ed={instant:()=>tc(eu()),plainDateTimeISO:(e=tu())=>qs($u(fc(e)),`iso8601`),plainDateISO:(e=tu())=>Gs($u(fc(e)).isoDate,`iso8601`),plainTimeISO:(e=tu())=>Zs($u(fc(e)).time),timeZoneId:()=>tu(),zonedDateTimeISO:(e=tu())=>{let t=fc(e);return nc(eu(),t,`iso8601`)},[Symbol.toStringTag]:`Temporal.Now`};Object.defineProperty(ed,Symbol.toStringTag,{value:`Temporal.Now`,writable:!1,enumerable:!1,configurable:!0});var td=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0){let o=e===void 0?0:wo(e),s=t===void 0?0:wo(t),c=n===void 0?0:wo(n),l=r===void 0?0:wo(r),u=i===void 0?0:wo(i),d=a===void 0?0:wo(a);il(o,s,c,l,u,d),Xs(this,{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d})}get hour(){return R(this,Go),L(this,ra).hour}get minute(){return R(this,Go),L(this,ra).minute}get second(){return R(this,Go),L(this,ra).second}get millisecond(){return R(this,Go),L(this,ra).millisecond}get microsecond(){return R(this,Go),L(this,ra).microsecond}get nanosecond(){return R(this,Go),L(this,ra).nanosecond}with(t,n=void 0){if(R(this,Go),!xo(t))throw TypeError(`invalid argument`);Xo(t);let r=Ms(t,`partial`),i=Ms(this),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Object.assign(i,r),d=fs(ru(n));return{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=cs(a,o,s,c,l,u,d),new e(a,o,s,c,l,u)}add(e){return R(this,Go),Vl(`add`,this,e)}subtract(e){return R(this,Go),Vl(`subtract`,this,e)}until(e,t=void 0){return R(this,Go),jl(`until`,this,e,t)}since(e,t=void 0){return R(this,Go),jl(`since`,this,e,t)}round(e){if(R(this,Go),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs);return vs(n,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i],!1),Zs(Gl(L(this,ra),n,i,r))}equals(e){R(this,Go);let t=zs(e);return Yl(L(this,ra),L(t,ra))===0}toString(e=void 0){R(this,Go);let t=ru(e),n=ys(t),r=ms(t,`trunc`),i=Ss(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:a,unit:o,increment:s}=bs(i,n);return Oc(Gl(L(this,ra),s,o,r),a)}toJSON(){return R(this,Go),Oc(L(this,ra),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Go),new Nu(e,t).format(this)}valueOf(){cu(`PlainTime`)}static from(e,t=void 0){return zs(e,t)}static compare(e,t){let n=zs(e),r=zs(t);return Yl(L(n,ra),L(r,ra))}};La(td,`Temporal.PlainTime`);var nd=class{constructor(e,t,n=`iso8601`,r=1){let i=wo(e),a=wo(t),o=ou(n===void 0?`iso8601`:Oo(n)),s=wo(r);nl(i,a,s),Qs(this,{year:i,month:a,day:s},o)}get year(){return rd(this,`year`)}get month(){return rd(this,`month`)}get monthCode(){return rd(this,`monthCode`)}get calendarId(){return R(this,qo),L(this,ia)}get era(){return rd(this,`era`)}get eraYear(){return rd(this,`eraYear`)}get daysInMonth(){return rd(this,`daysInMonth`)}get daysInYear(){return rd(this,`daysInYear`)}get monthsInYear(){return rd(this,`monthsInYear`)}get inLeapYear(){return rd(this,`inLeapYear`)}with(e,t=void 0){if(R(this,qo),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=As(n,L(this,ta),`year-month`);return r=rc(n,r,js(n,e,[`year`,`month`,`monthCode`],[],`partial`)),$s(uc(n,r,fs(ru(t))),n)}add(e,t=void 0){return R(this,qo),cee(`add`,this,e,t)}subtract(e,t=void 0){return R(this,qo),cee(`subtract`,this,e,t)}until(e,t=void 0){return R(this,qo),Ml(`until`,this,e,t)}since(e,t=void 0){return R(this,qo),Ml(`since`,this,e,t)}equals(e){R(this,qo);let t=Vs(e);return Jl(L(this,ta),L(t,ta))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){return R(this,qo),nee(this,gs(ru(e)))}toJSON(){return R(this,qo),nee(this)}toLocaleString(e=void 0,t=void 0){return R(this,qo),new Nu(e,t).format(this)}valueOf(){cu(`PlainYearMonth`)}toPlainDate(e){if(R(this,qo),!xo(e))throw TypeError(`argument should be an object`);let t=L(this,ia);return Gs(lc(t,rc(t,As(t,L(this,ta),`year-month`),js(t,e,[`day`],[],[])),`constrain`),t)}static from(e,t=void 0){return Vs(e,t)}static compare(e,t){let n=Vs(e),r=Vs(t);return Jl(L(n,ta),L(r,ta))}};function rd(e,t){R(e,qo);let n=L(e,ta);return ks(e).isoToDate(n,{[t]:!0})[t]}La(nd,`Temporal.PlainYearMonth`);const Kee=Nu.prototype.resolvedOptions;var id=class{constructor(e,t,n=`iso8601`){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);let r=$l(e),i=Oo(t),{tzName:a,offsetMinutes:o}=os(i);if(o===void 0){let e=Nc(a);if(!e)throw RangeError(`unknown time zone ${a}`);i=e.identifier}else i=Ic(o);eee(this,r,i,ou(n===void 0?`iso8601`:Oo(n)))}get calendarId(){return R(this,Yo),L(this,ia)}get timeZoneId(){return R(this,Yo),L(this,ca)}get year(){return od(this,`year`)}get month(){return od(this,`month`)}get monthCode(){return od(this,`monthCode`)}get day(){return od(this,`day`)}get hour(){return sd(this,`hour`)}get minute(){return sd(this,`minute`)}get second(){return sd(this,`second`)}get millisecond(){return sd(this,`millisecond`)}get microsecond(){return sd(this,`microsecond`)}get nanosecond(){return sd(this,`nanosecond`)}get era(){return od(this,`era`)}get eraYear(){return od(this,`eraYear`)}get epochMilliseconds(){return R(this,Yo),Zl(L(this,ea),`floor`)}get epochNanoseconds(){return R(this,Yo),uee(L(this,ea))}get dayOfWeek(){return od(this,`dayOfWeek`)}get dayOfYear(){return od(this,`dayOfYear`)}get weekOfYear(){return od(this,`weekOfYear`)?.week}get yearOfWeek(){return od(this,`weekOfYear`)?.year}get hoursInDay(){R(this,Yo);let e=L(this,ca),t=ad(this).isoDate,n=Jc(t.year,t.month,t.day+1),r=bc(e,t),i=bc(e,n);return ql(Wa.fromEpochNsDiff(i,r),`hour`)}get daysInWeek(){return od(this,`daysInWeek`)}get daysInMonth(){return od(this,`daysInMonth`)}get daysInYear(){return od(this,`daysInYear`)}get monthsInYear(){return od(this,`monthsInYear`)}get inLeapYear(){return od(this,`inLeapYear`)}get offset(){return R(this,Yo),hc(mc(L(this,ca),L(this,ea)))}get offsetNanoseconds(){return R(this,Yo),mc(L(this,ca),L(this,ea))}with(e,t=void 0){if(R(this,Yo),!xo(e))throw TypeError(`invalid zoned-date-time-like`);Xo(e);let n=L(this,ia),r=L(this,ca),i=mc(r,L(this,ea)),a=ad(this),o={...As(n,a.isoDate),...a.time,offset:hc(i)};o=rc(n,o,js(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`],`partial`));let s=ru(t),c=ps(s),l=hs(s,`prefer`),u=Ps(n,o,fs(s)),d=jc(o.offset);return nc(Hs(u.isoDate,u.time,`option`,d,r,c,l,!1),r,n)}withPlainTime(e=void 0){R(this,Yo);let t=L(this,ca),n=L(this,ia),r=ad(this).isoDate,i;return i=e===void 0?bc(t,r):_c(t,ds(r,L(zs(e),ra)),`compatible`),nc(i,t,n)}withTimeZone(e){R(this,Yo);let t=fc(e);return nc(L(this,ea),t,L(this,ia))}withCalendar(e){R(this,Yo);let t=oc(e);return nc(L(this,ea),L(this,ca),t)}add(e,t=void 0){return R(this,Yo),lee(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Yo),lee(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Yo),Nl(`until`,this,e,t)}since(e,t=void 0){return R(this,Yo),Nl(`since`,this,e,t)}round(e){if(R(this,Yo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];if(vs(n,a,a===1),i===`nanosecond`&&n===1)return nc(L(this,ea),L(this,ca),L(this,ia));let o=L(this,ca),s=L(this,ea),c=ad(this),l;if(i===`day`){let e=c.isoDate,t=Jc(e.year,e.month,e.day+1),n=bc(o,e),i=bc(o,t),a=I.default.subtract(i,n);l=Wa.fromEpochNsDiff(s,n).round(a,r).addToEpochNs(n)}else{let e=Wl(c,n,i,r),t=mc(o,s);l=Hs(e.isoDate,e.time,`option`,t,o,`compatible`,`prefer`,!1)}return nc(l,o,L(this,ia))}equals(e){R(this,Yo);let t=Us(e),n=L(this,ea),r=L(t,ea);return!!I.default.equal(I.default.BigInt(n),I.default.BigInt(r))&&!!pc(L(this,ca),L(t,ca))&&cc(L(this,ia),L(t,ia))}toString(e=void 0){R(this,Yo);let t=ru(e),n=gs(t),r=ys(t),i=function(e){return au(e,`offset`,[`auto`,`never`],`auto`)}(t),a=ms(t,`trunc`),o=Ss(t,`smallestUnit`,`time`,void 0);if(o===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let s=function(e){return au(e,`timeZoneName`,[`auto`,`never`,`critical`],`auto`)}(t),{precision:c,unit:l,increment:u}=bs(o,r);return ree(this,c,n,s,i,{unit:l,increment:u,roundingMode:a})}toLocaleString(e=void 0,t=void 0){R(this,Yo);let n=ru(t),r=Object.create(null);if(function(e,t,n,r){if(t==null)return;let i=Reflect.ownKeys(t);for(let r=0;r<i.length;r++){let a=i[r];!n.some((e=>Object.is(e,a)))&&Object.prototype.propertyIsEnumerable.call(t,a)&&(e[a]=t[a])}}(r,n,[`timeZone`]),n.timeZone!==void 0)throw TypeError(`ZonedDateTime toLocaleString does not accept a timeZone option`);if(r.year===void 0&&r.month===void 0&&r.day===void 0&&r.era===void 0&&r.weekday===void 0&&r.dateStyle===void 0&&r.hour===void 0&&r.minute===void 0&&r.second===void 0&&r.fractionalSecondDigits===void 0&&r.timeStyle===void 0&&r.dayPeriod===void 0&&r.timeZoneName===void 0&&(r.timeZoneName=`short`),r.timeZone=L(this,ca),iee(r.timeZone))throw RangeError(`toLocaleString does not currently support offset time zones`);let i=new Nu(e,r),a=Kee.call(i).calendar,o=L(this,ia);if(o!==`iso8601`&&a!==`iso8601`&&!cc(a,o))throw RangeError(`cannot format ZonedDateTime with calendar ${o} in locale with calendar ${a}`);return i.format(tc(L(this,ea)))}toJSON(){return R(this,Yo),ree(this,`auto`)}valueOf(){cu(`ZonedDateTime`)}startOfDay(){R(this,Yo);let e=L(this,ca);return nc(bc(e,ad(this).isoDate),e,L(this,ia))}getTimeZoneTransition(e){R(this,Yo);let t=L(this,ca);if(e===void 0)throw TypeError(`options parameter is required`);let n=au(typeof e==`string`?iu(`direction`,e):ru(e),`direction`,[`next`,`previous`],xs);if(n===void 0)throw TypeError(`direction option is required`);if(iee(t)||t===`UTC`)return null;let r=L(this,ea),i=n===`next`?zc(t,r):Bc(t,r);return i===null?null:nc(i,t,L(this,ia))}toInstant(){return R(this,Yo),tc(L(this,ea))}toPlainDate(){return R(this,Yo),Gs(ad(this).isoDate,L(this,ia))}toPlainTime(){return R(this,Yo),Zs(ad(this).time)}toPlainDateTime(){return R(this,Yo),qs(ad(this),L(this,ia))}static from(e,t=void 0){return Us(e,t)}static compare(e,t){let n=Us(e),r=Us(t),i=L(n,ea),a=L(r,ea);return I.default.lessThan(I.default.BigInt(i),I.default.BigInt(a))?-1:I.default.greaterThan(I.default.BigInt(i),I.default.BigInt(a))?1:0}};function ad(e){return gc(L(e,ca),L(e,ea))}function od(e,t){R(e,Yo);let n=ad(e).isoDate;return ks(e).isoToDate(n,{[t]:!0})[t]}function sd(e,t){return R(e,Yo),ad(e).time[t]}La(id,`Temporal.ZonedDateTime`);var cd=Object.freeze({__proto__:null,Duration:Xu,Instant:Wu,Now:ed,PlainDate:Gu,PlainDateTime:qu,PlainMonthDay:Zu,PlainTime:td,PlainYearMonth:nd,ZonedDateTime:id});(class{toTemporalInstant(){return tc(Ql(Date.prototype.valueOf.call(this)))}}).prototype.toTemporalInstant;const qee=[Wu,Gu,qu,Xu,Zu,td,nd,id];for(let e of qee){let t=Object.getOwnPropertyDescriptor(e,`prototype`);(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(e,`prototype`,t))}const Jee=Symbol.for(`drizzle:CockroachMaterializedViewConfig`);function Yee(e){return{...e[te]}}function Xee(e){return{...e[te],...e[Jee]}}const Zee=Symbol.for(`drizzle:MsSqlViewConfig`);function Qee(e){return{...e[te],...e[Zee]}}const ld=Ot(import.meta.url);var $ee=Object.create,ud=Object.defineProperty,ete=Object.getOwnPropertyDescriptor,dd=Object.getOwnPropertyNames,tte=Object.getPrototypeOf,nte=Object.prototype.hasOwnProperty,z=(e=>ld===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(ld===void 0?e:ld)[t]}):e:ld)(function(e){if(ld!==void 0)return ld.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),B=(e,t)=>function(){return e&&(t=(0,e[dd(e)[0]])(e=0)),t},V=(e,t)=>function(){return t||(0,e[dd(e)[0]])((t={exports:{}}).exports,t),t.exports},fd=(e,t)=>{for(var n in t)ud(e,n,{get:t[n],enumerable:!0})},pd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of dd(t))!nte.call(e,i)&&i!==n&&ud(e,i,{get:()=>t[i],enumerable:!(r=ete(t,i))||r.enumerable});return e},md=(e,t,n)=>(n=e==null?{}:$ee(tte(e)),pd(t||!e||!e.__esModule?ud(n,`default`,{value:e,enumerable:!0}):n,e)),hd=e=>pd(ud({},`__esModule`,{value:!0}),e);function gd(e,t){for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let t=e[n];if(r&&typeof r==`object`&&r.CONTAINS!==void 0){if(!Array.isArray(t)||!t.find(e=>xd(e,r.CONTAINS)))return!1}else if(!xd(t,r))return!1}return!0}function _d(e,t){return e.filter(e=>gd(e,t))}function vd(e){return`${e.schema??``}:${e.table??``}:${e.name}:${e.entityType}`}function rte(e,t){let n=vd(t);return e.find(e=>vd(e)===n)}function ite(e,t){let n=vd(t);return e.filter(e=>vd(e)===n)}function yd(e,t,n=!1){if(typeof e!=`object`||!e)return!1;for(let r of Array.from(new Set([...Object.keys(e),...Object.keys(t)])))if(!(!n&&r===`entityType`)){if(!t[r])return!1;if(t[r]===`string[]`){if(!Array.isArray(e[r])||!e[r].every(e=>typeof e==`string`))return!1}else if(typeof t[r]==`string`){let n=t[r].endsWith(`?`);if(e[r]===null&&!n||e[r]!==null&&typeof e[r]!==Ed(t[r]))return!1}else if(Array.isArray(t[r])){if(typeof t[r][0]==`string`){if(!t[r].some(t=>t===e[r]))return!1}else if(!Array.isArray(e[r])||!e[r].every(e=>yd(e,t[r][0]),!0))return!1}else if(e[r]!==null&&!yd(e[r],t[r],!0))return!1}return!0}function bd({entities:e},t,n,r){let i=Object.entries(e),a=Object.fromEntries(Object.entries(n?r:e).map(([e,t])=>[e,Object.keys(t).filter(e=>e in Od).length+4]));return Object.fromEntries(i.map(([i,o])=>[i,{push:kd(n?r:e,t,n?void 0:i),list:Ad(t,n?void 0:i),one:jd(t,n?void 0:i),update:Md(t,n?void 0:i),delete:Nd(t,n?void 0:i),validate:Fd(n?r:e,n?void 0:i),hasDiff:Pd(a)}]))}function xd(e,t){return typeof e==typeof t?Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>xd(e,t[n])):!1:typeof e==`object`?e===t?!0:(e===null||t===null)&&e!==t?!1:Array.from(new Set([...Object.keys(e),...Object.keys(t)])).every(n=>xd(e[n],t[n])):e===t:!1}function Sd(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!Id[e]))}function Cd(e){let t={};for(let n of Object.keys(Od))e[n]===void 0||e[n]===null||(t[n]=e[n]);return t}function wd(e,t,n,r){n??=`entities`,r??=`all`;let i=e.entities.list(n===`entities`?void 0:{entityType:n}),a=t.entities.list(n===`entities`?void 0:{entityType:n}),o={},s={};for(let e of i)o[vd(e)]=e;for(let e of a)s[vd(e)]=e;let c=[],l=[],u=[];for(let[e,t]of Object.entries(o)){let n=s[e];if(!n)(r===`all`||r===`drop`||r===`createdrop`)&&l.push({$diffType:`drop`,entityType:t.entityType,...Cd(t),...Sd(t)});else if(r===`all`||r===`alter`){let e={},r=!1;for(let[i,a]of Object.entries(t))Id[i]||xd(t[i],n[i])||(r=!0,e[i]={from:t[i],to:n[i]});r&&u.push({$diffType:`alter`,entityType:n.entityType,...Cd(n),...e,$left:t,$right:n})}delete s[e]}if(r===`all`||r===`create`||r===`createdrop`)for(let e of Object.values(s))c.push({$diffType:`create`,entityType:e.entityType,...Cd(e),...Sd(e)});return[...c,...l,...u]}function Td(e,t,n){return wd(e,t,n,`createdrop`)}function Ed(e){return e.endsWith(`?`)?e.slice(0,e.length-1):e}function Dd(e){let t=new Ld(e),n=bd(t._,t._.store,!1);for(let[e,r]of Object.entries(n))t[e]=r;return t}var Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd=B({"src/dialects/dialect.ts"(){Od={schema:`string?`,table:`string?`,name:`string`},kd=(e,t,n)=>{let r=n?Object.fromEntries(Object.keys(e[n]).filter(e=>!Od[e]||!Od[e].endsWith(`?`)).map(e=>[e,null])):void 0;return(i,a)=>{let o=Object.fromEntries(Object.entries(i).filter(([e,t])=>t!==void 0)),s=n??o.entityType,c={...r??Object.fromEntries(Object.keys(e[s]).map(e=>[e,null])),...o,entityType:s},l=a?t.collection.find(e=>{if(e.entityType!==c.entityType)return!1;for(let t of a)if(t in c&&!xd(c[t],e[t]))return!1;return!0}):rte(t.collection,c);return l?{status:`CONFLICT`,data:l}:(t.collection.push(c),{status:`OK`,data:c})}},Ad=(e,t)=>n=>{let r=t?_d(e.collection,{entityType:t}):e.collection;return n?_d(r,n):r},jd=(e,t)=>n=>{let r=t?_d(e.collection,{entityType:t}):e.collection;return n?_d(r,n)[0]??null:r[0]??null},Md=(e,t)=>({set:n,where:r})=>{let i=t?{...r,entityType:t}:r,a=i?_d(e.collection,i):e.collection,o=Object.entries(n),s=[],c=0,l=[];for(let t of a){let n={...t};for(let[e,r]of o){if(!(e in t))continue;let i=t[e];n[e]=typeof r==`function`?Array.isArray(i)?i.map(r):r(i):r}let r=ite(e.collection,n).filter(e=>e!==t);l.push(...r.filter(e=>!l.find(t=>t===e))),r.length||s.push({item:n,index:c++})}if(l.length)return{status:`CONFLICT`,data:l};for(let{index:e,item:t}of s)Object.assign(a[e],t);return{status:`OK`,data:a}},Nd=(e,t)=>n=>{let r=[],i=[],a=t?{...n,entityType:t}:n;return a?(e.collection.forEach(e=>{gd(e,a)?i.push(e):r.push(e)}),e.collection=r,i):(e.collection=r,i)},Pd=e=>t=>{let n=e[t.entityType];return Object.keys(t).length>n},Fd=(e,t)=>(n=>{if(typeof n!=`object`||!n)return!1;let r=t??n.entityType;if(typeof r!=`string`||n.entityType!==r)return!1;let i=e[r];return i?yd(n,i):!1}),Id={entityType:!0,name:!0,schema:!0,table:!0},(e=>{function t(e,t,n){return wd(e,t,n,`all`)}e.all=t;function n(e,t,n){return wd(e,t,n,`create`)}e.creates=n;function r(e,t,n){return wd(e,t,n,`drop`)}e.drops=r;function i(e,t,n){return wd(e,t,n,`alter`)}e.alters=i})(Td||={}),Ld=class{_={diffs:{},store:{collection:[]}};entities;constructor(e){let t=Object.entries(e),n=Object.fromEntries(t.map(([e,t])=>{if(e===`entities`||e===`_`)throw Error(`Illegal entity type name: "${e}"`);let n={};for(let r in Object.entries(t).forEach(([t,r])=>{if(n[t]=r,r===`required`){if(!(t in Od))throw Error(`Type value "required" is only applicable to common keys [ ${Object.keys(Od).map(e=>`"${e}"`).join(`, `)} ], used on: "${t}"`);n[t]=Ed(Od[t])}else if(t in Od)throw Error(`Used forbidden key "${t}" in entity "${e}"`)}),Od)Od[r].endsWith(`?`)||(n[r]=Od[r]);return[e,n]}));this._.entities=n,this.entities=bd({...this._,entities:{entities:Od}},this._.store,!0,this._.entities).entities}}}});function zd(e){throw Error(`Didn't expect to get here`)}function Bd(e){return e.replace(/'/g,`''`)}function Vd(e,t,n,r=0){if(!Array.isArray(e))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)?Vd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Hd(e,t,n,r=0){if(!e.find(e=>Array.isArray(e)))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)&&e.find(e=>Array.isArray(e))?Hd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Ud(e){return tf.test(e)}function Wd(e){let t={},n=e.split(` `);if(n.length===1)return t;let r=n.slice(1,n.length).join(` `);if(nf.includes(r))return{...t,fields:r};for(let e of nf)if(r.startsWith(`${e}(`))return{...t,fields:e};return t}function Gd(e){let t=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)},n=(e,t)=>{let n=new ArrayBuffer(8),r=new DataView(n);for(let n=0;n<8;n++)r.setUint8(n,e[t+n]);return r.getFloat64(0,!0)},r=t(e),i=0,a=r[i];i+=1;let o=new DataView(r.buffer),s=o.getUint32(i,a===1);i+=4;let c;if(s&536870912&&(c=o.getUint32(i,a===1),i+=4),(s&65535)==1){let e=n(r,i);i+=8;let t=n(r,i);return i+=8,{srid:c,point:[e,t]}}throw Error(`Unsupported geometry type`)}var Kd,qd,H,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf=B({"src/utils/index.ts"(){Kd=`00000000-0000-0000-0000-000000000000`,qd=e=>e.map(e=>{let t=e.from.schema?`${e.from.schema}.`:``,n=e.to.schema?`${e.to.schema}.`:``,r=e.from.table?`${e.from.table}.`:``,i=e.to.table?`${e.to.table}.`:``;return`${t}${r}${e.from.name}->${n}${i}${e.to.name}`}),H=(e,t)=>e.length<2?e:typeof t==`string`&&e.startsWith(t)&&e.endsWith(t)||Array.isArray(t)&&e.startsWith(t[0])&&e.endsWith(t[1])?e.substring(1,e.length-1):e,Jd=(e,t)=>!e.startsWith(t)||!e.endsWith(t)?`${t}${e}${t}`:e,Yd=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?/,Xd=e=>Yd.test(e),Zd=/^\d{4}-\d{2}-\d{2}/,Qd=e=>Zd.test(e),$d=/^(\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?|\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)$/,ef=e=>$d.test(e),tf=/([+-]\d{2}(:\d{2})?|Z)$/i,nf=[`year`,`month`,`day`,`hour`,`minute`,`second`,`year to month`,`day to hour`,`day to minute`,`day to second`,`hour to minute`,`hour to second`,`minute to second`]}}),af={};fd(af,{StringBuffer:()=>_f,abstract:()=>of,assert:()=>sf,checkNotNull:()=>cte,clone:()=>ate,copyWithoutDuplicates:()=>pf,defineLazyProperty:()=>cf,getDuplicates:()=>ff,isLexical:()=>hf,isSyntactic:()=>mf,padLeft:()=>gf,repeat:()=>df,repeatFn:()=>lf,repeatStr:()=>uf,unescapeCodePoint:()=>ote,unexpectedObjToString:()=>ste});function of(e){let t=e||``;return function(){throw Error(`this method `+t+` is abstract! (it has no implementation in class `+this.constructor.name+`)`)}}function sf(e,t){if(!e)throw Error(t||`Assertion failed`)}function cf(e,t,n){let r;Object.defineProperty(e,t,{get(){return r||=n.call(this),r}})}function ate(e){return e&&Object.assign({},e)}function lf(e,t){let n=[];for(;t-- >0;)n.push(e());return n}function uf(e,t){return Array(t+1).join(e)}function df(e,t){return lf(()=>e,t)}function ff(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];e.lastIndexOf(r)!==n&&t.indexOf(r)<0&&t.push(r)}return t}function pf(e){let t=[];return e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),t}function mf(e){let t=e[0];return t===t.toUpperCase()}function hf(e){return!mf(e)}function gf(e,t,n){let r=n||` `;return e.length<t?uf(r,t-e.length)+e:e}function _f(){this.strings=[]}function ote(e){if(e.charAt(0)===`\\`)switch(e.charAt(1)){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
|
|
83
|
+
`))},async task(e,t){let n=Date.now(),r=await t(),i=`${Date.now()-n}ms DONE`,a=`.`.repeat(Math.max(1,45-e.length-i.length));return Ci.message(`${e} ${F.default.dim(a)} ${F.default.green(i)}`,{symbol:F.default.green(`◆`)}),r},taskStatus(e,t){let n=`.`.repeat(Math.max(1,45-e.length-t.length));Ci.message(`${e} ${F.default.dim(n)} ${F.default.dim(t)}`,{symbol:F.default.dim(`◇`)})},warn(e){Ci.warn(e)}}}function ki(e){return{aliases:e.aliases||[],description:e.description,devOnly:e.devOnly??!1,args:e.args||[],opts:e.opts||{},run:e.run}}const Ai=[`canvas`,`esbuild`,`lightningcss`,`sharp`,`ultimate-express`,`uWebSockets.js`,`pino`,`pino-pretty`,`thread-stream`,`vite`,`vitest`,`youch`],ji=[`@esbuild/`,`@img/`,`@opentelemetry/`,`@dbos-inc/`,`@aws-sdk/`,`@smithy/`];function Mi(){return[...Ai,...ji.map(e=>`${e}*`)]}async function Ni(){let e=[];try{await N(`./main.ts`),e.push(`./main.ts`)}catch{}for await(let t of st(`./api/**/*.ts`))t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||t.includes(`/__fixtures__/`)||t.includes(`/databases/`)||e.push(t);return e}var Pi=ki({description:`Build the application for production deployment`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`build`);let t=await Ni();e.step(`Found ${t.length} entry points`),await e.spinner(`Building production bundle`,async()=>{await lt(`./dist`,{recursive:!0,force:!0});let{build:e}=await import(`esbuild`);await e({banner:{js:`import{createRequire as __appos_createRequire}from"module";import{fileURLToPath as __appos_fileURLToPath}from"node:url";import{dirname as __appos_dirname}from"node:path";const __filename=__appos_fileURLToPath(import.meta.url);const __dirname=__appos_dirname(__filename);const require=__appos_createRequire(import.meta.url);`},bundle:!0,entryPoints:t,external:Mi(),format:`esm`,logLevel:`error`,minify:!0,outdir:`./dist`,outbase:`.`,platform:`node`,sourcemap:!0,splitting:!0,target:`node24`}),await ot(`./api/databases`,`./dist/api/databases`,{recursive:!0})}),e.success(`Built to ./dist`),await e.cleanup(),e.outro()}}),I=t(i(((e,t)=>{var n=class e extends Array{constructor(t,n){if(super(t),this.sign=n,Object.setPrototypeOf(this,e.prototype),t>e.__kMaxLength)throw RangeError(`Maximum BigInt size exceeded`)}static BigInt(t){var n=Math.floor,r=Number.isFinite;if(typeof t==`number`){if(t===0)return e.__zero();if(e.__isOneDigitInt(t))return 0>t?e.__oneDigit(-t,!0):e.__oneDigit(t,!1);if(!r(t)||n(t)!==t)throw RangeError(`The number `+t+` cannot be converted to BigInt because it is not an integer`);return e.__fromDouble(t)}if(typeof t==`string`){let n=e.__fromString(t);if(n===null)throw SyntaxError(`Cannot convert `+t+` to a BigInt`);return n}if(typeof t==`boolean`)return!0===t?e.__oneDigit(1,!1):e.__zero();if(typeof t==`object`){if(t.constructor===e)return t;let n=e.__toPrimitive(t);return e.BigInt(n)}throw TypeError(`Cannot convert `+t+` to a BigInt`)}toDebugString(){let e=[`BigInt[`];for(let t of this)e.push((t&&(t>>>0).toString(16))+`, `);return e.push(`]`),e.join(``)}toString(t=10){if(2>t||36<t)throw RangeError(`toString() radix argument must be between 2 and 36`);return this.length===0?`0`:t&t-1?e.__toStringGeneric(this,t,!1):e.__toStringBasePowerOfTwo(this,t)}valueOf(){throw Error("Convert JSBI instances to native numbers using `toNumber`.")}static toNumber(t){let n=t.length;if(n===0)return 0;if(n===1){let e=t.__unsignedDigit(0);return t.sign?-e:e}let r=t.__digit(n-1),i=e.__clz30(r),a=30*n-i;if(1024<a)return t.sign?-1/0:1/0;let o=a-1,s=r,c=n-1,l=i+3,u=l===32?0:s<<l;u>>>=12;let d=l-12,f=12<=l?0:s<<20+l,p=20+l;for(0<d&&0<c&&(c--,s=t.__digit(c),u|=s>>>30-d,f=s<<d+2,p=d+2);0<p&&0<c;)c--,s=t.__digit(c),f|=30<=p?s<<p-30:s>>>30-p,p-=30;let m=e.__decideRounding(t,p,c,s);if((m===1||m===0&&(1&f)==1)&&(f=f+1>>>0,f===0&&(u++,u>>>20&&(u=0,o++,1023<o))))return t.sign?-1/0:1/0;let h=t.sign?-2147483648:0;return o=o+1023<<20,e.__kBitConversionInts[e.__kBitConversionIntHigh]=h|o|u,e.__kBitConversionInts[e.__kBitConversionIntLow]=f,e.__kBitConversionDouble[0]}static unaryMinus(e){if(e.length===0)return e;let t=e.__copy();return t.sign=!e.sign,t}static bitwiseNot(t){return t.sign?e.__absoluteSubOne(t).__trim():e.__absoluteAddOne(t,!0)}static exponentiate(t,n){if(n.sign)throw RangeError(`Exponent must be positive`);if(n.length===0)return e.__oneDigit(1,!1);if(t.length===0)return t;if(t.length===1&&t.__digit(0)===1)return t.sign&&!(1&n.__digit(0))?e.unaryMinus(t):t;if(1<n.length)throw RangeError(`BigInt too big`);let r=n.__unsignedDigit(0);if(r===1)return t;if(r>=e.__kMaxLengthBits)throw RangeError(`BigInt too big`);if(t.length===1&&t.__digit(0)===2){let n=1+(0|r/30),i=new e(n,t.sign&&(1&r)!=0);i.__initializeDigits();let a=1<<r%30;return i.__setDigit(n-1,a),i}let i=null,a=t;for(1&r&&(i=t),r>>=1;r!==0;r>>=1)a=e.multiply(a,a),1&r&&(i=i===null?a:e.multiply(i,a));return i}static multiply(t,n){if(t.length===0)return t;if(n.length===0)return n;let r=t.length+n.length;30<=t.__clzmsd()+n.__clzmsd()&&r--;let i=new e(r,t.sign!==n.sign);i.__initializeDigits();for(let r=0;r<t.length;r++)e.__multiplyAccumulate(n,t.__digit(r),i,r);return i.__trim()}static divide(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return e.__zero();let r=t.sign!==n.sign,i=n.__unsignedDigit(0),a;if(n.length===1&&32767>=i){if(i===1)return r===t.sign?t:e.unaryMinus(t);a=e.__absoluteDivSmall(t,i,null)}else a=e.__absoluteDivLarge(t,n,!0,!1);return a.sign=r,a.__trim()}static remainder(t,n){if(n.length===0)throw RangeError(`Division by zero`);if(0>e.__absoluteCompare(t,n))return t;let r=n.__unsignedDigit(0);if(n.length===1&&32767>=r){if(r===1)return e.__zero();let n=e.__absoluteModSmall(t,r);return n===0?e.__zero():e.__oneDigit(n,t.sign)}let i=e.__absoluteDivLarge(t,n,!1,!0);return i.sign=t.sign,i.__trim()}static add(t,n){let r=t.sign;return r===n.sign?e.__absoluteAdd(t,n,r):0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r)}static subtract(t,n){let r=t.sign;return r===n.sign?0<=e.__absoluteCompare(t,n)?e.__absoluteSub(t,n,r):e.__absoluteSub(n,t,!r):e.__absoluteAdd(t,n,r)}static leftShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__rightShiftByAbsolute(t,n):e.__leftShiftByAbsolute(t,n)}static signedRightShift(t,n){return n.length===0||t.length===0?t:n.sign?e.__leftShiftByAbsolute(t,n):e.__rightShiftByAbsolute(t,n)}static unsignedRightShift(){throw TypeError(`BigInts have no unsigned right shift; use >> instead`)}static lessThan(t,n){return 0>e.__compareToBigInt(t,n)}static lessThanOrEqual(t,n){return 0>=e.__compareToBigInt(t,n)}static greaterThan(t,n){return 0<e.__compareToBigInt(t,n)}static greaterThanOrEqual(t,n){return 0<=e.__compareToBigInt(t,n)}static equal(e,t){if(e.sign!==t.sign||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e.__digit(n)!==t.__digit(n))return!1;return!0}static notEqual(t,n){return!e.equal(t,n)}static bitwiseAnd(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteAnd(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length)+1,a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return a=e.__absoluteOr(a,o,a),e.__absoluteAddOne(a,!0,a).__trim()}return t.sign&&([t,n]=[n,t]),e.__absoluteAndNot(t,e.__absoluteSubOne(n)).__trim()}static bitwiseXor(t,n){var r=Math.max;if(!t.sign&&!n.sign)return e.__absoluteXor(t,n).__trim();if(t.sign&&n.sign){let i=r(t.length,n.length),a=e.__absoluteSubOne(t,i),o=e.__absoluteSubOne(n);return e.__absoluteXor(a,o,a).__trim()}let i=r(t.length,n.length)+1;t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteXor(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static bitwiseOr(t,n){var r=Math.max;let i=r(t.length,n.length);if(!t.sign&&!n.sign)return e.__absoluteOr(t,n).__trim();if(t.sign&&n.sign){let r=e.__absoluteSubOne(t,i),a=e.__absoluteSubOne(n);return r=e.__absoluteAnd(r,a,r),e.__absoluteAddOne(r,!0,r).__trim()}t.sign&&([t,n]=[n,t]);let a=e.__absoluteSubOne(n,i);return a=e.__absoluteAndNot(a,t,a),e.__absoluteAddOne(a,!0,a).__trim()}static asIntN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=n.__unsignedDigit(i-1),o=1<<(t-1)%30;if(n.length===i&&a<o)return n;if((a&o)!==o)return e.__truncateToNBits(t,n);if(!n.sign)return e.__truncateAndSubFromPowerOfTwo(t,n,!0);if(!(a&o-1)){for(let r=i-2;0<=r;r--)if(n.__digit(r)!==0)return e.__truncateAndSubFromPowerOfTwo(t,n,!1);return n.length===i&&a===o?n:e.__truncateToNBits(t,n)}return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}static asUintN(t,n){var r=Math.floor;if(n.length===0)return n;if(t=r(t),0>t)throw RangeError(`Invalid value: not (convertible to) a safe integer`);if(t===0)return e.__zero();if(n.sign){if(t>e.__kMaxLengthBits)throw RangeError(`BigInt too big`);return e.__truncateAndSubFromPowerOfTwo(t,n,!1)}if(t>=e.__kMaxLengthBits)return n;let i=0|(t+29)/30;if(n.length<i)return n;let a=t%30;return n.length==i&&(a===0||!(n.__digit(i-1)>>>a))?n:e.__truncateToNBits(t,n)}static ADD(t,n){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`)return typeof n!=`string`&&(n=n.toString()),t+n;if(typeof n==`string`)return t.toString()+n;if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)&&e.__isBigInt(n))return e.add(t,n);if(typeof t==`number`&&typeof n==`number`)return t+n;throw TypeError(`Cannot mix BigInt and other types, use explicit conversions`)}static LT(t,n){return e.__compare(t,n,0)}static LE(t,n){return e.__compare(t,n,1)}static GT(t,n){return e.__compare(t,n,2)}static GE(t,n){return e.__compare(t,n,3)}static EQ(t,n){for(;;){if(e.__isBigInt(t))return e.__isBigInt(n)?e.equal(t,n):e.EQ(n,t);if(typeof t==`number`){if(e.__isBigInt(n))return e.__equalToNumber(n,t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`string`){if(e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.equal(t,n);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`boolean`){if(e.__isBigInt(n))return e.__equalToNumber(n,+t);if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`symbol`){if(e.__isBigInt(n))return!1;if(typeof n!=`object`)return t==n;n=e.__toPrimitive(n)}else if(typeof t==`object`){if(typeof n==`object`&&n.constructor!==e)return t==n;t=e.__toPrimitive(t)}else return t==n}}static NE(t,n){return!e.EQ(t,n)}static DataViewGetBigInt64(t,n,r=!1){return e.asIntN(64,e.DataViewGetBigUint64(t,n,r))}static DataViewGetBigUint64(t,n,r=!1){let[i,a]=r?[4,0]:[0,4],o=t.getUint32(n+i,r),s=t.getUint32(n+a,r),c=new e(3,!1);return c.__setDigit(0,1073741823&s),c.__setDigit(1,(268435455&o)<<2|s>>>30),c.__setDigit(2,o>>>28),c.__trim()}static DataViewSetBigInt64(t,n,r,i=!1){e.DataViewSetBigUint64(t,n,r,i)}static DataViewSetBigUint64(t,n,r,i=!1){r=e.asUintN(64,r);let a=0,o=0;if(0<r.length&&(o=r.__digit(0),1<r.length)){let e=r.__digit(1);o|=e<<30,a=e>>>2,2<r.length&&(a|=r.__digit(2)<<28)}let[s,c]=i?[4,0]:[0,4];t.setUint32(n+s,a,i),t.setUint32(n+c,o,i)}static __zero(){return new e(0,!1)}static __oneDigit(t,n){let r=new e(1,n);return r.__setDigit(0,t),r}__copy(){let t=new e(this.length,this.sign);for(let e=0;e<this.length;e++)t[e]=this[e];return t}__trim(){let e=this.length,t=this[e-1];for(;t===0;)e--,t=this[e-1],this.pop();return e===0&&(this.sign=!1),this}__initializeDigits(){for(let e=0;e<this.length;e++)this[e]=0}static __decideRounding(e,t,n,r){if(0<t)return-1;let i;if(0>t)i=-t-1;else{if(n===0)return-1;n--,r=e.__digit(n),i=29}let a=1<<i;if((r&a)==0)return-1;if(--a,(r&a)!=0)return 1;for(;0<n;)if(n--,e.__digit(n)!==0)return 1;return 0}static __fromDouble(t){e.__kBitConversionDouble[0]=t;let n=(2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20)-1023,r=(0|n/30)+1,i=new e(r,0>t),a=1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh]|1048576,o=e.__kBitConversionInts[e.__kBitConversionIntLow],s=n%30,c,l=0;if(s<20){let e=20-s;l=e+32,c=a>>>e,a=a<<32-e|o>>>e,o<<=32-e}else if(s===20)l=32,c=a,a=o,o=0;else{let e=s-20;l=32-e,c=a<<e|o>>>32-e,a=o<<e,o=0}i.__setDigit(r-1,c);for(let e=r-2;0<=e;e--)0<l?(l-=30,c=a>>>2,a=a<<30|o>>>2,o<<=30):c=0,i.__setDigit(e,c);return i.__trim()}static __isWhitespace(e){return 13>=e&&9<=e||(159>=e?e==32:131071>=e?e==160||e==5760:196607>=e?(e&=131071,10>=e||e==40||e==41||e==47||e==95||e==4096):e==65279)}static __fromString(t,n=0){let r=0,i=t.length,a=0;if(a===i)return e.__zero();let o=t.charCodeAt(a);for(;e.__isWhitespace(o);){if(++a===i)return e.__zero();o=t.charCodeAt(a)}if(o===43){if(++a===i)return null;o=t.charCodeAt(a),r=1}else if(o===45){if(++a===i)return null;o=t.charCodeAt(a),r=-1}if(n===0){if(n=10,o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(n=16,++a===i)return null;o=t.charCodeAt(a)}else if(o===79||o===111){if(n=8,++a===i)return null;o=t.charCodeAt(a)}else if(o===66||o===98){if(n=2,++a===i)return null;o=t.charCodeAt(a)}}}else if(n===16&&o===48){if(++a===i)return e.__zero();if(o=t.charCodeAt(a),o===88||o===120){if(++a===i)return null;o=t.charCodeAt(a)}}if(r!=0&&n!==10)return null;for(;o===48;){if(++a===i)return e.__zero();o=t.charCodeAt(a)}let s=i-a,c=e.__kMaxBitsPerChar[n],l=e.__kBitsPerCharTableMultiplier-1;if(s>1073741824/c)return null;let u=new e(0|((c*s+l>>>e.__kBitsPerCharTableShift)+29)/30,!1),d=10>n?n:10,f=10<n?n-10:0;if(n&n-1){u.__initializeDigits();let r=!1,s=0;do{let p=0,m=1;for(;;){let e;if(o-48>>>0<d)e=o-48;else if((32|o)-97>>>0<f)e=(32|o)-87;else{r=!0;break}let c=m*n;if(1073741823<c)break;if(m=c,p=p*n+e,s++,++a===i){r=!0;break}o=t.charCodeAt(a)}l=30*e.__kBitsPerCharTableMultiplier-1;let h=0|(c*s+l>>>e.__kBitsPerCharTableShift)/30;u.__inplaceMultiplyAdd(m,p,h)}while(!r)}else{c>>=e.__kBitsPerCharTableShift;let n=[],r=[],s=!1;do{let e=0,l=0;for(;;){let n;if(o-48>>>0<d)n=o-48;else if((32|o)-97>>>0<f)n=(32|o)-87;else{s=!0;break}if(l+=c,e=e<<c|n,++a===i){s=!0;break}if(o=t.charCodeAt(a),30<l+c)break}n.push(e),r.push(l)}while(!s);e.__fillFromParts(u,n,r)}if(a!==i){if(!e.__isWhitespace(o))return null;for(a++;a<i;a++)if(o=t.charCodeAt(a),!e.__isWhitespace(o))return null}return u.sign=r==-1,u.__trim()}static __fillFromParts(e,t,n){let r=0,i=0,a=0;for(let o=t.length-1;0<=o;o--){let s=t[o],c=n[o];i|=s<<a,a+=c,a===30?(e.__setDigit(r++,i),a=0,i=0):30<a&&(e.__setDigit(r++,1073741823&i),a-=30,i=s>>>c-a)}if(i!==0){if(r>=e.length)throw Error(`implementation bug`);e.__setDigit(r++,i)}for(;r<e.length;r++)e.__setDigit(r,0)}static __toStringBasePowerOfTwo(t,n){let r=t.length,i=n-1;i=(85&i>>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);let a=i,o=n-1,s=t.__digit(r-1),c=e.__clz30(s),l=0|(30*r-c+a-1)/a;if(t.sign&&l++,268435456<l)throw Error(`string too long`);let u=Array(l),d=l-1,f=0,p=0;for(let n=0;n<r-1;n++){let r=t.__digit(n),i=(f|r<<p)&o;u[d--]=e.__kConversionChars[i];let s=a-p;for(f=r>>>s,p=30-s;p>=a;)u[d--]=e.__kConversionChars[f&o],f>>>=a,p-=a}let m=(f|s<<p)&o;for(u[d--]=e.__kConversionChars[m],f=s>>>a-p;f!==0;)u[d--]=e.__kConversionChars[f&o],f>>>=a;if(t.sign&&(u[d--]=`-`),d!=-1)throw Error(`implementation bug`);return u.join(``)}static __toStringGeneric(t,n,r){let i=t.length;if(i===0)return``;if(i===1){let e=t.__unsignedDigit(0).toString(n);return!1===r&&t.sign&&(e=`-`+e),e}let a=30*i-e.__clz30(t.__digit(i-1)),o=e.__kMaxBitsPerChar[n]-1,s=a*e.__kBitsPerCharTableMultiplier;s+=o-1,s=0|s/o;let c=s+1>>1,l=e.exponentiate(e.__oneDigit(n,!1),e.__oneDigit(c,!1)),u,d,f=l.__unsignedDigit(0);if(l.length===1&&32767>=f){u=new e(t.length,!1),u.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){let n=r<<15|t.__halfDigit(e);u.__setHalfDigit(e,0|n/f),r=0|n%f}d=r.toString(n)}else{let r=e.__absoluteDivLarge(t,l,!0,!0);u=r.quotient;let i=r.remainder.__trim();d=e.__toStringGeneric(i,n,!0)}u.__trim();let p=e.__toStringGeneric(u,n,!0);for(;d.length<c;)d=`0`+d;return!1===r&&t.sign&&(p=`-`+p),p+d}static __unequalSign(e){return e?-1:1}static __absoluteGreater(e){return e?-1:1}static __absoluteLess(e){return e?1:-1}static __compareToBigInt(t,n){let r=t.sign;if(r!==n.sign)return e.__unequalSign(r);let i=e.__absoluteCompare(t,n);return 0<i?e.__absoluteGreater(r):0>i?e.__absoluteLess(r):0}static __compareToNumber(t,n){if(e.__isOneDigitInt(n)){let r=t.sign,i=0>n;if(r!==i)return e.__unequalSign(r);if(t.length===0){if(i)throw Error(`implementation bug`);return n===0?0:-1}if(1<t.length)return e.__absoluteGreater(r);let a=Math.abs(n),o=t.__unsignedDigit(0);return o>a?e.__absoluteGreater(r):o<a?e.__absoluteLess(r):0}return e.__compareToDouble(t,n)}static __compareToDouble(t,n){if(n!==n)return n;if(n===1/0)return-1;if(n===-1/0)return 1;let r=t.sign;if(r!==0>n)return e.__unequalSign(r);if(n===0)throw Error(`implementation bug: should be handled elsewhere`);if(t.length===0)return-1;e.__kBitConversionDouble[0]=n;let i=2047&e.__kBitConversionInts[e.__kBitConversionIntHigh]>>>20;if(i==2047)throw Error(`implementation bug: handled elsewhere`);let a=i-1023;if(0>a)return e.__absoluteGreater(r);let o=t.length,s=t.__digit(o-1),c=e.__clz30(s),l=30*o-c,u=a+1;if(l<u)return e.__absoluteLess(r);if(l>u)return e.__absoluteGreater(r);let d=1048576|1048575&e.__kBitConversionInts[e.__kBitConversionIntHigh],f=e.__kBitConversionInts[e.__kBitConversionIntLow],p=29-c;if(p!==(0|(l-1)%30))throw Error(`implementation bug`);let m,h=0;if(20>p){let e=20-p;h=e+32,m=d>>>e,d=d<<32-e|f>>>e,f<<=32-e}else if(p===20)h=32,m=d,d=f,f=0;else{let e=p-20;h=32-e,m=d<<e|f>>>32-e,d=f<<e,f=0}if(s>>>=0,m>>>=0,s>m)return e.__absoluteGreater(r);if(s<m)return e.__absoluteLess(r);for(let n=o-2;0<=n;n--){0<h?(h-=30,m=d>>>2,d=d<<30|f>>>2,f<<=30):m=0;let i=t.__unsignedDigit(n);if(i>m)return e.__absoluteGreater(r);if(i<m)return e.__absoluteLess(r)}if(d!==0||f!==0){if(h===0)throw Error(`implementation bug`);return e.__absoluteLess(r)}return 0}static __equalToNumber(t,n){var r=Math.abs;return e.__isOneDigitInt(n)?n===0?t.length===0:t.length===1&&t.sign===0>n&&t.__unsignedDigit(0)===r(n):e.__compareToDouble(t,n)===0}static __comparisonResultToBool(e,t){return t===0?0>e:t===1?0>=e:t===2?0<e:t===3?0<=e:void 0}static __compare(t,n,r){if(t=e.__toPrimitive(t),n=e.__toPrimitive(n),typeof t==`string`&&typeof n==`string`)switch(r){case 0:return t<n;case 1:return t<=n;case 2:return t>n;case 3:return t>=n}if(e.__isBigInt(t)&&typeof n==`string`)return n=e.__fromString(n),n!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof t==`string`&&e.__isBigInt(n))return t=e.__fromString(t),t!==null&&e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(t=e.__toNumeric(t),n=e.__toNumeric(n),e.__isBigInt(t)){if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToBigInt(t,n),r);if(typeof n!=`number`)throw Error(`implementation bug`);return e.__comparisonResultToBool(e.__compareToNumber(t,n),r)}if(typeof t!=`number`)throw Error(`implementation bug`);if(e.__isBigInt(n))return e.__comparisonResultToBool(e.__compareToNumber(n,t),2^r);if(typeof n!=`number`)throw Error(`implementation bug`);return r===0?t<n:r===1?t<=n:r===2?t>n:r===3?t>=n:void 0}__clzmsd(){return e.__clz30(this.__digit(this.length-1))}static __absoluteAdd(t,n,r){if(t.length<n.length)return e.__absoluteAdd(n,t,r);if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=t.length;(t.__clzmsd()===0||n.length===t.length&&n.__clzmsd()===0)&&i++;let a=new e(i,r),o=0,s=0;for(;s<n.length;s++){let e=t.__digit(s)+n.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}for(;s<t.length;s++){let e=t.__digit(s)+o;o=e>>>30,a.__setDigit(s,1073741823&e)}return s<a.length&&a.__setDigit(s,o),a.__trim()}static __absoluteSub(t,n,r){if(t.length===0)return t;if(n.length===0)return t.sign===r?t:e.unaryMinus(t);let i=new e(t.length,r),a=0,o=0;for(;o<n.length;o++){let e=t.__digit(o)-n.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}for(;o<t.length;o++){let e=t.__digit(o)-a;a=1&e>>>30,i.__setDigit(o,1073741823&e)}return i.__trim()}static __absoluteAddOne(t,n,r=null){let i=t.length;r===null?r=new e(i,n):r.sign=n;let a=1;for(let e=0;e<i;e++){let n=t.__digit(e)+a;a=n>>>30,r.__setDigit(e,1073741823&n)}return a!=0&&r.__setDigitGrow(i,1),r}static __absoluteSubOne(t,n){let r=t.length;n||=r;let i=new e(n,!1),a=1;for(let e=0;e<r;e++){let n=t.__digit(e)-a;a=1&n>>>30,i.__setDigit(e,1073741823&n)}if(a!=0)throw Error(`implementation bug`);for(let e=r;e<n;e++)i.__setDigit(e,0);return i}static __absoluteAnd(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=o;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&n.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteAndNot(t,n,r=null){let i=t.length,a=n.length,o=a;i<a&&(o=i);let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)&~n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteOr(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)|n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteXor(t,n,r=null){let i=t.length,a=n.length,o=a;if(i<a){o=i;let e=t,r=i;t=n,i=a,n=e,a=r}let s=i;r===null?r=new e(s,!1):s=r.length;let c=0;for(;c<o;c++)r.__setDigit(c,t.__digit(c)^n.__digit(c));for(;c<i;c++)r.__setDigit(c,t.__digit(c));for(;c<s;c++)r.__setDigit(c,0);return r}static __absoluteCompare(e,t){let n=e.length-t.length;if(n!=0)return n;let r=e.length-1;for(;0<=r&&e.__digit(r)===t.__digit(r);)r--;return 0>r?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}static __multiplyAccumulate(t,n,r,i){if(n===0)return;let a=32767&n,o=n>>>15,s=0,c=0;for(let n,l=0;l<t.length;l++,i++){n=r.__digit(i);let u=t.__digit(l),d=32767&u,f=u>>>15,p=e.__imul(d,a),m=e.__imul(d,o),h=e.__imul(f,a),g=e.__imul(f,o);n+=c+p+s,s=n>>>30,n&=1073741823,n+=((32767&m)<<15)+((32767&h)<<15),s+=n>>>30,c=g+(m>>>15)+(h>>>15),r.__setDigit(i,1073741823&n)}for(;s!=0||c!==0;i++){let e=r.__digit(i);e+=s+c,c=0,s=e>>>30,r.__setDigit(i,1073741823&e)}}static __internalMultiplyAdd(t,n,r,i,a){let o=r,s=0;for(let r=0;r<i;r++){let i=t.__digit(r),c=e.__imul(32767&i,n),l=e.__imul(i>>>15,n),u=c+((32767&l)<<15)+s+o;o=u>>>30,s=l>>>15,a.__setDigit(r,1073741823&u)}if(a.length>i)for(a.__setDigit(i++,o+s);i<a.length;)a.__setDigit(i++,0);else if(o+s!==0)throw Error(`implementation bug`)}__inplaceMultiplyAdd(t,n,r){r>this.length&&(r=this.length);let i=32767&t,a=t>>>15,o=0,s=n;for(let t=0;t<r;t++){let n=this.__digit(t),r=32767&n,c=n>>>15,l=e.__imul(r,i),u=e.__imul(r,a),d=e.__imul(c,i),f=e.__imul(c,a),p=s+l+o;o=p>>>30,p&=1073741823,p+=((32767&u)<<15)+((32767&d)<<15),o+=p>>>30,s=f+(u>>>15)+(d>>>15),this.__setDigit(t,1073741823&p)}if(o!=0||s!==0)throw Error(`implementation bug`)}static __absoluteDivSmall(t,n,r=null){r===null&&(r=new e(t.length,!1));let i=0;for(let e,a=2*t.length-1;0<=a;a-=2){e=(i<<15|t.__halfDigit(a))>>>0;let o=0|e/n;i=0|e%n,e=(i<<15|t.__halfDigit(a-1))>>>0;let s=0|e/n;i=0|e%n,r.__setDigit(a>>>1,o<<15|s)}return r}static __absoluteModSmall(e,t){let n=0;for(let r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}static __absoluteDivLarge(t,n,r,i){let a=n.__halfDigitLength(),o=n.length,s=t.__halfDigitLength()-a,c=null;r&&(c=new e(s+2>>>1,!1),c.__initializeDigits());let l=new e(a+2>>>1,!1);l.__initializeDigits();let u=e.__clz15(n.__halfDigit(a-1));0<u&&(n=e.__specialLeftShift(n,u,0));let d=e.__specialLeftShift(t,u,1),f=n.__halfDigit(a-1),p=0;for(let t,i=s;0<=i;i--){t=32767;let s=d.__halfDigit(i+a);if(s!==f){let r=(s<<15|d.__halfDigit(i+a-1))>>>0;t=0|r/f;let o=0|r%f,c=n.__halfDigit(a-2),l=d.__halfDigit(i+a-2);for(;e.__imul(t,c)>>>0>(o<<16|l)>>>0&&(t--,o+=f,!(32767<o)););}e.__internalMultiplyAdd(n,t,0,o,l);let u=d.__inplaceSub(l,i,a+1);u!==0&&(u=d.__inplaceAdd(n,i,a),d.__setHalfDigit(i+a,32767&d.__halfDigit(i+a)+u),t--),r&&(1&i?p=t<<15:c.__setDigit(i>>>1,p|t))}if(i)return d.__inplaceRightShift(u),r?{quotient:c,remainder:d}:d;if(r)return c;throw Error(`unreachable`)}static __clz15(t){return e.__clz30(t)-15}__inplaceAdd(e,t,n){let r=0;for(let i=0;i<n;i++){let n=this.__halfDigit(t+i)+e.__halfDigit(i)+r;r=n>>>15,this.__setHalfDigit(t+i,32767&n)}return r}__inplaceSub(e,t,n){let r=0;if(1&t){t>>=1;let i=this.__digit(t),a=32767&i,o=0;for(;o<n-1>>>1;o++){let n=e.__digit(o),s=(i>>>15)-(32767&n)-r;r=1&s>>>15,this.__setDigit(t+o,(32767&s)<<15|32767&a),i=this.__digit(t+o+1),a=(32767&i)-(n>>>15)-r,r=1&a>>>15}let s=e.__digit(o),c=(i>>>15)-(32767&s)-r;if(r=1&c>>>15,this.__setDigit(t+o,(32767&c)<<15|32767&a),t+o+1>=this.length)throw RangeError(`out of bounds`);!(1&n)&&(i=this.__digit(t+o+1),a=(32767&i)-(s>>>15)-r,r=1&a>>>15,this.__setDigit(t+e.length,1073709056&i|32767&a))}else{t>>=1;let i=0;for(;i<e.length-1;i++){let n=this.__digit(t+i),a=e.__digit(i),o=(32767&n)-(32767&a)-r;r=1&o>>>15;let s=(n>>>15)-(a>>>15)-r;r=1&s>>>15,this.__setDigit(t+i,(32767&s)<<15|32767&o)}let a=this.__digit(t+i),o=e.__digit(i),s=(32767&a)-(32767&o)-r;r=1&s>>>15;let c=0;!(1&n)&&(c=(a>>>15)-(o>>>15)-r,r=1&c>>>15),this.__setDigit(t+i,(32767&c)<<15|32767&s)}return r}__inplaceRightShift(e){if(e===0)return;let t=this.__digit(0)>>>e,n=this.length-1;for(let r=0;r<n;r++){let n=this.__digit(r+1);this.__setDigit(r,1073741823&n<<30-e|t),t=n>>>e}this.__setDigit(n,t)}static __specialLeftShift(t,n,r){let i=t.length,a=new e(i+r,!1);if(n===0){for(let e=0;e<i;e++)a.__setDigit(e,t.__digit(e));return 0<r&&a.__setDigit(i,0),a}let o=0;for(let e=0;e<i;e++){let r=t.__digit(e);a.__setDigit(e,1073741823&r<<n|o),o=r>>>30-n}return 0<r&&a.__setDigit(i,o),a}static __leftShiftByAbsolute(t,n){let r=e.__toShiftAmount(n);if(0>r)throw RangeError(`BigInt too big`);let i=0|r/30,a=r%30,o=t.length,s=a!==0&&t.__digit(o-1)>>>30-a!=0,c=o+i+(s?1:0),l=new e(c,t.sign);if(a===0){let e=0;for(;e<i;e++)l.__setDigit(e,0);for(;e<c;e++)l.__setDigit(e,t.__digit(e-i))}else{let e=0;for(let e=0;e<i;e++)l.__setDigit(e,0);for(let n=0;n<o;n++){let r=t.__digit(n);l.__setDigit(n+i,1073741823&r<<a|e),e=r>>>30-a}if(s)l.__setDigit(o+i,e);else if(e!==0)throw Error(`implementation bug`)}return l.__trim()}static __rightShiftByAbsolute(t,n){let r=t.length,i=t.sign,a=e.__toShiftAmount(n);if(0>a)return e.__rightShiftByMaximum(i);let o=0|a/30,s=a%30,c=r-o;if(0>=c)return e.__rightShiftByMaximum(i);let l=!1;if(i){if(t.__digit(o)&(1<<s)-1)l=!0;else for(let e=0;e<o;e++)if(t.__digit(e)!==0){l=!0;break}}l&&s===0&&~t.__digit(r-1)==0&&c++;let u=new e(c,i);if(s===0){u.__setDigit(c-1,0);for(let e=o;e<r;e++)u.__setDigit(e-o,t.__digit(e))}else{let e=t.__digit(o)>>>s,n=r-o-1;for(let r=0;r<n;r++){let n=t.__digit(r+o+1);u.__setDigit(r,1073741823&n<<30-s|e),e=n>>>s}u.__setDigit(n,e)}return l&&(u=e.__absoluteAddOne(u,!0,u)),u.__trim()}static __rightShiftByMaximum(t){return t?e.__oneDigit(1,!0):e.__zero()}static __toShiftAmount(t){if(1<t.length)return-1;let n=t.__unsignedDigit(0);return n>e.__kMaxLengthBits?-1:n}static __toPrimitive(t,n=`default`){if(typeof t!=`object`||t.constructor===e)return t;if(typeof Symbol<`u`&&typeof Symbol.toPrimitive==`symbol`&&t[Symbol.toPrimitive]){let e=t[Symbol.toPrimitive](n);if(typeof e!=`object`)return e;throw TypeError(`Cannot convert object to primitive value`)}let r=t.valueOf;if(r){let e=r.call(t);if(typeof e!=`object`)return e}let i=t.toString;if(i){let e=i.call(t);if(typeof e!=`object`)return e}throw TypeError(`Cannot convert object to primitive value`)}static __toNumeric(t){return e.__isBigInt(t)?t:+t}static __isBigInt(t){return typeof t==`object`&&!!t&&t.constructor===e}static __truncateToNBits(t,n){let r=0|(t+29)/30,i=new e(r,n.sign),a=r-1;for(let e=0;e<a;e++)i.__setDigit(e,n.__digit(e));let o=n.__digit(a);if(t%30!=0){let e=32-t%30;o=o<<e>>>e}return i.__setDigit(a,o),i.__trim()}static __truncateAndSubFromPowerOfTwo(t,n,r){var i=Math.min;let a=0|(t+29)/30,o=new e(a,r),s=0,c=a-1,l=0;for(let e=i(c,n.length);s<e;s++){let e=0-n.__digit(s)-l;l=1&e>>>30,o.__setDigit(s,1073741823&e)}for(;s<c;s++)o.__setDigit(s,0|1073741823&-l);let u=c<n.length?n.__digit(c):0,d=t%30,f;if(d==0)f=0-u-l,f&=1073741823;else{let e=32-d;u=u<<e>>>e;let t=1<<32-e;f=t-u-l,f&=t-1}return o.__setDigit(c,f),o.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,t){this[e]=0|t}__setDigitGrow(e,t){this[e]=0|t}__halfDigitLength(){let e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,t){let n=e>>>1,r=this.__digit(n),i=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,i)}static __digitPow(e,t){let n=1;for(;0<t;)1&t&&(n*=e),t>>>=1,e*=e;return n}static __detectBigEndian(){return e.__kBitConversionDouble[0]=-0,e.__kBitConversionInts[0]!==0}static __isOneDigitInt(e){return(1073741823&e)===e}};n.__kMaxLength=33554432,n.__kMaxLengthBits=n.__kMaxLength<<5,n.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],n.__kBitsPerCharTableShift=5,n.__kBitsPerCharTableMultiplier=1<<n.__kBitsPerCharTableShift,n.__kConversionChars=`0123456789abcdefghijklmnopqrstuvwxyz`.split(``),n.__kBitConversionBuffer=new ArrayBuffer(8),n.__kBitConversionDouble=new Float64Array(n.__kBitConversionBuffer),n.__kBitConversionInts=new Int32Array(n.__kBitConversionBuffer),n.__kBitConversionIntHigh=n.__detectBigEndian()?0:1,n.__kBitConversionIntLow=n.__detectBigEndian()?1:0,n.__clz30=Math.clz32?function(e){return Math.clz32(e)-2}:function(e){return e===0?30:0|29-(0|Math.log(e>>>0)/Math.LN2)},n.__imul=Math.imul||function(e,t){return 0|e*t},t.exports=n}))(),1);const Fi=I.default.BigInt(0),Ii=I.default.BigInt(1),Li=I.default.BigInt(2),Ri=I.default.BigInt(10),zi=I.default.BigInt(24),Bi=I.default.BigInt(60),Vi=I.default.BigInt(1e3),Hi=I.default.BigInt(1e6),Ui=I.default.BigInt(1e9),Wi=I.default.multiply(I.default.BigInt(3600),Ui),Gi=I.default.multiply(Bi,Ui),Ki=I.default.multiply(Wi,zi);function qi(e){return typeof e==`bigint`?I.default.BigInt(e.toString(10)):e}function Ji(e){return I.default.equal(I.default.remainder(e,Li),Fi)}function Yi(e){return I.default.lessThan(e,Fi)?I.default.unaryMinus(e):e}function Xi(e,t){return I.default.lessThan(e,t)?-1:I.default.greaterThan(e,t)?1:0}function Zi(e,t){return{quotient:I.default.divide(e,t),remainder:I.default.remainder(e,t)}}var Qi,$i;const ea=`slot-epochNanoSeconds`,ta=`slot-iso-date`,na=`slot-iso-date-time`,ra=`slot-time`,ia=`slot-calendar`,aa=`slot-date-brand`,oa=`slot-year-month-brand`,sa=`slot-month-day-brand`,ca=`slot-time-zone`,la=`slot-years`,ua=`slot-months`,da=`slot-weeks`,fa=`slot-days`,pa=`slot-hours`,ma=`slot-minutes`,ha=`slot-seconds`,ga=`slot-milliseconds`,_a=`slot-microseconds`,va=`slot-nanoseconds`,ya=`date`,ba=`time`,xa=`datetime`,Sa=`instant`,Ca=`original`,wa=`timezone-canonical`,Ta=`timezone-original`,Ea=`calendar-id`,Da=`locale`,Oa=`options`,ka=new WeakMap,Aa=Symbol.for(`@@Temporal__GetSlots`);(Qi=globalThis)[Aa]||(Qi[Aa]=function(e){return ka.get(e)});const ja=globalThis[Aa],Ma=Symbol.for(`@@Temporal__CreateSlots`);($i=globalThis)[Ma]||($i[Ma]=function(e){ka.set(e,Object.create(null))});const Na=globalThis[Ma];function Pa(e,...t){if(!e||typeof e!=`object`)return!1;let n=ja(e);return!!n&&t.every((e=>e in n))}function L(e,t){let n=ja(e)?.[t];if(n===void 0)throw TypeError(`Missing internal slot ${t}`);return n}function Fa(e,t,n){let r=ja(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t])throw TypeError(`${t} already has set`);r[t]=n}const Ia={};function La(e,t){Object.defineProperty(e.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let n=Object.getOwnPropertyNames(e);for(let t=0;t<n.length;t++){let r=n[t],i=Object.getOwnPropertyDescriptor(e,r);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e,r,i))}let r=Object.getOwnPropertyNames(e.prototype);for(let t=0;t<r.length;t++){let n=r[t],i=Object.getOwnPropertyDescriptor(e.prototype,n);i.configurable&&i.enumerable&&(i.enumerable=!1,Object.defineProperty(e.prototype,n,i))}Ra(t,e),Ra(`${t}.prototype`,e.prototype)}function Ra(e,t){let n=`%${e}%`;if(Ia[n]!==void 0)throw Error(`intrinsic ${e} already exists`);Ia[n]=t}function za(e){return Ia[e]}function Ba(e,t){let n=e;if(n===0)return{div:n,mod:n};let r=Math.sign(n);n=Math.abs(n);let i=Math.trunc(1+Math.log10(n));if(t>=i)return{div:0*r,mod:r*n};if(t===0)return{div:r*n,mod:0*r};let a=n.toPrecision(i);return{div:r*Number.parseInt(a.slice(0,i-t),10),mod:r*Number.parseInt(a.slice(i-t),10)}}function Va(e,t,n){let r=e,i=n;if(r===0)return i;let a=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let o=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return a*Number.parseInt(o+`0`.repeat(t),10);let s=o+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,`0`);return a*Number.parseInt(s,10)}function Ha(e,t){let n=t===`negative`;switch(e){case`ceil`:return n?`zero`:`infinity`;case`floor`:return n?`infinity`:`zero`;case`expand`:return`infinity`;case`trunc`:return`zero`;case`halfCeil`:return n?`half-zero`:`half-infinity`;case`halfFloor`:return n?`half-infinity`:`half-zero`;case`halfExpand`:return`half-infinity`;case`halfTrunc`:return`half-zero`;case`halfEven`:return`half-even`}}function Ua(e,t,n,r,i){return i===`zero`?e:i===`infinity`?t:n<0?e:n>0?t:i===`half-zero`?e:i===`half-infinity`?t:r?e:t}var Wa=class e{constructor(e){this.totalNs=qi(e),this.sec=I.default.toNumber(I.default.divide(this.totalNs,Ui)),this.subsec=I.default.toNumber(I.default.remainder(this.totalNs,Ui))}static validateNew(t,n){if(I.default.greaterThan(Yi(t),e.MAX))throw RangeError(`${n} of duration time units cannot exceed ${e.MAX} s`);return new e(t)}static fromEpochNsDiff(t,n){return new e(I.default.subtract(qi(t),qi(n)))}static fromComponents(t,n,r,i,a,o){let s=I.default.add(I.default.add(I.default.add(I.default.add(I.default.add(I.default.BigInt(o),I.default.multiply(I.default.BigInt(a),Vi)),I.default.multiply(I.default.BigInt(i),Hi)),I.default.multiply(I.default.BigInt(r),Ui)),I.default.multiply(I.default.BigInt(n),Gi)),I.default.multiply(I.default.BigInt(t),Wi));return e.validateNew(s,`total`)}abs(){return new e(Yi(this.totalNs))}add(t){return e.validateNew(I.default.add(this.totalNs,t.totalNs),`sum`)}add24HourDays(t){return e.validateNew(I.default.add(this.totalNs,I.default.multiply(I.default.BigInt(t),Ki)),`sum`)}addToEpochNs(e){return I.default.add(qi(e),this.totalNs)}cmp(e){return Xi(this.totalNs,e.totalNs)}divmod(t){let{quotient:n,remainder:r}=Zi(this.totalNs,I.default.BigInt(t));return{quotient:I.default.toNumber(n),remainder:new e(r)}}fdiv(e){let t=qi(e),n=I.default.BigInt(t),{quotient:r,remainder:i}=Zi(this.totalNs,n),a=[],o,s=(I.default.lessThan(this.totalNs,Fi)?-1:1)*Math.sign(I.default.toNumber(t));for(;!I.default.equal(i,Fi)&&a.length<50;)i=I.default.multiply(i,Ri),{quotient:o,remainder:i}=Zi(i,n),a.push(Math.abs(I.default.toNumber(o)));return s*Number(Yi(r).toString()+`.`+a.join(``))}isZero(){return I.default.equal(this.totalNs,Fi)}round(t,n){let r=qi(t);if(I.default.equal(r,Ii))return this;let{quotient:i,remainder:a}=Zi(this.totalNs,r),o=I.default.lessThan(this.totalNs,Fi)?`negative`:`positive`,s=I.default.multiply(Yi(i),r),c=I.default.add(s,r),l=Xi(Yi(I.default.multiply(a,Li)),r),u=Ha(n,o),d=I.default.equal(Yi(this.totalNs),s)?s:Ua(s,c,l,Ji(i),u),f=o===`positive`?d:I.default.unaryMinus(d);return e.validateNew(f,`rounding`)}sign(){return this.cmp(new e(Fi))}subtract(t){return e.validateNew(I.default.subtract(this.totalNs,t.totalNs),`difference`)}};Wa.MAX=I.default.BigInt(`9007199254740991999999999`),Wa.ZERO=new Wa(Fi);const Ga=/[A-Za-z._][A-Za-z._0-9+-]*/,Ka=RegExp(`(?:(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)|(?:${Ga.source})(?:\\/(?:${Ga.source}))*)`),qa=/(?:[+-]\d{6}|\d{4})/,Ja=/(?:0[1-9]|1[0-2])/,Ya=/(?:0[1-9]|[12]\d|3[01])/,Xa=RegExp(`(${qa.source})(?:-(${Ja.source})-(${Ya.source})|(${Ja.source})(${Ya.source}))`),Za=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Qa=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,$a=RegExp(`([zZ])|${Qa.source}?`),eo=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,to=new RegExp([`^${Xa.source}`,`(?:(?:[tT]|\\s+)${Za.source}(?:${$a.source})?)?`,`(?:\\[!?(${Ka.source})\\])?`,`((?:${eo.source})*)$`].join(``)),no=new RegExp([`^[tT]?${Za.source}`,`(?:${$a.source})?`,`(?:\\[!?${Ka.source}\\])?`,`((?:${eo.source})*)$`].join(``)),ro=RegExp(`^(${qa.source})-?(${Ja.source})(?:\\[!?${Ka.source}\\])?((?:${eo.source})*)$`),io=RegExp(`^(?:--)?(${Ja.source})-?(${Ya.source})(?:\\[!?${Ka.source}\\])?((?:${eo.source})*)$`),ao=/(\d+)(?:[.,](\d{1,9}))?/,oo=RegExp(`(?:${ao.source}H)?(?:${ao.source}M)?(?:${ao.source}S)?`),so=RegExp(`^([+-])?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?!$)${oo.source})?$`,`i`),co=864e5,lo=1e6*co,uo=1e8*co,fo=Ql(uo),po=I.default.unaryMinus(fo),mo=I.default.add(I.default.subtract(po,Ki),Ii),ho=I.default.subtract(I.default.add(fo,Ki),Ii);146097*co;const go=-271821,_o=275760,vo=Date.UTC(1847,0,1),yo=[`iso8601`,`hebrew`,`islamic`,`islamic-umalqura`,`islamic-tbla`,`islamic-civil`,`islamic-rgsa`,`islamicc`,`persian`,`ethiopic`,`ethioaa`,`ethiopic-amete-alem`,`coptic`,`chinese`,`dangi`,`roc`,`indian`,`buddhist`,`japanese`,`gregory`],bo=new Set([`ACT`,`AET`,`AGT`,`ART`,`AST`,`BET`,`BST`,`CAT`,`CNT`,`CST`,`CTT`,`EAT`,`ECT`,`IET`,`IST`,`JST`,`MIT`,`NET`,`NST`,`PLT`,`PNT`,`PRT`,`PST`,`SST`,`VST`]);function xo(e){return typeof e==`object`&&!!e||typeof e==`function`}function So(e){if(typeof e==`bigint`)throw TypeError(`Cannot convert BigInt to number`);return Number(e)}function Co(e){if(typeof e==`symbol`)throw TypeError(`Cannot convert a Symbol value to a String`);return String(e)}function wo(e){let t=So(e);if(t===0)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw RangeError(`invalid number value`);let n=Math.trunc(t);return n===0?0:n}function To(e,t){let n=wo(e);if(n<=0)throw t===void 0?RangeError(`Cannot convert a number less than one to a positive integer`):RangeError(`property '${t}' cannot be a a number less than one`);return n}function Eo(e){let t=So(e);if(Number.isNaN(t))throw RangeError(`not a number`);if(t===1/0||t===-1/0)throw RangeError(`infinity is out of range`);if(!function(e){if(typeof e!=`number`||Number.isNaN(e)||e===1/0||e===-1/0)return!1;let t=Math.abs(e);return Math.floor(t)===t}(t))throw RangeError(`unsupported fractional value ${e}`);return t===0?0:t}function Do(e,t){return String(e).padStart(t,`0`)}function Oo(e){if(typeof e!=`string`)throw TypeError(`expected a string, not ${String(e)}`);return e}function ko(e,t){if(xo(e)){let t=e?.toString();if(typeof t==`string`||typeof t==`number`)return t;throw TypeError(`Cannot convert object to primitive value`)}return e}const Ao=[`era`,`eraYear`,`year`,`month`,`monthCode`,`day`,`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],jo={era:Co,eraYear:wo,year:wo,month:To,monthCode:function(e){let t=Oo(ko(e));if(t.length<3||t.length>4||t[0]!==`M`||`0123456789`.indexOf(t[1])===-1||`0123456789`.indexOf(t[2])===-1||t[1]+t[2]===`00`&&t[3]!==`L`||t[3]!==`L`&&t[3]!==void 0)throw RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:To,hour:wo,minute:wo,second:wo,millisecond:wo,microsecond:wo,nanosecond:wo,offset:function(e){let t=Oo(ko(e));return jc(t),t},timeZone:fc},Mo={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},No=[[`years`,`year`,`date`],[`months`,`month`,`date`],[`weeks`,`week`,`date`],[`days`,`day`,`date`],[`hours`,`hour`,`time`],[`minutes`,`minute`,`time`],[`seconds`,`second`,`time`],[`milliseconds`,`millisecond`,`time`],[`microseconds`,`microsecond`,`time`],[`nanoseconds`,`nanosecond`,`time`]],Po=Object.fromEntries(No.map((e=>[e[0],e[1]]))),Fo=Object.fromEntries(No.map((([e,t])=>[t,e]))),Io=No.map((([,e])=>e)),Lo={day:lo,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},Ro=[`days`,`hours`,`microseconds`,`milliseconds`,`minutes`,`months`,`nanoseconds`,`seconds`,`weeks`,`years`],zo=Intl.DateTimeFormat,Bo=new Map;function Vo(e){let t=su(e),n=Bo.get(t);return n===void 0&&(n=new zo(`en-us`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),Bo.set(t,n)),n}function Ho(e){return Pa(e,ea)&&!Pa(e,ca,ia)}function Uo(e){return Pa(e,la,ua,fa,pa,ma,ha,ga,_a,va)}function Wo(e){return Pa(e,aa)}function Go(e){return Pa(e,ra)}function Ko(e){return Pa(e,na)}function qo(e){return Pa(e,oa)}function Jo(e){return Pa(e,sa)}function Yo(e){return Pa(e,ea,ca,ia)}function R(e,t){if(!t(e))throw TypeError(`invalid receiver: method called with the wrong type of this-object`)}function Xo(e){if(Pa(e,ia)||Pa(e,ca))throw TypeError(`with() does not support a calendar or timeZone property`);if(Go(e))throw TypeError(`with() does not accept Temporal.PlainTime, use withPlainTime() instead`);if(e.calendar!==void 0)throw TypeError(`with() does not support a calendar property`);if(e.timeZone!==void 0)throw TypeError(`with() does not support a timeZone property`)}function Zo(e,t){return t===`never`||t===`auto`&&e===`iso8601`?``:`[${t===`critical`?`!`:``}u-ca=${e}]`}function Qo(e){let t,n,r=!1;for(eo.lastIndex=0;n=eo.exec(e);){let{1:i,2:a,3:o}=n;if(a===`u-ca`){if(t===void 0)t=o,r=i===`!`;else if(i===`!`||r)throw RangeError(`Invalid annotations in ${e}: more than one u-ca present with critical flag`)}else if(i===`!`)throw RangeError(`Unrecognized annotation: !${a}=${o}`)}return t}function $o(e){let t=to.exec(e);if(!t)throw RangeError(`invalid RFC 9557 string: ${e}`);let n=Qo(t[16]),r=t[1];if(r===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);let i=+r,a=+(t[2]??t[4]??1),o=+(t[3]??t[5]??1),s=t[6]!==void 0,c=+(t[6]??0),l=+(t[7]??t[10]??0),u=+(t[8]??t[11]??0);u===60&&(u=59);let d=(t[9]??t[12]??``)+`000000000`,f=+d.slice(0,3),p=+d.slice(3,6),m=+d.slice(6,9),h,g=!1;t[13]?(h=void 0,g=!0):t[14]&&(h=t[14]);let _=t[15];return al(i,a,o,c,l,u,f,p,m),{year:i,month:a,day:o,time:s?{hour:c,minute:l,second:u,millisecond:f,microsecond:p,nanosecond:m}:`start-of-day`,tzAnnotation:_,offset:h,z:g,calendar:n}}function es(e){let t=no.exec(e),n,r,i,a,o,s,c;if(t){c=Qo(t[10]),n=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let e=(t[4]??t[7]??``)+`000000000`;if(a=+e.slice(0,3),o=+e.slice(3,6),s=+e.slice(6,9),t[8])throw RangeError(`Z designator not supported for PlainTime`)}else{let t,l;if({time:t,z:l,calendar:c}=$o(e),t===`start-of-day`)throw RangeError(`time is missing in string: ${e}`);if(l)throw RangeError(`Z designator not supported for PlainTime`);({hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s}=t)}if(il(n,r,i,a,o,s),/[tT ][0-9][0-9]/.test(e))return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c};try{let{month:t,day:n}=ns(e);nl(1972,t,n)}catch{try{let{year:t,month:n}=ts(e);nl(t,n,1)}catch{return{hour:n,minute:r,second:i,millisecond:a,microsecond:o,nanosecond:s,calendar:c}}}throw RangeError(`invalid RFC 9557 time-only string ${e}; may need a T prefix`)}function ts(e){let t=ro.exec(e),n,r,i,a;if(t){i=Qo(t[3]);let o=t[1];if(o===`-000000`)throw RangeError(`invalid RFC 9557 string: ${e}`);if(n=+o,r=+t[2],a=1,i!==void 0&&i!==`iso8601`)throw RangeError(`YYYY-MM format is only valid with iso8601 calendar`)}else{let t;if({year:n,month:r,calendar:i,day:a,z:t}=$o(e),t)throw RangeError(`Z designator not supported for PlainYearMonth`)}return{year:n,month:r,calendar:i,referenceISODay:a}}function ns(e){let t=io.exec(e),n,r,i,a;if(t){if(i=Qo(t[3]),n=+t[1],r=+t[2],i!==void 0&&i!==`iso8601`)throw RangeError(`MM-DD format is only valid with iso8601 calendar`)}else{let t;if({month:n,day:r,calendar:i,year:a,z:t}=$o(e),t)throw RangeError(`Z designator not supported for PlainMonthDay`)}return{month:n,day:r,calendar:i,referenceISOYear:a}}const rs=RegExp(`^${Ka.source}$`,`i`),is=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?$`);function as(e){let t=dee.test(e)?`Seconds not allowed in offset time zone`:`Invalid time zone`;throw RangeError(`${t}: ${e}`)}function os(e){return rs.test(e)||as(e),is.test(e)?{offsetMinutes:jc(e)/6e10}:{tzName:e}}function ss(e,t,n,r){let i=e,a=t,o=n;switch(r){case`reject`:nl(i,a,o);break;case`constrain`:({year:i,month:a,day:o}=el(i,a,o))}return{year:i,month:a,day:o}}function cs(e,t,n,r,i,a,o){let s=e,c=t,l=n,u=r,d=i,f=a;switch(o){case`reject`:il(s,c,l,u,d,f);break;case`constrain`:s=$c(s,0,23),c=$c(c,0,59),l=$c(l,0,59),u=$c(u,0,999),d=$c(d,0,999),f=$c(f,0,999)}return{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function ls(e){if(!xo(e))throw TypeError(`invalid duration-like`);let t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0},n=!1;for(let r=0;r<Ro.length;r++){let i=Ro[r],a=e[i];a!==void 0&&(n=!0,t[i]=Eo(a))}if(!n)throw TypeError(`invalid duration-like`);return t}function us({years:e,months:t,weeks:n,days:r},i,a,o){return{years:e,months:o??t,weeks:a??n,days:i??r}}function ds(e,t){return{isoDate:e,time:t}}function fs(e){return au(e,`overflow`,[`constrain`,`reject`],`constrain`)}function ps(e){return au(e,`disambiguation`,[`compatible`,`earlier`,`later`,`reject`],`compatible`)}function ms(e,t){return au(e,`roundingMode`,[`ceil`,`floor`,`expand`,`trunc`,`halfCeil`,`halfFloor`,`halfExpand`,`halfTrunc`,`halfEven`],t)}function hs(e,t){return au(e,`offset`,[`prefer`,`use`,`ignore`,`reject`],t)}function gs(e){return au(e,`calendarName`,[`auto`,`always`,`never`,`critical`],`auto`)}function _s(e){let t=e.roundingIncrement;if(t===void 0)return 1;let n=wo(t);if(n<1||n>1e9)throw RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return n}function vs(e,t,n){let r=n?t:t-1;if(e>r)throw RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${e}`);if(t%e!=0)throw RangeError(`Rounding increment must divide evenly into ${t}`)}function ys(e){let t=e.fractionalSecondDigits;if(t===void 0)return`auto`;if(typeof t!=`number`){if(Co(t)!==`auto`)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return`auto`}let n=Math.floor(t);if(!Number.isFinite(n)||n<0||n>9)throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return n}function bs(e,t){switch(e){case`minute`:return{precision:`minute`,unit:`minute`,increment:1};case`second`:return{precision:0,unit:`second`,increment:1};case`millisecond`:return{precision:3,unit:`millisecond`,increment:1};case`microsecond`:return{precision:6,unit:`microsecond`,increment:1};case`nanosecond`:return{precision:9,unit:`nanosecond`,increment:1}}switch(t){case`auto`:return{precision:t,unit:`nanosecond`,increment:1};case 0:return{precision:t,unit:`second`,increment:1};case 1:case 2:case 3:return{precision:t,unit:`millisecond`,increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:`microsecond`,increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:`nanosecond`,increment:10**(9-t)};default:throw RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}const xs=Symbol(`~required~`);function Ss(e,t,n,r,i=[]){let a=[];for(let e=0;e<No.length;e++){let t=No[e],r=t[1],i=t[2];n!==`datetime`&&n!==i||a.push(r)}a=a.concat(i);let o=r;o===xs?o=void 0:o!==void 0&&a.push(o);let s=[];s=s.concat(a);for(let e=0;e<a.length;e++){let t=Fo[a[e]];t!==void 0&&s.push(t)}let c=au(e,t,s,o);if(c===void 0&&r===xs)throw RangeError(`${t} is required`);return c&&c in Po?Po[c]:c}function Cs(e){let t=e.relativeTo;if(t===void 0)return{};let n,r,i,a,o,s=`option`,c=!1;if(xo(t)){if(Yo(t))return{zonedRelativeTo:t};if(Wo(t))return{plainRelativeTo:t};if(Ko(t))return{plainRelativeTo:Gs(L(t,na).isoDate,L(t,ia))};i=sc(t);let e=js(i,t,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[]);({isoDate:n,time:r}=Ps(i,e,`constrain`)),{offset:o,timeZone:a}=e,o===void 0&&(s=`wall`)}else{let e,l,u,d,f;if({year:u,month:d,day:f,time:r,calendar:i,tzAnnotation:e,offset:o,z:l}=$o(Oo(t)),e)a=fc(e),l?s=`exact`:o||(s=`wall`),c=!0;else if(l)throw RangeError(`Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone`);i||=`iso8601`,i=ou(i),n={year:u,month:d,day:f}}return a===void 0?{plainRelativeTo:Gs(n,i)}:{zonedRelativeTo:nc(Hs(n,r,s,s===`option`?jc(o):0,a,`compatible`,`reject`,c),a,i)}}function ws(e){return L(e,la)===0?L(e,ua)===0?L(e,da)===0?L(e,fa)===0?L(e,pa)===0?L(e,ma)===0?L(e,ha)===0?L(e,ga)===0?L(e,_a)===0?`nanosecond`:`microsecond`:`millisecond`:`second`:`minute`:`hour`:`day`:`week`:`month`:`year`}function Ts(e,t){return Io.indexOf(e)>Io.indexOf(t)?t:e}function Es(e){return e===`year`||e===`month`||e===`week`}function Ds(e){return Es(e)||e===`day`?`date`:`time`}function Os(e){return za(`%calendarImpl%`)(e)}function ks(e){return za(`%calendarImpl%`)(L(e,ia))}function As(e,t,n=`date`){let r=Object.create(null),i=Os(e).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,n!==`month-day`&&n!==`date`||(r.day=i.day),n!==`year-month`&&n!==`date`||(r.year=i.year),r}function js(e,t,n,r,i){let a=Os(e).extraFields(n),o=n.concat(r,a),s=Object.create(null),c=!1;o.sort();for(let e=0;e<o.length;e++){let n=o[e],r=t[n];if(r!==void 0)c=!0,s[n]=(0,jo[n])(r);else if(i!==`partial`){if(i.includes(n))throw TypeError(`required property '${n}' missing or undefined`);s[n]=Mo[n]}}if(i===`partial`&&!c)throw TypeError(`no supported properties found`);return s}function Ms(e,t=`complete`){let n=[`hour`,`microsecond`,`millisecond`,`minute`,`nanosecond`,`second`],r=!1,i=Object.create(null);for(let a=0;a<n.length;a++){let o=n[a],s=e[o];s===void 0?t===`complete`&&(i[o]=0):(i[o]=wo(s),r=!0)}if(!r)throw TypeError(`invalid time-like`);return i}function Ns(e,t){if(xo(e)){if(Wo(e))return fs(ru(t)),Gs(L(e,ta),L(e,ia));if(Yo(e)){let n=gc(L(e,ca),L(e,ea));return fs(ru(t)),Gs(n.isoDate,L(e,ia))}if(Ko(e))return fs(ru(t)),Gs(L(e,na).isoDate,L(e,ia));let n=sc(e);return Gs(lc(n,js(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),fs(ru(t))),n)}let{year:n,month:r,day:i,calendar:a,z:o}=$o(Oo(e));if(o)throw RangeError(`Z designator not supported for PlainDate`);return a||=`iso8601`,a=ou(a),fs(ru(t)),Gs({year:n,month:r,day:i},a)}function Ps(e,t,n){return ds(lc(e,t,n),cs(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,n))}function Fs(e,t){let n,r,i;if(xo(e)){if(Ko(e))return fs(ru(t)),qs(L(e,na),L(e,ia));if(Yo(e)){let n=gc(L(e,ca),L(e,ea));return fs(ru(t)),qs(n,L(e,ia))}if(Wo(e))return fs(ru(t)),qs(ds(L(e,ta),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),L(e,ia));i=sc(e);let a=js(i,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],[]),o=fs(ru(t));({isoDate:n,time:r}=Ps(i,a,o))}else{let a,o,s,c;if({year:o,month:s,day:c,time:r,calendar:i,z:a}=$o(Oo(e)),a)throw RangeError(`Z designator not supported for PlainDateTime`);r===`start-of-day`&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),al(o,s,c,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||=`iso8601`,i=ou(i),fs(ru(t)),n={year:o,month:s,day:c}}return qs(ds(n,r),i)}function Is(e){let t=za(`%Temporal.Duration%`);if(Uo(e))return new t(L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va));if(!xo(e))return function(e){let{years:t,months:n,weeks:r,days:i,hours:a,minutes:o,seconds:s,milliseconds:c,microseconds:l,nanoseconds:u}=function(e){let t=so.exec(e);if(!t||t.every(((e,t)=>t<2||e===void 0)))throw RangeError(`invalid duration: ${e}`);let n=t[1]===`-`?-1:1,r=t[2]===void 0?0:wo(t[2])*n,i=t[3]===void 0?0:wo(t[3])*n,a=t[4]===void 0?0:wo(t[4])*n,o=t[5]===void 0?0:wo(t[5])*n,s=t[6]===void 0?0:wo(t[6])*n,c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=0,m=0,h=0;if(c!==void 0){if(l??u??d??f)throw RangeError(`only the smallest unit can be fractional`);h=3600*wo((c+`000000000`).slice(0,9))*n}else if(p=l===void 0?0:wo(l)*n,u!==void 0){if(d??f)throw RangeError(`only the smallest unit can be fractional`);h=60*wo((u+`000000000`).slice(0,9))*n}else m=d===void 0?0:wo(d)*n,f!==void 0&&(h=wo((f+`000000000`).slice(0,9))*n);let g=h%1e3,_=Math.trunc(h/1e3)%1e3,v=Math.trunc(h/1e6)%1e3;return m+=Math.trunc(h/1e9)%60,p+=Math.trunc(h/6e10),ul(r,i,a,o,s,p,m,v,_,g),{years:r,months:i,weeks:a,days:o,hours:s,minutes:p,seconds:m,milliseconds:v,microseconds:_,nanoseconds:g}}(e);return new(za(`%Temporal.Duration%`))(t,n,r,i,a,o,s,c,l,u)}(Oo(e));let n={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=ls(e);for(let e=0;e<Ro.length;e++){let t=Ro[e],i=r[t];i!==void 0&&(n[t]=i)}return new t(n.years,n.months,n.weeks,n.days,n.hours,n.minutes,n.seconds,n.milliseconds,n.microseconds,n.nanoseconds)}function Ls(e){let t;if(xo(e)){if(Ho(e)||Yo(e))return tc(L(e,ea));t=ko(e)}else t=e;let{year:n,month:r,day:i,time:a,offset:o,z:s}=function(e){let t=$o(e);if(!t.z&&!t.offset)throw RangeError(`Temporal.Instant requires a time zone offset`);return t}(Oo(t)),{hour:c=0,minute:l=0,second:u=0,millisecond:d=0,microsecond:f=0,nanosecond:p=0}=a===`start-of-day`?{}:a,m=Yc(n,r,i,c,l,u,d,f,p-(s?0:jc(o)));return _l(m.isoDate),tc(Rc(m))}function Rs(e,t){if(xo(e)){if(Jo(e))return fs(ru(t)),Ys(L(e,ta),L(e,ia));let n;return Pa(e,ia)?n=L(e,ia):(n=e.calendar,n===void 0&&(n=`iso8601`),n=oc(n)),Ys(dc(n,js(n,e,[`year`,`month`,`monthCode`,`day`],[],[]),fs(ru(t))),n)}let{month:n,day:r,referenceISOYear:i,calendar:a}=ns(Oo(e));if(a===void 0&&(a=`iso8601`),a=ou(a),fs(ru(t)),a===`iso8601`)return Ys({year:1972,month:n,day:r},a);let o={year:i,month:n,day:r};return rl(o),o=dc(a,As(a,o,`month-day`),`constrain`),Ys(o,a)}function zs(e,t){let n;if(xo(e)){if(Go(e))return fs(ru(t)),Zs(L(e,ra));if(Ko(e))return fs(ru(t)),Zs(L(e,na).time);if(Yo(e)){let n=gc(L(e,ca),L(e,ea));return fs(ru(t)),Zs(n.time)}let{hour:r,minute:i,second:a,millisecond:o,microsecond:s,nanosecond:c}=Ms(e);n=cs(r,i,a,o,s,c,fs(ru(t)))}else n=es(Oo(e)),fs(ru(t));return Zs(n)}function Bs(e){return e===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:L(zs(e),ra)}function Vs(e,t){if(xo(e)){if(qo(e))return fs(ru(t)),$s(L(e,ta),L(e,ia));let n=sc(e);return $s(uc(n,js(n,e,[`year`,`month`,`monthCode`],[],[]),fs(ru(t))),n)}let{year:n,month:r,referenceISODay:i,calendar:a}=ts(Oo(e));a===void 0&&(a=`iso8601`),a=ou(a),fs(ru(t));let o={year:n,month:r,day:i};return ll(o),o=uc(a,As(a,o,`year-month`),`constrain`),$s(o,a)}function Hs(e,t,n,r,i,a,o,s){if(t===`start-of-day`)return bc(i,e);let c=ds(e,t);if(n===`wall`||o===`ignore`)return _c(i,c,a);if(n===`exact`||o===`use`){let n=Yc(e.year,e.month,e.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);_l(n.isoDate);let i=Rc(n);return cl(i),i}_l(e);let l=Rc(c),u=yc(i,c);for(let e=0;e<u.length;e++){let t=u[e],n=I.default.toNumber(I.default.subtract(l,t)),i=Hl(n,6e10,`halfExpand`);if(n===r||s&&i===r)return t}if(o===`reject`){let e=hc(r),t=kc(c,`iso8601`,`auto`);throw RangeError(`Offset ${e} is invalid for ${t} in ${i}`)}return vc(u,i,c,a)}function Us(e,t){let n,r,i,a,o,s,c,l=!1,u=`option`;if(xo(e)){if(Yo(e)){let n=ru(t);return ps(n),hs(n,`reject`),fs(n),nc(L(e,ea),L(e,ca),L(e,ia))}o=sc(e);let l=js(o,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`,`timeZone`],[`timeZone`]);({offset:a,timeZone:i}=l),a===void 0&&(u=`wall`);let d=ru(t);s=ps(d),c=hs(d,`reject`);let f=fs(d);({isoDate:n,time:r}=Ps(o,l,f))}else{let d,f,p,m,h;({year:p,month:m,day:h,time:r,tzAnnotation:d,offset:a,z:f,calendar:o}=function(e){let t=$o(e);if(!t.tzAnnotation)throw RangeError(`Temporal.ZonedDateTime requires a time zone ID in brackets`);return t}(Oo(e))),i=fc(d),f?u=`exact`:a||(u=`wall`),o||=`iso8601`,o=ou(o),l=!0;let g=ru(t);s=ps(g),c=hs(g,`reject`),fs(g),n={year:p,month:m,day:h}}let d=0;return u===`option`&&(d=jc(a)),nc(Hs(n,r,u,d,i,s,c,l),i,o)}function Ws(e,t,n){rl(t),Na(e),Fa(e,ta,t),Fa(e,ia,n),Fa(e,aa,!0)}function Gs(e,t){let n=za(`%Temporal.PlainDate%`),r=Object.create(n.prototype);return Ws(r,e,t),r}function Ks(e,t,n){ol(t),Na(e),Fa(e,na,t),Fa(e,ia,n)}function qs(e,t){let n=za(`%Temporal.PlainDateTime%`),r=Object.create(n.prototype);return Ks(r,e,t),r}function Js(e,t,n){rl(t),Na(e),Fa(e,ta,t),Fa(e,ia,n),Fa(e,sa,!0)}function Ys(e,t){let n=za(`%Temporal.PlainMonthDay%`),r=Object.create(n.prototype);return Js(r,e,t),r}function Xs(e,t){Na(e),Fa(e,ra,t)}function Zs(e){let t=za(`%Temporal.PlainTime%`),n=Object.create(t.prototype);return Xs(n,e),n}function Qs(e,t,n){ll(t),Na(e),Fa(e,ta,t),Fa(e,ia,n),Fa(e,oa,!0)}function $s(e,t){let n=za(`%Temporal.PlainYearMonth%`),r=Object.create(n.prototype);return Qs(r,e,t),r}function ec(e,t){cl(t),Na(e),Fa(e,ea,t)}function tc(e){let t=za(`%Temporal.Instant%`),n=Object.create(t.prototype);return ec(n,e),n}function eee(e,t,n,r){cl(t),Na(e),Fa(e,ea,t),Fa(e,ca,n),Fa(e,ia,r)}function nc(e,t,n=`iso8601`){let r=za(`%Temporal.ZonedDateTime%`),i=Object.create(r.prototype);return eee(i,e,t,n),i}function tee(e){return Ao.filter((t=>e[t]!==void 0))}function rc(e,t,n){let r=tee(n),i=Os(e).fieldKeysToIgnore(r),a=Object.create(null),o=tee(t);for(let e=0;e<Ao.length;e++){let s,c=Ao[e];o.includes(c)&&!i.includes(c)&&(s=t[c]),r.includes(c)&&(s=n[c]),s!==void 0&&(a[c]=s)}return a}function ic(e,t,n,r){let i=Os(e).dateAdd(t,n,r);return rl(i),i}function ac(e,t,n,r){return Os(e).dateUntil(t,n,r)}function oc(e){if(xo(e)&&Pa(e,ia))return L(e,ia);let t=Oo(e);try{return ou(t)}catch{}let n;try{({calendar:n}=$o(t))}catch{try{({calendar:n}=es(t))}catch{try{({calendar:n}=ts(t))}catch{({calendar:n}=ns(t))}}}return n||=`iso8601`,ou(n)}function sc(e){if(Pa(e,ia))return L(e,ia);let{calendar:t}=e;return t===void 0?`iso8601`:oc(t)}function cc(e,t){return ou(e)===ou(t)}function lc(e,t,n){let r=Os(e);r.resolveFields(t,`date`);let i=r.dateToISO(t,n);return rl(i),i}function uc(e,t,n){let r=Os(e);r.resolveFields(t,`year-month`),t.day=1;let i=r.dateToISO(t,n);return ll(i),i}function dc(e,t,n){let r=Os(e);r.resolveFields(t,`month-day`);let i=r.monthDayToISOReferenceDate(t,n);return rl(i),i}function fc(e){if(xo(e)&&Yo(e))return L(e,ca);let t=Oo(e);if(t===`UTC`)return`UTC`;let{tzName:n,offsetMinutes:r}=function(e){let{tzAnnotation:t,offset:n,z:r}=function(e){if(rs.test(e))return{tzAnnotation:e,offset:void 0,z:!1};try{let{tzAnnotation:t,offset:n,z:r}=$o(e);if(r||t||n)return{tzAnnotation:t,offset:n,z:r}}catch{}as(e)}(e);return t?os(t):r?os(`UTC`):n?os(n):void 0}(t);if(r!==void 0)return Ic(r);let i=Nc(n);if(!i)throw RangeError(`Unrecognized time zone ${n}`);return i.identifier}function pc(e,t){if(e===t)return!0;let n=os(e).offsetMinutes,r=os(t).offsetMinutes;if(n===void 0&&r===void 0){let n=Nc(t);if(!n)return!1;let r=Nc(e);return!!r&&r.primaryIdentifier===n.primaryIdentifier}return n===r}function mc(e,t){let n=os(e).offsetMinutes;return n===void 0?Fc(e,t):6e10*n}function hc(e){let t=e<0?`-`:`+`,n=Math.abs(e),r=Math.floor(n/36e11),i=Math.floor(n/6e10)%60,a=Math.floor(n/1e9)%60,o=n%1e9;return`${t}${wc(r,i,a,o,a===0&&o===0?`minute`:`auto`)}`}function gc(e,t){let n=mc(e,t),{isoDate:{year:r,month:i,day:a},time:{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d}}=see(t);return Yc(r,i,a,o,s,c,l,u,d+n)}function _c(e,t,n){return vc(yc(e,t),e,t,n)}function vc(e,t,n,r){let i=e.length;if(i===1)return e[0];if(i)switch(r){case`compatible`:case`earlier`:return e[0];case`later`:return e[i-1];case`reject`:throw RangeError(`multiple instants found`)}if(r===`reject`)throw RangeError(`multiple instants found`);let a=Rc(n),o=I.default.subtract(a,Ki);cl(o);let s=mc(t,o),c=I.default.add(a,Ki);cl(c);let l=mc(t,c)-s;switch(r){case`earlier`:{let e=Wa.fromComponents(0,0,0,0,0,-l),r=Pl(n.time,e);return yc(t,ds(Jc(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r))[0]}case`compatible`:case`later`:{let e=Wa.fromComponents(0,0,0,0,0,l),r=Pl(n.time,e),i=yc(t,ds(Jc(n.isoDate.year,n.isoDate.month,n.isoDate.day+r.deltaDays),r));return i[i.length-1]}}}function yc(e,t){if(e===`UTC`)return _l(t.isoDate),[Rc(t)];let n=os(e).offsetMinutes;if(n!==void 0){let e=Yc(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-n,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);_l(e.isoDate);let r=Rc(e);return cl(r),[r]}return _l(t.isoDate),function(e,t){let n=Rc(t),r=I.default.subtract(n,Ki);I.default.lessThan(r,po)&&(r=n);let i=I.default.add(n,Ki);I.default.greaterThan(i,fo)&&(i=n);let a=Fc(e,r),o=Fc(e,i);return(a===o?[a]:[a,o]).map((r=>{let i=I.default.subtract(n,I.default.BigInt(r));if(Xl(t,function(e,t){let{epochMilliseconds:n,time:{millisecond:r,microsecond:i,nanosecond:a}}=see(t),{year:o,month:s,day:c,hour:l,minute:u,second:d}=Vc(e,n);return Yc(o,s,c,l,u,d,r,i,a)}(e,i))===0)return cl(i),i})).filter((e=>e!==void 0))}(e,t)}function bc(e,t){let n=ds(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=yc(e,n);if(r.length)return r[0];let i=Rc(n),a=I.default.subtract(i,Ki);return cl(a),zc(e,a)}function xc(e){let t;return t=e<0||e>9999?(e<0?`-`:`+`)+Do(Math.abs(e),6):Do(e,4),t}function Sc(e){return Do(e,2)}function Cc(e,t){let n;if(t===`auto`){if(e===0)return``;n=Do(e,9).replace(/0+$/,``)}else{if(t===0)return``;n=Do(e,9).slice(0,t)}return`.${n}`}function wc(e,t,n,r,i){let a=`${Sc(e)}:${Sc(t)}`;return i===`minute`||(a+=`:${Sc(n)}`,a+=Cc(r,i)),a}function Tc(e,t,n){let r=t;r===void 0&&(r=`UTC`);let i=L(e,ea),a=kc(gc(r,i),`iso8601`,n,`never`),o=`Z`;return t!==void 0&&(o=oee(mc(r,i))),`${a}${o}`}function Ec(e,t){let n=L(e,la),r=L(e,ua),i=L(e,da),a=L(e,fa),o=L(e,pa),s=L(e,ma),c=Wc(e),l=``;n!==0&&(l+=`${Math.abs(n)}Y`),r!==0&&(l+=`${Math.abs(r)}M`),i!==0&&(l+=`${Math.abs(i)}W`),a!==0&&(l+=`${Math.abs(a)}D`);let u=``;o!==0&&(u+=`${Math.abs(o)}H`),s!==0&&(u+=`${Math.abs(s)}M`);let d=Wa.fromComponents(0,0,L(e,ha),L(e,ga),L(e,_a),L(e,va));d.isZero()&&![`second`,`millisecond`,`microsecond`,`nanosecond`].includes(ws(e))&&t===`auto`||(u+=`${Math.abs(d.sec)}${Cc(Math.abs(d.subsec),t)}S`);let f=`${c<0?`-`:``}P${l}`;return u&&(f=`${f}T${u}`),f}function Dc(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ta);return`${xc(n)}-${Sc(r)}-${Sc(i)}${Zo(L(e,ia),t)}`}function Oc({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){return wc(e,t,n,1e6*r+1e3*i+a,o)}function kc(e,t,n,r=`auto`){let{isoDate:{year:i,month:a,day:o},time:{hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}=e;return`${xc(i)}-${Sc(a)}-${Sc(o)}T${wc(s,c,l,1e6*u+1e3*d+f,n)}${Zo(t,r)}`}function Ac(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ta),a=`${Sc(r)}-${Sc(i)}`,o=L(e,ia);t!==`always`&&t!==`critical`&&o===`iso8601`||(a=`${xc(n)}-${a}`);let s=Zo(o,t);return s&&(a+=s),a}function nee(e,t=`auto`){let{year:n,month:r,day:i}=L(e,ta),a=`${xc(n)}-${Sc(r)}`,o=L(e,ia);t!==`always`&&t!==`critical`&&o===`iso8601`||(a+=`-${Sc(i)}`);let s=Zo(o,t);return s&&(a+=s),a}function ree(e,t,n=`auto`,r=`auto`,i=`auto`,a=void 0){let o=L(e,ea);if(a){let{unit:e,increment:t,roundingMode:n}=a;o=Ul(o,t,e,n)}let s=L(e,ca),c=mc(s,o),l=kc(gc(s,o),`iso8601`,t,`never`);return i!==`never`&&(l+=oee(c)),r!==`never`&&(l+=`[${r===`critical`?`!`:``}${s}]`),l+=Zo(L(e,ia),n),l}function iee(e){return is.test(e)}function jc(e){let t=fee.exec(e);if(!t)throw RangeError(`invalid time zone offset: ${e}; must match ±HH:MM[:SS.SSSSSSSSS]`);return(t[1]===`-`?-1:1)*(1e9*(60*(60*t[2]+ +(t[3]||0))+ +(t[4]||0))+ +((t[5]||0)+`000000000`).slice(0,9))}let Mc;const aee=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function Nc(e){if(Mc===void 0){let e=Intl.supportedValuesOf?.(`timeZone`);if(e){Mc=new Map;for(let t=0;t<e.length;t++){let n=e[t];Mc.set(su(n),n)}}else Mc=null}let t=su(e),n=Mc?.get(t);if(n)return{identifier:n,primaryIdentifier:n};try{n=Vo(e).resolvedOptions().timeZone}catch{return}if(t===`antarctica/south_pole`&&(n=`Antarctica/McMurdo`),bo.has(e))throw RangeError(`${e} is a legacy time zone identifier from ICU. Use ${n} instead`);let r=[...t].map(((e,n)=>n===0||aee[t[n-1]]?e.toUpperCase():e)).join(``).split(`/`);if(r.length===1)return t===`gb-eire`?{identifier:`GB-Eire`,primaryIdentifier:n}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:n};if(r[0]===`Etc`)return{identifier:`Etc/${[`Zulu`,`Greenwich`,`Universal`].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:n};if(r[0]===`Us`)return{identifier:`US/${r[1]}`,primaryIdentifier:n};let i=new Map([[`Act`,`ACT`],[`Lhi`,`LHI`],[`Nsw`,`NSW`],[`Dar_Es_Salaam`,`Dar_es_Salaam`],[`Port_Of_Spain`,`Port_of_Spain`],[`Port-Au-Prince`,`Port-au-Prince`],[`Isle_Of_Man`,`Isle_of_Man`],[`Comodrivadavia`,`ComodRivadavia`],[`Knox_In`,`Knox_IN`],[`Dumontdurville`,`DumontDUrville`],[`Mcmurdo`,`McMurdo`],[`Denoronha`,`DeNoronha`],[`Easterisland`,`EasterIsland`],[`Bajanorte`,`BajaNorte`],[`Bajasur`,`BajaSur`]]);return r[1]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join(`/`),primaryIdentifier:n}}function Pc(e,t){let{year:n,month:r,day:i,hour:a,minute:o,second:s}=Vc(e,t),c=t%1e3;return c<0&&(c+=1e3),1e6*(Lc({isoDate:{year:n,month:r,day:i},time:{hour:a,minute:o,second:s,millisecond:c}})-t)}function Fc(e,t){return Pc(e,Zl(t,`floor`))}function Ic(e){let t=e<0?`-`:`+`,n=Math.abs(e);return`${t}${wc(Math.floor(n/60),n%60,0,0,`minute`)}`}function oee(e){return Ic(Hl(e,6e10,`halfExpand`)/6e10)}function Lc({isoDate:{year:e,month:t,day:n},time:{hour:r,minute:i,second:a,millisecond:o}}){let s=e%400,c=(e-s)/400,l=new Date;return l.setUTCHours(r,i,a,o),l.setUTCFullYear(s,t-1,n),l.getTime()+0xb7af85d9c00*c}function Rc(e){let t=Lc(e),n=1e3*e.time.microsecond+e.time.nanosecond;return I.default.add(Ql(t),I.default.BigInt(n))}function see(e){let t=Zl(e,`trunc`),n=I.default.toNumber(I.default.remainder(e,Hi));n<0&&(n+=1e6,--t);let r=Math.floor(n/1e3)%1e3,i=n%1e3,a=new Date(t);return{epochMilliseconds:t,isoDate:{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate()},time:{hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function zc(e,t){if(e===`UTC`)return null;let n=Zl(t,`floor`);if(n<vo)return zc(e,Ql(vo));let r=Date.now(),i=Math.max(n,r)+366*co*3,a=n,o=Pc(e,a),s=a,c=o;for(;o===c&&a<i;){if(s=a+2*co*7,s>uo)return null;c=Pc(e,s),o===c&&(a=s)}return o===c?null:Ql(lu((t=>Pc(e,t)),a,s,o,c))}function Bc(e,t){if(e===`UTC`)return null;let n=Zl(t,`ceil`),r=Date.now(),i=r+366*co*3;if(n>i){let t=Bc(e,Ql(i));if(t===null||I.default.lessThan(t,Ql(r)))return t}if(e===`Africa/Casablanca`||e===`Africa/El_Aaiun`){let t=Date.UTC(2088,0,1);if(t<n)return Bc(e,Ql(t))}let a=n-1;if(a<vo)return null;let o=Pc(e,a),s=a,c=o;for(;o===c&&a>vo;){if(s=a-2*co*7,s<vo)return null;c=Pc(e,s),o===c&&(a=s)}return o===c?null:Ql(lu((t=>Pc(e,t)),s,a,c,o))}function Vc(e,t){return function(e){let t=e.split(/[^\w]+/);if(t.length!==7)throw RangeError(`expected 7 parts in "${e}`);let n=+t[0],r=+t[1],i=+t[2],a=t[3];if(a[0]===`b`||a[0]===`B`)i=1-i;else if(a[0]!==`a`&&a[0]!==`A`)throw RangeError(`Unknown era ${a} in "${e}`);let o=t[4]===`24`?0:+t[4],s=+t[5],c=+t[6];if(!(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)&&Number.isFinite(c)))throw RangeError(`Invalid number in "${e}`);return{year:i,month:n,day:r,hour:o,minute:s,second:c}}(Vo(e).format(t))}function Hc(e){return e!==void 0&&!(e%4!=0||e%100==0&&e%400!=0)}function Uc(e,t){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[Hc(e)?`leapyear`:`standard`][t-1]}function Wc(e){let t=[L(e,la),L(e,ua),L(e,da),L(e,fa),L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va)];for(let e=0;e<t.length;e++){let n=t[e];if(n!==0)return n<0?-1:1}return 0}function Gc(e){let t=[`years`,`months`,`weeks`,`days`];for(let n=0;n<t.length;n++){let r=e[t[n]];if(r!==0)return r<0?-1:1}return 0}function Kc(e){let t=Gc(e.date);return t===0?e.time.sign():t}function qc(e,t){let n=e,r=t;if(!Number.isFinite(n)||!Number.isFinite(r))throw RangeError(`infinity is out of range`);return--r,n+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:n,month:r}}function Jc(e,t,n){let r=e,i=t,a=n;if(!Number.isFinite(a))throw RangeError(`infinity is out of range`);({year:r,month:i}=qc(r,i));let o=146097;if(Math.abs(a)>o){let e=Math.trunc(a/o);r+=400*e,a-=e*o}let s=0,c=i>2?r:r-1;for(;s=Hc(c)?366:365,a<-s;)--r,--c,a+=s;for(c+=1;s=Hc(c)?366:365,a>s;)r+=1,c+=1,a-=s;for(;a<1;)({year:r,month:i}=qc(r,i-1)),a+=Uc(r,i);for(;a>Uc(r,i);)a-=Uc(r,i),{year:r,month:i}=qc(r,i+1);return{year:r,month:i,day:a}}function Yc(e,t,n,r,i,a,o,s,c){let l=Xc(r,i,a,o,s,c);return ds(Jc(e,t,n+l.deltaDays),l)}function Xc(e,t,n,r,i,a){let o,s=e,c=t,l=n,u=r,d=i,f=a;({div:o,mod:f}=Ba(f,3)),d+=o,f<0&&(--d,f+=1e3),{div:o,mod:d}=Ba(d,3),u+=o,d<0&&(--u,d+=1e3),l+=Math.trunc(u/1e3),u%=1e3,u<0&&(--l,u+=1e3),c+=Math.trunc(l/60),l%=60,l<0&&(--c,l+=60),s+=Math.trunc(c/60),c%=60,c<0&&(--s,c+=60);let p=Math.trunc(s/24);return s%=24,s<0&&(--p,s+=24),p+=0,s+=0,c+=0,l+=0,u+=0,d+=0,f+=0,{deltaDays:p,hour:s,minute:c,second:l,millisecond:u,microsecond:d,nanosecond:f}}function Zc(e,t){let n=us(e,0);if(Gc(n)===0)return e.days;let r=L(t,ta),i=ic(L(t,ia),r,n,`constrain`),a=gl(r.year,r.month-1,r.day),o=gl(i.year,i.month-1,i.day)-a;return e.days+o}function Qc(e){return new(za(`%Temporal.Duration%`))(-L(e,la),-L(e,ua),-L(e,da),-L(e,fa),-L(e,pa),-L(e,ma),-L(e,ha),-L(e,ga),-L(e,_a),-L(e,va))}function $c(e,t,n){return Math.min(n,Math.max(t,e))}function el(e,t,n){let r=$c(t,1,12);return{year:e,month:r,day:$c(n,1,Uc(e,r))}}function tl(e,t,n){if(e<t||e>n)throw RangeError(`value out of range: ${t} <= ${e} <= ${n}`)}function nl(e,t,n){tl(t,1,12),tl(n,1,Uc(e,t))}function rl(e){ol(ds(e,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function il(e,t,n,r,i,a){tl(e,0,23),tl(t,0,59),tl(n,0,59),tl(r,0,999),tl(i,0,999),tl(a,0,999)}function al(e,t,n,r,i,a,o,s,c){nl(e,t,n),il(r,i,a,o,s,c)}function ol(e){let t=Rc(e);(I.default.lessThan(t,mo)||I.default.greaterThan(t,ho))&&cl(t)}function sl(e){Rc(e)}function cl(e){if(I.default.lessThan(e,po)||I.default.greaterThan(e,fo))throw RangeError(`date/time value is outside of supported range`)}function ll({year:e,month:t}){tl(e,go,_o),e===go?tl(t,4,12):e===_o&&tl(t,1,9)}function ul(e,t,n,r,i,a,o,s,c,l){let u=0,d=[e,t,n,r,i,a,o,s,c,l];for(let e=0;e<d.length;e++){let t=d[e];if(t===1/0||t===-1/0)throw RangeError(`infinite values not allowed as duration fields`);if(t!==0){let e=t<0?-1:1;if(u!==0&&e!==u)throw RangeError(`mixed-sign values not allowed as duration fields`);u=e}}if(Math.abs(e)>=2**32||Math.abs(t)>=2**32||Math.abs(n)>=2**32)throw RangeError(`years, months, and weeks must be < 2³²`);let f=Ba(s,3),p=Ba(c,6),m=Ba(l,9),h=Ba(1e6*f.mod+1e3*p.mod+m.mod,9).div,g=86400*r+3600*i+60*a+o+f.div+p.div+m.div+h;if(!Number.isSafeInteger(g))throw RangeError(`total of duration time units cannot exceed 9007199254740991.999999999 s`)}function dl(e){return{date:{years:L(e,la),months:L(e,ua),weeks:L(e,da),days:L(e,fa)},time:Wa.fromComponents(L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va))}}function fl(e){let t=Wa.fromComponents(L(e,pa),L(e,ma),L(e,ha),L(e,ga),L(e,_a),L(e,va)).add24HourDays(L(e,fa));return{date:{years:L(e,la),months:L(e,ua),weeks:L(e,da),days:0},time:t}}function pl(e){let t=fl(e),n=Math.trunc(t.time.sec/86400);return ul(t.date.years,t.date.months,t.date.weeks,n,0,0,0,0,0,0),{...t.date,days:n}}function ml(e,t){let n=e.time.sign(),r=e.time.abs().subsec,i=0,a=0,o=e.time.abs().sec,s=0,c=0,l=0;switch(t){case`year`:case`month`:case`week`:case`day`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60,l=Math.trunc(c/24),c%=24;break;case`hour`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60,c=Math.trunc(s/60),s%=60;break;case`minute`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3,s=Math.trunc(o/60),o%=60;break;case`second`:i=Math.trunc(r/1e3),r%=1e3,a=Math.trunc(i/1e3),i%=1e3,o+=Math.trunc(a/1e3),a%=1e3;break;case`millisecond`:i=Math.trunc(r/1e3),r%=1e3,a=Va(o,3,Math.trunc(i/1e3)),i%=1e3,o=0;break;case`microsecond`:i=Va(o,6,Math.trunc(r/1e3)),r%=1e3,o=0;break;case`nanosecond`:r=Va(o,9,r),o=0}return new(za(`%Temporal.Duration%`))(e.date.years,e.date.months,e.date.weeks,e.date.days+n*l,n*c,n*s,n*o,n*a,n*i,n*r)}function hl(e,t){return Gc(e),t.sign(),{date:e,time:t}}function gl(e,t,n){return Lc({isoDate:{year:e,month:t+1,day:n},time:{hour:0,minute:0,second:0,millisecond:0}})/co}function _l({year:e,month:t,day:n}){if(Math.abs(gl(e,t-1,n))>1e8)throw RangeError(`date/time value is outside the supported range`)}function vl(e,t){let n=t.hour-e.hour,r=t.minute-e.minute,i=t.second-e.second,a=t.millisecond-e.millisecond,o=t.microsecond-e.microsecond,s=t.nanosecond-e.nanosecond;return Wa.fromComponents(n,r,i,a,o,s)}function yl(e,t,n,r,i){let a=Wa.fromEpochNsDiff(t,e);return a=Kl(a,n,r,i),hl({years:0,months:0,weeks:0,days:0},a)}function bl(e,t,n,r){sl(e),sl(t);let i=vl(e.time,t.time),a=i.sign(),o=Jl(e.isoDate,t.isoDate),s=t.isoDate;o===a&&(s=Jc(s.year,s.month,s.day+a),i=i.add24HourDays(-a));let c=Ts(`day`,r),l=ac(n,e.isoDate,s,c);return r!==c&&(i=i.add24HourDays(l.days),l.days=0),hl(l,i)}function xl(e,t,n,r,i){let a=I.default.subtract(t,e);if(I.default.equal(a,Fi))return{date:{years:0,months:0,weeks:0,days:0},time:Wa.ZERO};let o=I.default.lessThan(a,Fi)?-1:1,s=gc(n,e),c=gc(n,t),l,u=0,d=o===1?2:1,f=vl(s.time,c.time);for(f.sign()===-o&&u++;u<=d;u++){l=ds(Jc(c.isoDate.year,c.isoDate.month,c.isoDate.day-u*o),s.time);let e=_c(n,l,`compatible`);if(f=Wa.fromEpochNsDiff(t,e),f.sign()!==-o)break}let p=Ts(`day`,i);return hl(ac(r,s.isoDate,l.isoDate,p),f)}function Sl(e,t,n,r,i,a,o,s,c){let l,u,d,f,p=t;switch(s){case`year`:{let t=Hl(p.date.years,o,`trunc`);l=t,u=t+o*e,d={years:l,months:0,weeks:0,days:0},f={...d,years:u};break}case`month`:{let t=Hl(p.date.months,o,`trunc`);l=t,u=t+o*e,d=us(p.date,0,0,l),f=us(p.date,0,0,u);break}case`week`:{let t=us(p.date,0,0),n=ic(a,r.isoDate,t,`constrain`),i=ac(a,n,Jc(n.year,n.month,n.day+p.date.days),`week`),s=Hl(p.date.weeks+i.weeks,o,`trunc`);l=s,u=s+o*e,d=us(p.date,0,l),f=us(p.date,0,u);break}case`day`:{let t=Hl(p.date.days,o,`trunc`);l=t,u=t+o*e,d=us(p.date,l),f=us(p.date,u);break}}let m=ic(a,r.isoDate,d,`constrain`),h=ic(a,r.isoDate,f,`constrain`),g,_,v=ds(m,r.time),y=ds(h,r.time);i?(g=_c(i,v,`compatible`),_=_c(i,y,`compatible`)):(g=Rc(v),_=Rc(y));let b=Wa.fromEpochNsDiff(n,g),x=Wa.fromEpochNsDiff(_,g),S=Ha(c,e<0?`negative`:`positive`),C=b.add(b).abs().subtract(x.abs()).sign(),w=Math.abs(l)/o%2==0,T=b.isZero()?Math.abs(l):b.cmp(x)?Ua(Math.abs(l),Math.abs(u),C,w,S):Math.abs(u),E=new Wa(I.default.add(I.default.multiply(x.totalNs,I.default.BigInt(l)),I.default.multiply(b.totalNs,I.default.BigInt(o*e)))).fdiv(x.totalNs),ee=T===Math.abs(u);return p={date:ee?f:d,time:Wa.ZERO},{nudgeResult:{duration:p,nudgedEpochNs:ee?_:g,didExpandCalendarUnit:ee},total:E}}function Cl(e,t,n,r,i,a,o,s,c){let l=e,u=Es(s)||r&&s===`day`,d=Kc(l)<0?-1:1,f;return u?{nudgeResult:f}=Sl(d,l,t,n,r,i,o,s,c):f=r?function(e,t,n,r,i,a,o,s){let c=t,l=ic(i,n.isoDate,c.date,`constrain`),u=ds(l,n.time),d=ds(Jc(l.year,l.month,l.day+e),n.time),f=_c(r,u,`compatible`),p=_c(r,d,`compatible`),m=Wa.fromEpochNsDiff(p,f);if(m.sign()!==e)throw RangeError(`time zone returned inconsistent Instants`);let h=I.default.BigInt(Lo[o]*a),g=c.time.round(h,s),_=g.subtract(m),v=_.sign()!==-e,y,b;return v?(y=e,g=_.round(h,s),b=g.addToEpochNs(p)):(y=0,b=g.addToEpochNs(f)),{duration:hl(us(c.date,c.date.days+y),g),nudgedEpochNs:b,didExpandCalendarUnit:v}}(d,l,n,r,i,o,s,c):function(e,t,n,r,i,a){let o=e,s=o.time.add24HourDays(o.date.days),c=s.round(I.default.BigInt(r*Lo[i]),a),l=c.subtract(s),{quotient:u}=s.divmod(lo),{quotient:d}=c.divmod(lo),f=Math.sign(d-u)===s.sign(),p=l.addToEpochNs(t),m=0,h=c;return Ds(n)===`date`&&(m=d,h=c.add(Wa.fromComponents(24*-d,0,0,0,0,0))),{duration:{date:us(o.date,m),time:h},nudgedEpochNs:p,didExpandCalendarUnit:f}}(l,t,a,o,s,c),l=f.duration,f.didExpandCalendarUnit&&s!==`week`&&(l=function(e,t,n,r,i,a,o,s){let c=t;if(s===o)return c;let l=Io.indexOf(o);for(let t=Io.indexOf(s)-1;t>=l;t--){let s=Io[t];if(s===`week`&&o!==`week`)continue;let l;switch(s){case`year`:l={years:c.date.years+e,months:0,weeks:0,days:0};break;case`month`:{let t=c.date.months+e;l=us(c.date,0,0,t);break}case`week`:{let t=c.date.weeks+e;l=us(c.date,0,t);break}}let u=ds(ic(a,r.isoDate,l,`constrain`),r.time),d;if(d=i?_c(i,u,`compatible`):Rc(u),Xi(n,d)===-e)break;c={date:l,time:Wa.ZERO}}return c}(d,l,f.nudgedEpochNs,n,r,i,a,Ts(s,`day`))),l}function wl(e,t,n,r,i,a){return Es(a)||r&&a===`day`?Sl(Kc(e)<0?-1:1,e,t,n,r,i,1,a,`trunc`).total:ql(e.time.add24HourDays(e.date.days),a)}function Tl(e,t,n,r,i,a,o){if(Xl(e,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Wa.ZERO};ol(e),ol(t);let s=bl(e,t,n,r);return a===`nanosecond`&&i===1?s:Cl(s,Rc(t),e,null,n,r,i,a,o)}function El(e,t,n,r,i,a,o,s){if(Ds(i)===`time`)return yl(e,t,a,o,s);let c=xl(e,t,n,r,i);return o===`nanosecond`&&a===1?c:Cl(c,t,gc(n,e),n,r,i,a,o,s)}function Dl(e,t,n,r,i,a){let o=No.reduce(((e,t)=>{let i=t[0],a=t[1],o=t[2];return n!==`datetime`&&o!==n||r.includes(a)||e.push(a,i),e}),[]),s=Ss(t,`largestUnit`,n,`auto`);if(r.includes(s))throw RangeError(`largestUnit must be one of ${o.join(`, `)}, not ${s}`);let c=_s(t),l=ms(t,`trunc`);e===`since`&&(l=function(e){switch(e){case`ceil`:return`floor`;case`floor`:return`ceil`;case`halfCeil`:return`halfFloor`;case`halfFloor`:return`halfCeil`;default:return e}}(l));let u=Ss(t,`smallestUnit`,n,i);if(r.includes(u))throw RangeError(`smallestUnit must be one of ${o.join(`, `)}, not ${u}`);let d=Ts(a,u);if(s===`auto`&&(s=d),Ts(s,u)!==s)throw RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${u}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];return f!==void 0&&vs(c,f,!1),{largestUnit:s,roundingIncrement:c,roundingMode:l,smallestUnit:u}}function Ol(e,t,n,r){let i=Ls(n),a=Dl(e,ru(r),`time`,[],`nanosecond`,`second`),o=ml(yl(L(t,ea),L(i,ea),a.roundingIncrement,a.smallestUnit,a.roundingMode),a.largestUnit);return e===`since`&&(o=Qc(o)),o}function kl(e,t,n,r){let i=Ns(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`date`,[],`day`,`day`),c=za(`%Temporal.Duration%`),l=L(t,ta),u=L(i,ta);if(Jl(l,u)===0)return new c;let d={date:ac(a,l,u,s.largestUnit),time:Wa.ZERO};if(s.smallestUnit!==`day`||s.roundingIncrement!==1){let e=ds(l,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});d=Cl(d,Rc(ds(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let f=ml(d,`day`);return e===`since`&&(f=Qc(f)),f}function Al(e,t,n,r){let i=Fs(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`datetime`,[],`nanosecond`,`day`),c=za(`%Temporal.Duration%`),l=L(t,na),u=L(i,na);if(Xl(l,u)===0)return new c;let d=ml(Tl(l,u,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return e===`since`&&(d=Qc(d)),d}function jl(e,t,n,r){let i=zs(n),a=Dl(e,ru(r),`time`,[],`nanosecond`,`hour`),o=vl(L(t,ra),L(i,ra));o=Kl(o,a.roundingIncrement,a.smallestUnit,a.roundingMode);let s=ml(hl({years:0,months:0,weeks:0,days:0},o),a.largestUnit);return e===`since`&&(s=Qc(s)),s}function Ml(e,t,n,r){let i=Vs(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between months of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`date`,[`week`,`day`],`month`,`year`),c=za(`%Temporal.Duration%`);if(Jl(L(t,ta),L(i,ta))==0)return new c;let l=As(a,L(t,ta),`year-month`);l.day=1;let u=lc(a,l,`constrain`),d=As(a,L(i,ta),`year-month`);d.day=1;let f=lc(a,d,`constrain`),p={date:us(ac(a,u,f,s.largestUnit),0,0),time:Wa.ZERO};if(s.smallestUnit!==`month`||s.roundingIncrement!==1){let e=ds(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Cl(p,Rc(ds(f,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let m=ml(p,`day`);return e===`since`&&(m=Qc(m)),m}function Nl(e,t,n,r){let i=Us(n),a=L(t,ia),o=L(i,ia);if(!cc(a,o))throw RangeError(`cannot compute difference between dates of ${a} and ${o} calendars`);let s=Dl(e,ru(r),`datetime`,[],`nanosecond`,`hour`),c=L(t,ea),l=L(i,ea),u=za(`%Temporal.Duration%`),d;if(Ds(s.largestUnit)!==`date`)d=ml(yl(c,l,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let e=L(t,ca);if(!pc(e,L(i,ca)))throw RangeError(`When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.`);if(I.default.equal(c,l))return new u;d=ml(El(c,l,e,a,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),`hour`)}return e===`since`&&(d=Qc(d)),d}function Pl({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o){let s=n,c=a;return s+=o.sec,c+=o.subsec,Xc(e,t,s,r,i,c)}function Fl(e,t){let n=t.addToEpochNs(e);return cl(n),n}function Il(e,t,n,r,i=`constrain`){if(Gc(r.date)===0)return Fl(e,r.time);let a=gc(t,e);return Fl(_c(t,ds(ic(n,a.isoDate,r.date,i),a.time),`compatible`),r.time)}function Ll(e,t,n){let r=Is(n);e===`subtract`&&(r=Qc(r));let i=Ts(ws(t),ws(r));if(Es(i))throw RangeError(`For years, months, or weeks arithmetic, use date arithmetic relative to a starting point`);let a=fl(t),o=fl(r);return ml(hl({years:0,months:0,weeks:0,days:0},a.time.add(o.time)),i)}function Rl(e,t,n){let r=Is(n);e===`subtract`&&(r=Qc(r));let i=ws(r);if(Ds(i)===`date`)throw RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let a=fl(r);return tc(Fl(L(t,ea),a.time))}function zl(e,t,n,r){let i=L(t,ia),a=Is(n);e===`subtract`&&(a=Qc(a));let o=pl(a),s=fs(ru(r));return Gs(ic(i,L(t,ta),o,s),i)}function Bl(e,t,n,r){let i=Is(n);e===`subtract`&&(i=Qc(i));let a=fs(ru(r)),o=L(t,ia),s=fl(i),c=L(t,na),l=Pl(c.time,s.time),u=us(s.date,l.deltaDays);return ul(u.years,u.months,u.weeks,u.days,0,0,0,0,0,0),qs(ds(ic(o,c.isoDate,u,a),l),o)}function Vl(e,t,n){let r=Is(n);e===`subtract`&&(r=Qc(r));let i=fl(r),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Pl(L(t,ra),i.time);return Zs(cs(a,o,s,c,l,u,`reject`))}function cee(e,t,n,r){let i=Is(n);e===`subtract`&&(i=Qc(i));let a=fs(ru(r)),o=Wc(i),s=L(t,ia),c=As(s,L(t,ta),`year-month`);c.day=1;let l=lc(s,c,`constrain`);if(o<0){let e=ic(s,l,{months:1},`constrain`);l=Jc(e.year,e.month,e.day-1)}let u=pl(i);return rl(l),$s(uc(s,As(s,ic(s,l,u,a),`year-month`),a),s)}function lee(e,t,n,r){let i=Is(n);e===`subtract`&&(i=Qc(i));let a=fs(ru(r)),o=L(t,ca),s=L(t,ia),c=dl(i);return nc(Il(L(t,ea),o,s,c,a),o,s)}function Hl(e,t,n){let r=Math.trunc(e/t),i=e%t,a=e<0?`negative`:`positive`,o=Math.abs(r),s=o+1,c=nu(Math.abs(2*i)-t),l=o%2==0,u=Ha(n,a),d=i===0?o:Ua(o,s,c,l,u);return t*(a===`positive`?d:-d)}function Ul(e,t,n,r){let i=Lo[n]*t;return function(e,t,n){let r=qi(e),i=qi(t),a=I.default.divide(r,i),o=I.default.remainder(r,i),s=Ha(n,`positive`),c,l;I.default.lessThan(r,Fi)?(c=I.default.subtract(a,Ii),l=a):(c=a,l=I.default.add(a,Ii));let u=Xi(Yi(I.default.multiply(o,Li)),i)*(I.default.lessThan(r,Fi)?-1:1)+0,d=I.default.equal(o,Fi)?a:Ua(c,l,u,Ji(c),s);return I.default.multiply(d,i)}(e,I.default.BigInt(i),r)}function Wl(e,t,n,r){sl(e);let{year:i,month:a,day:o}=e.isoDate,s=Gl(e.time,t,n,r);return ds(Jc(i,a,o+s.deltaDays),s)}function Gl({hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:a},o,s,c){let l;switch(s){case`day`:case`hour`:l=1e3*(1e3*(1e3*(60*(60*e+t)+n)+r)+i)+a;break;case`minute`:l=1e3*(1e3*(1e3*(60*t+n)+r)+i)+a;break;case`second`:l=1e3*(1e3*(1e3*n+r)+i)+a;break;case`millisecond`:l=1e3*(1e3*r+i)+a;break;case`microsecond`:l=1e3*i+a;break;case`nanosecond`:l=a}let u=Lo[s],d=Hl(l,u*o,c)/u;switch(s){case`day`:return{deltaDays:d,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case`hour`:return Xc(d,0,0,0,0,0);case`minute`:return Xc(e,d,0,0,0,0);case`second`:return Xc(e,t,d,0,0,0);case`millisecond`:return Xc(e,t,n,d,0,0);case`microsecond`:return Xc(e,t,n,r,d,0);case`nanosecond`:return Xc(e,t,n,r,i,d);default:throw Error(`Invalid unit ${s}`)}}function Kl(e,t,n,r){let i=Lo[n];return e.round(I.default.BigInt(i*t),r)}function ql(e,t){let n=Lo[t];return e.fdiv(I.default.BigInt(n))}function Jl(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:nu(e.day-t.day):nu(e.month-t.month):nu(e.year-t.year)}function Yl(e,t){return e.hour===t.hour?e.minute===t.minute?e.second===t.second?e.millisecond===t.millisecond?e.microsecond===t.microsecond?e.nanosecond===t.nanosecond?0:nu(e.nanosecond-t.nanosecond):nu(e.microsecond-t.microsecond):nu(e.millisecond-t.millisecond):nu(e.second-t.second):nu(e.minute-t.minute):nu(e.hour-t.hour)}function Xl(e,t){let n=Jl(e.isoDate,t.isoDate);return n===0?Yl(e.time,t.time):n}function uee(e){let t=$l(e);return globalThis.BigInt===void 0?t:globalThis.BigInt(t.toString(10))}function Zl(e,t){let{quotient:n,remainder:r}=Zi(qi(e),Hi),i=I.default.toNumber(n);return t===`floor`&&I.default.toNumber(r)<0&&--i,t===`ceil`&&I.default.toNumber(r)>0&&(i+=1),i}function Ql(e){if(!Number.isInteger(e))throw RangeError(`epoch milliseconds must be an integer`);return I.default.multiply(I.default.BigInt(e),Hi)}function $l(e){let t=e;if(typeof e==`object`){let n=e[Symbol.toPrimitive];n&&typeof n==`function`&&(t=n.call(e,`number`))}if(typeof t==`number`)throw TypeError(`cannot convert number to bigint`);return typeof t==`bigint`?I.default.BigInt(t.toString(10)):I.default.BigInt(t)}const eu=(()=>{let e=I.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),n=I.default.BigInt(t),r=I.default.add(Ql(t),e);return e=I.default.remainder(n,Hi),I.default.greaterThan(r,fo)?fo:I.default.lessThan(r,po)?po:r}})();function tu(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function nu(e){return e<0?-1:e>0?1:e}function ru(e){if(e===void 0)return Object.create(null);if(xo(e)&&e!==null)return e;throw TypeError(`Options parameter must be an object, not `+(e===null?`null`:typeof e))}function iu(e,t){let n=Object.create(null);return n[e]=t,n}function au(e,t,n,r){let i=e[t];if(i!==void 0){if(i=Co(i),!n.includes(i))throw RangeError(`${t} must be one of ${n.join(`, `)}, not ${i}`);return i}if(r===xs)throw RangeError(`${t} option is required`);return r}function ou(e){let t=su(e);if(!yo.includes(su(t)))throw RangeError(`invalid calendar identifier ${t}`);switch(t){case`ethiopic-amete-alem`:return`ethioaa`;case`islamicc`:return`islamic-civil`}return t}function su(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function cu(e){throw TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${e===`PlainMonthDay`?`Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))`:`Temporal.${e}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}const dee=RegExp(`^${Qa.source}$`),fee=RegExp(`^([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\\d{1,9}))?)?)?$`);function lu(e,t,n,r=e(t),i=e(n)){let a=t,o=n,s=r,c=i;for(;o-a>1;){let t=Math.trunc((a+o)/2),n=e(t);n===s?(a=t,s=n):n===c&&(o=t,c=n)}return o}function uu(e){return[...e]}function du(e,t){if(e!==`gregory`&&e!==`iso8601`)return;let n=pu[e],r=t.year,{dayOfWeek:i,dayOfYear:a,daysInYear:o}=n.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=n.getFirstDayOfWeek(),c=n.getMinimalDaysInFirstWeek(),l=(i+7-s)%7,u=(i-a+7001-s)%7,d=Math.floor((a-1+u)/7);if(7-u>=c&&++d,d==0)d=function(e,t,n,r){let i=(r-e-n+1)%7;i<0&&(i+=7);let a=Math.floor((n+i-1)/7);return 7-i>=t&&++a,a}(s,c,a+n.isoToDate(n.dateAdd(t,{years:-1},`constrain`),{daysInYear:!0}).daysInYear,i),r--;else if(a>=o-5){let e=(l+o-a)%7;e<0&&(e+=7),6-e>=c&&a+7-l>o&&(d=1,r++)}return{week:d,year:r}}function fu(e,t,n,r,i){if(t!==i.year){if(e*(t-i.year)>0)return!0}else if(n!==i.month){if(e*(n-i.month)>0)return!0}else if(r!==i.day&&e*(r-i.day)>0)return!0;return!1}const pu={};function mu(e){if(!e.startsWith(`M`))throw RangeError(`Invalid month code: ${e}. Month codes must start with M.`);let t=+e.slice(1);if(Number.isNaN(t))throw RangeError(`Invalid month code: ${e}`);return t}function hu(e,t=!1){return`M${`${e}`.padStart(2,`0`)}${t?`L`:``}`}function gu(e,t=void 0,n=12){let{month:r,monthCode:i}=e;if(i===void 0){if(r===void 0)throw TypeError(`Either month or monthCode are required`);t===`reject`&&tl(r,1,n),t===`constrain`&&(r=$c(r,1,n)),i=hu(r)}else{let e=mu(i);if(i!==hu(e))throw RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==e)throw RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=e,r<1||r>n)throw RangeError(`Invalid monthCode: ${i}`)}return{...e,month:r,monthCode:i}}pu.iso8601={resolveFields(e,t){if((t===`date`||t===`year-month`)&&e.year===void 0)throw TypeError(`year is required`);if((t===`date`||t===`month-day`)&&e.day===void 0)throw TypeError(`day is required`);Object.assign(e,gu(e))},dateToISO:(e,t)=>ss(e.year,e.month,e.day,t),monthDayToISOReferenceDate(e,t){let{month:n,day:r}=ss(e.year??1972,e.month,e.day,t);return{month:n,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];t.add(r),r===`month`?t.add(`monthCode`):r===`monthCode`&&t.add(`month`)}return uu(t)},dateAdd(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a){let{year:o,month:s,day:c}=e;return o+=t,s+=n,{year:o,month:s}=qc(o,s),{year:o,month:s,day:c}=ss(o,s,c,a),c+=i+7*r,Jc(o,s,c)},dateUntil(e,t,n){let r=-Jl(e,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,a=0,o=0;if(n===`year`||n===`month`){let s=t.year-e.year;for(s!==0&&(s-=r);!fu(r,e.year+s,e.month,e.day,t);)a=s,s+=r;let c=r;for(i=qc(e.year+a,e.month+c);!fu(r,i.year,i.month,e.day,t);)o=c,c+=r,i=qc(i.year,i.month+r);n===`month`&&(o+=12*a,a=0)}i=qc(e.year+a,e.month+o);let s=el(i.year,i.month,e.day),c=0,l=gl(t.year,t.month-1,t.day)-gl(s.year,s.month-1,s.day);return n===`week`&&(c=Math.trunc(l/7),l%=7),{years:a,months:o,weeks:c,days:l}},isoToDate({year:e,month:t,day:n},r){let i={era:void 0,eraYear:void 0,year:e,month:t,day:n,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=hu(t)),r.dayOfWeek){let r=t+(t<3?10:-2),a=e-(t<3?1:0),o=Math.floor(a/100),s=a-100*o,c=(n+Math.floor(2.6*r-.2)+(s+Math.floor(s/4))+(Math.floor(o/4)-2*o))%7;i.dayOfWeek=c+(c<=0?7:0)}if(r.dayOfYear){let r=n;for(let n=t-1;n>0;n--)r+=Uc(e,n);i.dayOfYear=r}return r.weekOfYear&&(i.weekOfYear=du(`iso8601`,{year:e,month:t,day:n})),r.daysInMonth&&(i.daysInMonth=Uc(e,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=Hc(e),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var _u=class e{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let n=0;for(let r of t.map.entries()){if(++n>e.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(e){let t=this.map.get(e);return t&&(this.hits++,this.report()),this.calls++,t}set(e,t){this.map.set(e,t),this.misses++,this.report()}report(){}setObject(t){if(e.objectMap.get(t))throw RangeError(`object already cached`);e.objectMap.set(t,this),this.report()}static getCacheForObject(t){let n=e.objectMap.get(t);return n||(n=new e,e.objectMap.set(t,n)),n}};function vu({isoYear:e,isoMonth:t,isoDay:n}){return`${xc(e)}-${Sc(t)}-${Sc(n)}T00:00Z`}function yu(e,t){return{years:e.year-t.year,months:e.month-t.month,days:e.day-t.day}}_u.objectMap=new WeakMap,_u.MAX_CACHE_ENTRIES=1e3;var bu=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:`numeric`,month:`numeric`,year:`numeric`,era:`short`,timeZone:`UTC`})),this.formatter}getCalendarParts(e){let t=this.getFormatter(),n=new Date(e);if(e===`-271821-04-19T00:00Z`){let e=t.resolvedOptions();t=new Intl.DateTimeFormat(e.locale,{...e,timeZone:`Etc/GMT+1`}),n=new Date(`-271821-04-20T00:00Z`)}try{return t.formatToParts(n)}catch{throw RangeError(`Invalid ISO date: ${e}`)}}isoToCalendarDate(e,t){let{year:n,month:r,day:i}=e,a=JSON.stringify({func:`isoToCalendarDate`,isoYear:n,isoMonth:r,isoDay:i,id:this.id}),o=t.get(a);if(o)return o;let s=vu({isoYear:n,isoMonth:r,isoDay:i}),c=this.getCalendarParts(s),l={};for(let e=0;e<c.length;e++){let{type:t,value:n}=c[e];if(t!==`year`&&t!==`relatedYear`||(this.hasEra?l.eraYear=+n:l.year=+n),t===`month`){let e=/^([0-9]*)(.*?)$/.exec(n);if(!e||e.length!=3||!e[1]&&!e[2])throw RangeError(`Unexpected month: ${n}`);if(l.month=e[1]?+e[1]:1,l.month<1)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(l.month>13)throw RangeError(`Invalid month ${n} from ${s}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);e[2]&&(l.monthExtra=e[2])}t===`day`&&(l.day=+n),this.hasEra&&t===`era`&&n!=null&&n!==``&&(l.era=n.split(` (`)[0].normalize(`NFD`).replace(/[^-0-9 \p{L}]/gu,``).replace(/ /g,`-`).toLowerCase())}if(this.hasEra&&l.eraYear===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let e=this.eras.find((e=>l.era===e.genericName));e&&(l.era=e.code)}if(this.reviseIntlEra){let{era:t,eraYear:n}=this.reviseIntlEra(l,e);l.era=t,l.eraYear=n}this.checkIcuBugs&&this.checkIcuBugs(e);let u=this.adjustCalendarDate(l,t,`constrain`,!0);if(u.year===void 0)throw RangeError(`Missing year converting ${JSON.stringify(e)}`);if(u.month===void 0)throw RangeError(`Missing month converting ${JSON.stringify(e)}`);if(u.day===void 0)throw RangeError(`Missing day converting ${JSON.stringify(e)}`);return t.set(a,u),[`constrain`,`reject`].forEach((n=>{let r=JSON.stringify({func:`calendarToIsoDate`,year:u.year,month:u.month,day:u.day,overflow:n,id:this.id});t.set(r,e)})),u}validateCalendarDate(e){let{month:t,year:n,day:r,eraYear:i,monthCode:a,monthExtra:o}=e;if(o!==void 0)throw RangeError("Unexpected `monthExtra` value");if(n===void 0&&i===void 0)throw TypeError(`year or eraYear is required`);if(t===void 0&&a===void 0)throw TypeError(`month or monthCode is required`);if(r===void 0)throw RangeError(`Missing day`);if(a!==void 0){if(typeof a!=`string`)throw RangeError(`monthCode must be a string, not `+typeof a);if(!/^M([01]?\d)(L?)$/.test(a))throw RangeError(`Invalid monthCode: ${a}`)}if(this.hasEra&&e.era===void 0!=(e.eraYear===void 0))throw TypeError(`properties era and eraYear must be provided together`)}adjustCalendarDate(e,t=void 0,n=`constrain`,r=!1){if(this.calendarType===`lunisolar`)throw RangeError(`Override required for lunisolar calendars`);let i=e;this.validateCalendarDate(i);let a=this.monthsInYear(i,t),{month:o,monthCode:s}=i;return{month:o,monthCode:s}=gu(i,n,a),{...i,month:o,monthCode:s}}regulateMonthDayNaive(e,t,n){let r=this.monthsInYear(e,n),{month:i,day:a}=e;return t===`reject`?(tl(i,1,r),tl(a,1,this.maximumMonthLength(e))):(i=$c(i,1,r),a=$c(a,1,this.maximumMonthLength({...e,month:i}))),{...e,month:i,day:a}}calendarToIsoDate(e,t=`constrain`,n){let r=e,i=this.adjustCalendarDate(e,n,t,!1);i=this.regulateMonthDayNaive(i,t,n);let{year:a,month:o,day:s}=i,c=JSON.stringify({func:`calendarToIsoDate`,year:a,month:o,day:s,overflow:t,id:this.id}),l,u=n.get(c);if(u||r.year!==void 0&&r.month!==void 0&&r.day!==void 0&&(r.year!==i.year||r.month!==i.month||r.day!==i.day)&&(l=JSON.stringify({func:`calendarToIsoDate`,year:r.year,month:r.month,day:r.day,overflow:t,id:this.id}),u=n.get(l),u))return u;let d=this.estimateIsoDate({year:a,month:o,day:s}),f=e=>{let r=this.addDaysIso(d,e);if(i.day>this.minimumMonthLength(i)){let e=this.isoToCalendarDate(r,n);for(;e.month!==o||e.year!==a;){if(t===`reject`)throw RangeError(`day ${s} does not exist in month ${o} of year ${a}`);r=this.addDaysIso(r,-1),e=this.isoToCalendarDate(r,n)}}return r},p=0,m=this.isoToCalendarDate(d,n),h=yu(i,m);if(h.years!==0||h.months!==0||h.days!==0){let e=365*h.years+30*h.months+h.days;d=this.addDaysIso(d,e),m=this.isoToCalendarDate(d,n),h=yu(i,m),h.years===0&&h.months===0?d=f(h.days):p=this.compareCalendarDates(i,m)}let g=8;for(;p;){d=this.addDaysIso(d,p*g);let e=m;m=this.isoToCalendarDate(d,n);let a=p;if(p=this.compareCalendarDates(i,m),p){if(h=yu(i,m),h.years===0&&h.months===0)d=f(h.days),p=0;else if(a&&p!==a)if(g>1)g/=2;else{if(t===`reject`)throw RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...r})}`);this.compareCalendarDates(m,e)>0&&(d=this.addDaysIso(d,-1)),p=0}}}if(n.set(c,d),l&&n.set(l,d),i.year===void 0||i.month===void 0||i.day===void 0||i.monthCode===void 0||this.hasEra&&(i.era===void 0||i.eraYear===void 0))throw RangeError(`Unexpected missing property`);return d}compareCalendarDates(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:nu(e.day-t.day):nu(e.month-t.month):nu(e.year-t.year)}regulateDate(e,t=`constrain`,n){let r=this.calendarToIsoDate(e,t,n);return this.isoToCalendarDate(r,n)}addDaysIso(e,t){return Jc(e.year,e.month,e.day+t)}addDaysCalendar(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.addDaysIso(r,t);return this.isoToCalendarDate(i,n)}addMonthsCalendar(e,t,n,r){let i=e,{day:a}=i;for(let e=0,n=Math.abs(t);e<n;e++){let{month:e}=i,n=i,o=t<0?-Math.max(a,this.daysInPreviousMonth(i,r)):this.daysInMonth(i,r),s=this.calendarToIsoDate(i,`constrain`,r),c=this.addDaysIso(s,o);if(i=this.isoToCalendarDate(c,r),t>0){let t=this.monthsInYear(n,r);for(;i.month-1!=e%t;)c=this.addDaysIso(c,-1),i=this.isoToCalendarDate(c,r)}i.day!==a&&(i=this.regulateDate({...i,day:a},`constrain`,r))}if(n===`reject`&&i.day!==a)throw RangeError(`Day ${a} does not exist in resulting calendar month`);return i}addCalendar(e,{years:t=0,months:n=0,weeks:r=0,days:i=0},a,o){let{year:s,day:c,monthCode:l}=e,u=this.adjustCalendarDate({year:s+t,monthCode:l,day:c},o),d=this.addMonthsCalendar(u,n,a,o),f=i+7*r;return this.addDaysCalendar(d,f,o)}untilCalendar(e,t,n,r){let i=0,a=0,o=0,s=0;switch(n){case`day`:i=this.calendarDaysUntil(e,t,r);break;case`week`:{let n=this.calendarDaysUntil(e,t,r);i=n%7,a=(n-i)/7;break}case`month`:case`year`:{let a=this.compareCalendarDates(t,e);if(!a)return{years:0,months:0,weeks:0,days:0};let c=t.year-e.year,l=t.day-e.day;if(n===`year`&&c){let n=0;t.monthCode>e.monthCode&&(n=1),t.monthCode<e.monthCode&&(n=-1),n||=Math.sign(l),s=n*a<0?c-a:c}let u,d=s?this.addCalendar(e,{years:s},`constrain`,r):e;do o+=a,u=d,d=this.addMonthsCalendar(u,a,`constrain`,r),d.day!==e.day&&(d=this.regulateDate({...d,day:e.day},`constrain`,r));while(this.compareCalendarDates(t,d)*a>=0);o-=a,i=this.calendarDaysUntil(u,t,r);break}}return{years:s,months:o,weeks:a,days:i}}daysInMonth(e,t){let{day:n}=e,r=this.maximumMonthLength(e),i=this.minimumMonthLength(e);if(i===r)return i;let a=n<=r-i?r:i,o=this.calendarToIsoDate(e,`constrain`,t),s=this.addDaysIso(o,a),c=this.isoToCalendarDate(s,t),l=this.addDaysIso(s,-c.day);return this.isoToCalendarDate(l,t).day}daysInPreviousMonth(e,t){let{day:n,month:r,year:i}=e,a={year:r>1?i:i-1,month:r,day:1},o=r>1?r-1:this.monthsInYear(a,t);a={...a,month:o};let s=this.minimumMonthLength(a),c=this.maximumMonthLength(a);if(s===c)return c;let l=this.calendarToIsoDate(e,`constrain`,t),u=this.addDaysIso(l,-n);return this.isoToCalendarDate(u,t).day}startOfCalendarYear(e){return{year:e.year,month:1,monthCode:`M01`,day:1}}startOfCalendarMonth(e){return{year:e.year,month:e.month,day:1}}calendarDaysUntil(e,t,n){let r=this.calendarToIsoDate(e,`constrain`,n),i=this.calendarToIsoDate(t,`constrain`,n);return gl(i.year,i.month-1,i.day)-gl(r.year,r.month-1,r.day)}monthDaySearchStartYear(e,t){return 1972}monthDayFromFields(e,t,n){let r,i,a,o,s,{era:c,eraYear:l,year:u,month:d,monthCode:f,day:p}=e;if(d!==void 0&&u===void 0&&(!this.hasEra||c===void 0||l===void 0))throw TypeError(`when month is present, year (or era and eraYear) are required`);(f===void 0||u!==void 0||this.hasEra&&l!==void 0)&&({monthCode:f,day:p}=this.isoToCalendarDate(this.calendarToIsoDate(e,t,n),n));let m={year:this.monthDaySearchStartYear(f,p),month:12,day:31},h=this.isoToCalendarDate(m,n),g=h.monthCode>f||h.monthCode===f&&h.day>=p?h.year:h.year-1;for(let e=0;e<20;e++){let c=this.adjustCalendarDate({day:p,monthCode:f,year:g-e},n),l=this.calendarToIsoDate(c,`constrain`,n),u=this.isoToCalendarDate(l,n);if({year:r,month:i,day:a}=l,u.monthCode===f&&u.day===p)return{month:i,day:a,year:r};if(t===`constrain`){let e=this.maxLengthOfMonthCodeInAnyYear(u.monthCode);if(u.monthCode===f&&u.day===e&&p>e)return{month:i,day:a,year:r};(o===void 0||u.monthCode===o.monthCode&&u.day>o.day)&&(o=u,s=l)}}if(t===`constrain`&&s!==void 0)return s;throw RangeError(`No recent ${this.id} year with monthCode ${f} and day ${p}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},pee=class extends bu{constructor(){super(...arguments),this.id=`hebrew`,this.calendarType=`lunisolar`,this.months={Tishri:{leap:1,regular:1,monthCode:`M01`,days:30},Heshvan:{leap:2,regular:2,monthCode:`M02`,days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:`M03`,days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:`M04`,days:29},Shevat:{leap:5,regular:5,monthCode:`M05`,days:30},Adar:{leap:void 0,regular:6,monthCode:`M06`,days:29},"Adar I":{leap:6,regular:void 0,monthCode:`M05L`,days:30},"Adar II":{leap:7,regular:void 0,monthCode:`M06`,days:29},Nisan:{leap:8,regular:7,monthCode:`M07`,days:30},Iyar:{leap:9,regular:8,monthCode:`M08`,days:29},Sivan:{leap:10,regular:9,monthCode:`M09`,days:30},Tamuz:{leap:11,regular:10,monthCode:`M10`,days:29},Av:{leap:12,regular:11,monthCode:`M11`,days:30},Elul:{leap:13,regular:12,monthCode:`M12`,days:29}}}inLeapYear(e){let{year:t}=e;return(7*t+1)%19<7}monthsInYear(e){return this.inLeapYear(e)?13:12}minimumMonthLength(e){return this.minMaxMonthLength(e,`min`)}maximumMonthLength(e){return this.minMaxMonthLength(e,`max`)}minMaxMonthLength(e,t){let{month:n,year:r}=e,i=this.getMonthCode(r,n),a=Object.entries(this.months).find((e=>e[1].monthCode===i));if(a===void 0)throw RangeError(`unmatched Hebrew month: ${n}`);let o=a[1].days;return typeof o==`number`?o:o[t]}maxLengthOfMonthCodeInAnyYear(e){return[`M04`,`M06`,`M08`,`M10`,`M12`].includes(e)?29:30}estimateIsoDate(e){let{year:t}=e;return{year:t-3760,month:1,day:1}}getMonthCode(e,t){return this.inLeapYear({year:e})?t===6?hu(5,!0):hu(t<6?t:t-1):hu(t)}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthCode:o,day:s,monthExtra:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(c){let e=this.months[c];if(!e)throw RangeError(`Unrecognized month from formatToParts: ${c}`);a=this.inLeapYear({year:i})?e.leap:e.regular}return o=this.getMonthCode(i,a),{year:i,month:a,day:s,monthCode:o}}if(this.validateCalendarDate(e),a===void 0)if(o.endsWith(`L`)){if(o!==`M05L`)throw RangeError(`Hebrew leap month must have monthCode M05L, not ${o}`);if(a=6,!this.inLeapYear({year:i})){if(n===`reject`)throw RangeError(`Hebrew monthCode M05L is invalid in year ${i} which is not a leap year`);a=6,o=`M06`}}else{a=mu(o),this.inLeapYear({year:i})&&a>=6&&a++;let e=this.monthsInYear({year:i});if(a<1||a>e)throw RangeError(`Invalid monthCode: ${o}`)}else if(n===`reject`?(tl(a,1,this.monthsInYear({year:i})),tl(s,1,this.maximumMonthLength({year:i,month:a}))):(a=$c(a,1,this.monthsInYear({year:i})),s=$c(s,1,this.maximumMonthLength({year:i,month:a}))),o===void 0)o=this.getMonthCode(i,a);else if(this.getMonthCode(i,a)!==o)throw RangeError(`monthCode ${o} doesn't correspond to month ${a} in Hebrew year ${i}`);return{...e,day:s,month:a,monthCode:o,year:i}}},xu=class extends bu{constructor(){super(...arguments),this.calendarType=`lunar`,this.DAYS_PER_ISLAMIC_YEAR=354.3666666666667,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(e,t){let n={year:e.year,month:1,monthCode:`M01`,day:1},r={year:e.year+1,month:1,monthCode:`M01`,day:1};return this.calendarDaysUntil(n,r,t)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:Math.floor(t*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},mee=class extends xu{constructor(){super(...arguments),this.id=`islamic`}},hee=class extends xu{constructor(){super(...arguments),this.id=`islamic-umalqura`}},gee=class extends xu{constructor(){super(...arguments),this.id=`islamic-tbla`}},_ee=class extends xu{constructor(){super(...arguments),this.id=`islamic-civil`}},vee=class extends xu{constructor(){super(...arguments),this.id=`islamic-rgsa`}},yee=class extends xu{constructor(){super(...arguments),this.id=`islamicc`}},bee=class extends bu{constructor(){super(...arguments),this.id=`persian`,this.calendarType=`solar`}inLeapYear(e,t){return this.daysInMonth({year:e.year,month:12,day:1},t)===30}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===12?29:t<=6?31:30}maximumMonthLength(e){let{month:t}=e;return t===12?30:t<=6?31:30}maxLengthOfMonthCodeInAnyYear(e){return mu(e)<=6?31:30}estimateIsoDate(e){let{year:t}=this.adjustCalendarDate(e);return{year:t+621,month:1,day:1}}},xee=class extends bu{constructor(){super(...arguments),this.id=`indian`,this.calendarType=`solar`,this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date(`0000-01-01T00:00Z`).toLocaleDateString(`en-US-u-ca-indian`,{timeZone:`UTC`})!==`10/11/-79 Saka`}inLeapYear(e){return Su(e.year+78)}monthsInYear(){return 12}minimumMonthLength(e){return this.getMonthInfo(e).length}maximumMonthLength(e){return this.getMonthInfo(e).length}maxLengthOfMonthCodeInAnyYear(e){let t=mu(e),n=this.months[t];return n=n.leap??n,n.length}getMonthInfo(e){let{month:t}=e,n=this.months[t];if(n===void 0)throw RangeError(`Invalid month: ${t}`);return this.inLeapYear(e)&&n.leap&&(n=n.leap),n}estimateIsoDate(e){let t=this.adjustCalendarDate(e),n=this.getMonthInfo(t);return Jc(t.year+78+(n.nextYear?1:0),n.month,n.day+t.day-1)}checkIcuBugs(e){if(this.vulnerableToBceBug&&e.year<1)throw RangeError(`calendar '${this.id}' is broken for ISO dates before 0001-01-01 (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)`)}};function Su(e){return e%4==0&&(e%100!=0||e%400==0)}var Cu=class extends bu{constructor(e,t){super(),this.calendarType=`solar`,this.id=e,this.isoEpoch=t}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Su(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][mu(e)-1]}estimateIsoDate(e){let t=this.adjustCalendarDate(e);return ss(t.year+this.isoEpoch.year,t.month+this.isoEpoch.month,t.day+this.isoEpoch.day,`constrain`)}},wu=class extends bu{constructor(e,t){super(),this.hasEra=!0,this.calendarType=`solar`,this.id=e;let{eras:n,anchorEra:r}=function(e){let t,n=e;if(n.length===0)throw RangeError(`Invalid era data: eras are required`);if(n.length===1&&n[0].reverseOf)throw RangeError(`Invalid era data: anchor era cannot count years backwards`);if(n.length===1&&!n[0].code)throw RangeError(`Invalid era data: at least one named era is required`);if(n.filter((e=>e.reverseOf!=null)).length>1)throw RangeError(`Invalid era data: only one era can count years backwards`);n.forEach((e=>{if(e.isAnchor||!e.anchorEpoch&&!e.reverseOf){if(t)throw RangeError(`Invalid era data: cannot have multiple anchor eras`);t=e,e.anchorEpoch={year:e.hasYearZero?0:1}}else if(!e.code)throw RangeError(`If era name is blank, it must be the anchor era`)})),n=n.filter((e=>e.code)),n.forEach((e=>{let{reverseOf:t}=e;if(t){let r=n.find((e=>e.code===t));if(r===void 0)throw RangeError(`Invalid era data: unmatched reverseOf era: ${t}`);e.reverseOf=r,e.anchorEpoch=r.anchorEpoch,e.isoEpoch=r.isoEpoch}e.anchorEpoch.month===void 0&&(e.anchorEpoch.month=1),e.anchorEpoch.day===void 0&&(e.anchorEpoch.day=1)})),n.sort(((e,t)=>{if(e.reverseOf)return 1;if(t.reverseOf)return-1;if(!e.isoEpoch||!t.isoEpoch)throw RangeError(`Invalid era data: missing ISO epoch`);return t.isoEpoch.year-e.isoEpoch.year}));let r=n[n.length-1].reverseOf;if(r&&r!==n[n.length-2])throw RangeError(`Invalid era data: invalid reverse-sign era`);return n.forEach(((e,t)=>{e.genericName=`era`+(n.length-1-t)})),{eras:n,anchorEra:t||n[0]}}(t);this.anchorEra=r,this.eras=n}inLeapYear(e){let{year:t}=this.estimateIsoDate({month:1,day:1,year:e.year});return Su(t)}monthsInYear(){return 12}minimumMonthLength(e){let{month:t}=e;return t===2?this.inLeapYear(e)?29:28:[4,6,9,11].indexOf(t)>=0?30:31}maximumMonthLength(e){return this.minimumMonthLength(e)}maxLengthOfMonthCodeInAnyYear(e){return[31,29,31,30,31,30,31,31,30,31,30,31][mu(e)-1]}completeEraYear(e){let t=(t,n,r)=>{let i=e[t];if(i!=null&&i!=n&&!(r||[]).includes(i)){let e=r?.[0];throw RangeError(`Input ${t} ${i} doesn't match calculated value ${e?`${n} (also called ${e})`:n}`)}},n=t=>{let n,r={...e,year:t},i=this.eras.find(((e,i)=>{if(i===this.eras.length-1){if(e.reverseOf){if(t>0)throw RangeError(`Signed year ${t} is invalid for era ${e.code}`);return n=e.anchorEpoch.year-t,!0}return n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0}return this.compareCalendarDates(r,e.anchorEpoch)>=0&&(n=t-e.anchorEpoch.year+(e.hasYearZero?0:1),!0)}));if(!i)throw RangeError(`Year ${t} was not matched by any era`);return{eraYear:n,era:i.code,eraNames:i.names}},{year:r,eraYear:i,era:a}=e;if(r!=null){let e=n(r);({eraYear:i,era:a}=e),t(`era`,a,e?.eraNames),t(`eraYear`,i)}else{if(i==null)throw RangeError(`Either year or eraYear and era are required`);{if(a===void 0)throw RangeError(`era and eraYear must be provided together`);let e=this.eras.find((({code:e,names:t=[]})=>e===a||t.includes(a)));if(!e)throw RangeError(`Era ${a} (ISO year ${i}) was not matched by any era`);r=e.reverseOf?e.anchorEpoch.year-i:i+e.anchorEpoch.year-(e.hasYearZero?0:1),t(`year`,r),{eraYear:i,era:a}=n(r)}}return{...e,year:r,eraYear:i,era:a}}adjustCalendarDate(e,t,n=`constrain`){let r=e,{month:i,monthCode:a}=r;return i===void 0&&(r={...r,month:mu(a)}),this.validateCalendarDate(r),r=this.completeEraYear(r),super.adjustCalendarDate(r,t,n)}estimateIsoDate(e){let{year:t,month:n,day:r}=this.adjustCalendarDate(e),{anchorEra:i}=this;return ss(t+i.isoEpoch.year-(i.hasYearZero?0:1),n,r,`constrain`)}},Tu=class extends wu{constructor(e,t){super(e,t)}isoToCalendarDate(e){let{year:t,month:n,day:r}=e,i=hu(n),a=t-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:n,monthCode:i,day:r})}};const Eu={inLeapYear(e){let{year:t}=e;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(e){let{month:t}=e;return t===13?this.inLeapYear(e)?6:5:30},maximumMonthLength(e){return this.minimumMonthLength(e)},maxLengthOfMonthCodeInAnyYear:e=>e===`M13`?6:30};var See=class extends Cu{constructor(e,t){super(e,t),this.inLeapYear=Eu.inLeapYear,this.monthsInYear=Eu.monthsInYear,this.minimumMonthLength=Eu.minimumMonthLength,this.maximumMonthLength=Eu.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=Eu.maxLengthOfMonthCodeInAnyYear}},Du=class extends wu{constructor(e,t){super(e,t),this.inLeapYear=Eu.inLeapYear,this.monthsInYear=Eu.monthsInYear,this.minimumMonthLength=Eu.minimumMonthLength,this.maximumMonthLength=Eu.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=Eu.maxLengthOfMonthCodeInAnyYear}},Cee=class extends See{constructor(){super(`ethioaa`,{year:-5492,month:7,day:17})}},wee=class extends Du{constructor(){super(`coptic`,[{code:`coptic`,isoEpoch:{year:284,month:8,day:29}},{code:`coptic-inverse`,reverseOf:`coptic`}])}},Tee=class extends Du{constructor(){super(`ethiopic`,[{code:`ethioaa`,names:[`ethiopic-amete-alem`,`mundi`],isoEpoch:{year:-5492,month:7,day:17}},{code:`ethiopic`,names:[`incar`],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},Eee=class extends Tu{constructor(){super(`roc`,[{code:`roc`,names:[`minguo`],isoEpoch:{year:1912,month:1,day:1}},{code:`roc-inverse`,names:[`before-roc`],reverseOf:`roc`}])}},Dee=class extends Cu{constructor(){super(`buddhist`,{year:-543,month:1,day:1})}},Oee=class extends Tu{constructor(){super(`gregory`,[{code:`gregory`,names:[`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`gregory-inverse`,names:[`be`,`bce`],reverseOf:`gregory`}])}reviseIntlEra(e){let{era:t,eraYear:n}=e;return t===`b`&&(t=`gregory-inverse`),t===`a`&&(t=`gregory`),{era:t,eraYear:n}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},kee=class extends Tu{constructor(){super(`japanese`,[{code:`reiwa`,isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:`heisei`,isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:`showa`,isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:`taisho`,isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:`meiji`,isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:`japanese`,names:[`japanese`,`gregory`,`ad`,`ce`],isoEpoch:{year:1,month:1,day:1}},{code:`japanese-inverse`,names:[`japanese-inverse`,`gregory-inverse`,`bc`,`bce`],reverseOf:`japanese`}]),this.erasBeginMidYear=!0}reviseIntlEra(e,t){let{era:n,eraYear:r}=e,{year:i}=t;return this.eras.find((e=>e.code===n))?{era:n,eraYear:r}:i<1?{era:`japanese-inverse`,eraYear:1-i}:{era:`japanese`,eraYear:i}}},Ou=class extends bu{constructor(){super(...arguments),this.calendarType=`lunisolar`}inLeapYear(e,t){let n=this.getMonthList(e.year,t);return Object.entries(n).length===13}monthsInYear(e,t){return this.inLeapYear(e,t)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(e){return[`M01L`,`M09L`,`M10L`,`M11L`,`M12L`].includes(e)?29:30}monthDaySearchStartYear(e,t){let n={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[e]??[1972,1972];return t<30?n[0]:n[1]}getMonthList(e,t){if(e===void 0)throw TypeError(`Missing year`);let n=JSON.stringify({func:`getMonthList`,calendarYear:e,id:this.id}),r=t.get(n);if(r)return r;let i=this.getFormatter(),a=(e,t)=>{let n=vu({isoYear:e,isoMonth:2,isoDay:1}),r=new Date(n);r.setUTCDate(t+1);let a=i.formatToParts(r),o=a.find((e=>e.type===`month`)).value,s=+a.find((e=>e.type===`day`)).value,c=a.find((e=>e.type===`relatedYear`)),l;if(c===void 0)throw RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return l=+c.value,{calendarMonthString:o,calendarDay:s,calendarYearToVerify:l}},o=17,{calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o);s!==`1`&&(o+=29,{calendarMonthString:s,calendarDay:c}=a(e,o)),o-=c-5;let u={},d,f,p=1,m=!1;do({calendarMonthString:s,calendarDay:c,calendarYearToVerify:l}=a(e,o)),d&&(u[f].daysInMonth=d+30-c),l===e?(u[s]={monthIndex:p++},o+=30):m=!0,d=c,f=s;while(!m);return u[f].daysInMonth=d+30-c,t.set(n,u),u}estimateIsoDate(e){let{year:t,month:n}=e;return{year:t,month:n>=12?12:n+1,day:1}}adjustCalendarDate(e,t,n=`constrain`,r=!1){let{year:i,month:a,monthExtra:o,day:s,monthCode:c}=e;if(i===void 0)throw TypeError(`Missing property: year`);if(r){if(o&&o!==`bis`)throw RangeError(`Unexpected leap month suffix: ${o}`);let e=hu(a,o!==void 0),n=`${a}${o||``}`,r=this.getMonthList(i,t)[n];if(r===void 0)throw RangeError(`Unmatched month ${n} in Chinese year ${i}`);return a=r.monthIndex,{year:i,month:a,day:s,monthCode:e}}if(this.validateCalendarDate(e),a===void 0){let e=this.getMonthList(i,t),r=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));r[0]===`0`&&(r=r.slice(1));let o=e[r];if(a=o&&o.monthIndex,a===void 0&&c.endsWith(`L`)&&c!=`M13L`&&n===`constrain`){let t=+c.replace(/^M0?|L$/g,``);o=e[t],o&&(a=o.monthIndex,c=hu(t))}if(a===void 0)throw RangeError(`Unmatched month ${c} in Chinese year ${i}`)}else if(c===void 0){let e=this.getMonthList(i,t),r=Object.entries(e),o=r.length;n===`reject`?(tl(a,1,o),tl(s,1,this.maximumMonthLength())):(a=$c(a,1,o),s=$c(s,1,this.maximumMonthLength()));let l=r.find((e=>e[1].monthIndex===a));if(l===void 0)throw RangeError(`Invalid month ${a} in Chinese year ${i}`);c=hu(+l[0].replace(`bis`,``),l[0].indexOf(`bis`)!==-1)}else{let e=this.getMonthList(i,t),n=c.replace(/^M|L$/g,(e=>e===`L`?`bis`:``));n[0]===`0`&&(n=n.slice(1));let r=e[n];if(!r)throw RangeError(`Unmatched monthCode ${c} in Chinese year ${i}`);if(a!==r.monthIndex)throw RangeError(`monthCode ${c} doesn't correspond to month ${a} in Chinese year ${i}`)}return{...e,year:i,month:a,monthCode:c,day:s}}},Aee=class extends Ou{constructor(){super(...arguments),this.id=`chinese`}},jee=class extends Ou{constructor(){super(...arguments),this.id=`dangi`}},Mee=class{constructor(e){this.helper=e}extraFields(e){return this.helper.hasEra&&e.includes(`year`)?[`era`,`eraYear`]:[]}resolveFields(e){if(this.helper.calendarType!==`lunisolar`){let t=new _u;gu(e,void 0,this.helper.monthsInYear({year:e.year??1972},t))}}dateToISO(e,t){let n=new _u,r=this.helper.calendarToIsoDate(e,t,n);return n.setObject(r),r}monthDayToISOReferenceDate(e,t){let n=new _u,r=this.helper.monthDayFromFields(e,t,n);return n.setObject(r),r}fieldKeysToIgnore(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];switch(t.add(r),r){case`era`:t.add(`eraYear`),t.add(`year`);break;case`eraYear`:t.add(`era`),t.add(`year`);break;case`year`:t.add(`era`),t.add(`eraYear`);break;case`month`:t.add(`monthCode`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`monthCode`:t.add(`month`),this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`));break;case`day`:this.helper.erasBeginMidYear&&(t.add(`era`),t.add(`eraYear`))}}return uu(t)}dateAdd(e,{years:t,months:n,weeks:r,days:i},a){let o=_u.getCacheForObject(e),s=this.helper.isoToCalendarDate(e,o),c=this.helper.addCalendar(s,{years:t,months:n,weeks:r,days:i},a,o),l=this.helper.calendarToIsoDate(c,`constrain`,o);return _u.getCacheForObject(l)||new _u(o).setObject(l),l}dateUntil(e,t,n){let r=_u.getCacheForObject(e),i=_u.getCacheForObject(t),a=this.helper.isoToCalendarDate(e,r),o=this.helper.isoToCalendarDate(t,i);return this.helper.untilCalendar(a,o,n,r)}isoToDate(e,t){let n=_u.getCacheForObject(e),r=this.helper.isoToCalendarDate(e,n);if(t.dayOfWeek&&(r.dayOfWeek=pu.iso8601.isoToDate(e,{dayOfWeek:!0}).dayOfWeek),t.dayOfYear){let e=this.helper.startOfCalendarYear(r);r.dayOfYear=this.helper.calendarDaysUntil(e,r,n)+1}if(t.weekOfYear&&(r.weekOfYear=du(this.helper.id,e)),r.daysInWeek=7,t.daysInMonth&&(r.daysInMonth=this.helper.daysInMonth(r,n)),t.daysInYear){let e=this.helper.startOfCalendarYear(r),t=this.helper.addCalendar(e,{years:1},`constrain`,n);r.daysInYear=this.helper.calendarDaysUntil(e,t,n)}return t.monthsInYear&&(r.monthsInYear=this.helper.monthsInYear(r,n)),t.inLeapYear&&(r.inLeapYear=this.helper.inLeapYear(r,n)),r}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let e of[pee,bee,Tee,Cee,wee,Aee,jee,Eee,xee,Dee,Oee,kee,mee,hee,gee,_ee,vee,yee]){let t=new e;pu[t.id]=new Mee(t)}Ra(`calendarImpl`,(function(e){return pu[e]}));const ku=Intl.DateTimeFormat;function Au(e,t){let n=L(e,t);return typeof n==`function`&&(n=new ku(L(e,Da),n(L(e,Oa))),function(e,t,n){let r=ja(e);if(r===void 0)throw TypeError(`Missing slots for the given container`);if(r[t]===void 0)throw TypeError(`tried to reset ${t} which was not set`);r[t]=n}(e,t,n)),n}function ju(e){return Pa(e,Ca)}var Mu=class{constructor(e=void 0,t=void 0){(function(e,t,n){let r=n!==void 0,i;if(r){let e=[`localeMatcher`,`calendar`,`numberingSystem`,`hour12`,`hourCycle`,`timeZone`,`weekday`,`era`,`year`,`month`,`day`,`dayPeriod`,`hour`,`minute`,`second`,`fractionalSecondDigits`,`timeZoneName`,`formatMatcher`,`dateStyle`,`timeStyle`];i=function(e){if(e==null)throw TypeError(`Expected object not ${e}`);return Object(e)}(n);let t=Object.create(null);for(let n=0;n<e.length;n++){let r=e[n];Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}i=t}else i=Object.create(null);let a=new ku(t,i),o=a.resolvedOptions();if(Na(e),r){let t=Object.assign(Object.create(null),o);for(let e in t)Object.prototype.hasOwnProperty.call(i,e)||delete t[e];t.hour12=i.hour12,t.hourCycle=i.hourCycle,Fa(e,Oa,t)}else Fa(e,Oa,i);Fa(e,Da,o.locale),Fa(e,Ca,a),Fa(e,wa,o.timeZone),Fa(e,Ea,o.calendar),Fa(e,ya,Vee),Fa(e,`ym`,zee),Fa(e,`md`,Bee),Fa(e,ba,Ree),Fa(e,xa,Hee),Fa(e,Sa,Uee);let s=r?i.timeZone:void 0;if(s===void 0)Fa(e,Ta,o.timeZone);else{let t=Co(s);if(t.startsWith(`−`))throw RangeError(`Unicode minus (U+2212) is not supported in time zone offsets`);Fa(e,Ta,fc(t))}})(this,e,t)}get format(){R(this,ju);let e=Pee.bind(this);return Object.defineProperties(e,{length:{value:1,enumerable:!1,writable:!1,configurable:!0},name:{value:``,enumerable:!1,writable:!1,configurable:!0}}),e}formatRange(e,t){return R(this,ju),Iee.call(this,e,t)}formatToParts(e,...t){return R(this,ju),Fee.call(this,e,...t)}formatRangeToParts(e,t){return R(this,ju),Lee.call(this,e,t)}resolvedOptions(){return R(this,ju),Nee.call(this)}};`formatToParts`in ku.prototype||delete Mu.prototype.formatToParts,`formatRangeToParts`in ku.prototype||delete Mu.prototype.formatRangeToParts;const Nu=function(e=void 0,t=void 0){return new Mu(e,t)};function Nee(){let e=L(this,Ca).resolvedOptions();return e.timeZone=L(this,Ta),e}function Pee(e,...t){let n,r,i=Vu(e,this);return i.formatter?(n=i.formatter,r=[Zl(i.epochNs,`floor`)]):(n=L(this,Ca),r=[e,...t]),n.format(...r)}function Fee(e,...t){let n,r,i=Vu(e,this);return i.formatter?(n=i.formatter,r=[Zl(i.epochNs,`floor`)]):(n=L(this,Ca),r=[e,...t]),n.formatToParts(...r)}function Iee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=zu(e),r=zu(t),i,a=[n,r];if(Ru(n)!==Ru(r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);if(Ru(n)){if(!Bu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRange accepts two values of the same type`);let{epochNs:e,formatter:t}=Vu(n,this),{epochNs:o,formatter:s}=Vu(r,this);t&&(i=t,a=[Zl(e,`floor`),Zl(o,`floor`)])}return i||=L(this,Ca),i.formatRange(...a)}function Lee(e,t){if(e===void 0||t===void 0)throw TypeError(`Intl.DateTimeFormat.formatRange requires two values`);let n=zu(e),r=zu(t),i,a=[n,r];if(Ru(n)!==Ru(r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);if(Ru(n)){if(!Bu(n,r))throw TypeError(`Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type`);let{epochNs:e,formatter:t}=Vu(n,this),{epochNs:o,formatter:s}=Vu(r,this);t&&(i=t,a=[Zl(e,`floor`),Zl(o,`floor`)])}return i||=L(this,Ca),i.formatRangeToParts(...a)}function Pu(e={},t={}){let n=Object.assign({},e),r=[`year`,`month`,`day`,`hour`,`minute`,`second`,`weekday`,`dayPeriod`,`timeZoneName`,`dateStyle`,`timeStyle`];for(let e=0;e<r.length;e++){let i=r[e];n[i]=i in t?t[i]:n[i],!1!==n[i]&&n[i]!==void 0||delete n[i]}return n}function Ree(e){let t=Pu(e,{year:!1,month:!1,day:!1,weekday:!1,timeZoneName:!1,dateStyle:!1});if(t.timeStyle!==`long`&&t.timeStyle!==`full`||(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})),!Iu(t)){if(Lu(e))throw TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(e)}]`);Object.assign(t,{hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function zee(e){let t={short:{year:`2-digit`,month:`numeric`},medium:{year:`numeric`,month:`short`},long:{year:`numeric`,month:`long`},full:{year:`numeric`,month:`long`}},n=Pu(e,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`year`in n||`month`in n||`era`in n)){if(Lu(e))throw TypeError(`cannot format PlainYearMonth with options [${Object.keys(e)}]`);Object.assign(n,{year:`numeric`,month:`numeric`})}return n}function Bee(e){let t={short:{month:`numeric`,day:`numeric`},medium:{month:`short`,day:`numeric`},long:{month:`long`,day:`numeric`},full:{month:`long`,day:`numeric`}},n=Pu(e,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(`dateStyle`in n&&n.dateStyle){let e=n.dateStyle;delete n.dateStyle,Object.assign(n,t[e])}if(!(`month`in n)&&!(`day`in n)){if(Lu(e))throw TypeError(`cannot format PlainMonthDay with options [${Object.keys(e)}]`);Object.assign(n,{month:`numeric`,day:`numeric`})}return n}function Vee(e){let t=Pu(e,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!Fu(t)){if(Lu(e))throw TypeError(`cannot format PlainDate with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`})}return t}function Hee(e){let t=Pu(e,{timeZoneName:!1});if((t.timeStyle===`long`||t.timeStyle===`full`)&&(delete t.timeStyle,Object.assign(t,{hour:`numeric`,minute:`2-digit`,second:`2-digit`}),t.dateStyle)&&(Object.assign(t,{short:{year:`numeric`,month:`numeric`,day:`numeric`},medium:{year:`numeric`,month:`short`,day:`numeric`},long:{year:`numeric`,month:`long`,day:`numeric`},full:{year:`numeric`,month:`long`,day:`numeric`,weekday:`long`}}[t.dateStyle]),delete t.dateStyle),!Iu(t)&&!Fu(t)){if(Lu(e))throw TypeError(`cannot format PlainDateTime with options [${Object.keys(e)}]`);Object.assign(t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})}return t}function Uee(e){let t=e;return Iu(t)||Fu(t)||(t=Object.assign({},t,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`})),t}function Fu(e){return`year`in e||`month`in e||`day`in e||`weekday`in e||`dateStyle`in e||`era`in e}function Iu(e){return`hour`in e||`minute`in e||`second`in e||`timeStyle`in e||`dayPeriod`in e||`fractionalSecondDigits`in e}function Lu(e){return Fu(e)||Iu(e)||`dateStyle`in e||`timeStyle`in e||`timeZoneName`in e}function Ru(e){return Wo(e)||Go(e)||Ko(e)||Yo(e)||qo(e)||Jo(e)||Ho(e)}function zu(e){return Ru(e)?e:So(e)}function Bu(e,t){return!(!Ru(e)||!Ru(t)||Go(e)&&!Go(t)||Wo(e)&&!Wo(t)||Ko(e)&&!Ko(t)||Yo(e)&&!Yo(t)||qo(e)&&!qo(t)||Jo(e)&&!Jo(t)||Ho(e)&&!Ho(t))}function Vu(e,t){if(Go(e)){let n={isoDate:{year:1970,month:1,day:1},time:L(e,ra)};return{epochNs:_c(L(t,wa),n,`compatible`),formatter:Au(t,ba)}}if(qo(e)){let n=L(e,ia),r=L(t,Ea);if(n!==r)throw RangeError(`cannot format PlainYearMonth with calendar ${n} in locale with calendar ${r}`);let i=ds(L(e,ta),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,`ym`)}}if(Jo(e)){let n=L(e,ia),r=L(t,Ea);if(n!==r)throw RangeError(`cannot format PlainMonthDay with calendar ${n} in locale with calendar ${r}`);let i=ds(L(e,ta),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,`md`)}}if(Wo(e)){let n=L(e,ia),r=L(t,Ea);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDate with calendar ${n} in locale with calendar ${r}`);let i=ds(L(e,ta),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,ya)}}if(Ko(e)){let n=L(e,ia),r=L(t,Ea);if(n!==`iso8601`&&n!==r)throw RangeError(`cannot format PlainDateTime with calendar ${n} in locale with calendar ${r}`);let i=L(e,na);return{epochNs:_c(L(t,wa),i,`compatible`),formatter:Au(t,xa)}}if(Yo(e))throw TypeError(`Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.`);return Ho(e)?{epochNs:L(e,ea),formatter:Au(t,Sa)}:{}}function Hu(e){let t=Object.create(null);return t.years=L(e,la),t.months=L(e,ua),t.weeks=L(e,da),t.days=L(e,fa),t.hours=L(e,pa),t.minutes=L(e,ma),t.seconds=L(e,ha),t.milliseconds=L(e,ga),t.microseconds=L(e,_a),t.nanoseconds=L(e,va),t}Mu.prototype.constructor=Nu,Object.defineProperty(Nu,`prototype`,{value:Mu.prototype,writable:!1,enumerable:!1,configurable:!1}),Nu.supportedLocalesOf=ku.supportedLocalesOf,La(Nu,`Intl.DateTimeFormat`);const{format:Wee,formatToParts:Gee}=Intl.DurationFormat?.prototype??Object.create(null);function Uu(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Hu(Is(e));return Wee.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Uu,Intl.DurationFormat.prototype.formatToParts=function(e){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Hu(Is(e));return Gee.call(this,t)}),Object.freeze({__proto__:null,DateTimeFormat:Nu,ModifiedIntlDurationFormatPrototypeFormat:Uu});var Wu=class{constructor(e){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);ec(this,$l(e))}get epochMilliseconds(){return R(this,Ho),Zl(L(this,ea),`floor`)}get epochNanoseconds(){return R(this,Ho),uee(I.default.BigInt(L(this,ea)))}add(e){return R(this,Ho),Rl(`add`,this,e)}subtract(e){return R(this,Ho),Rl(`subtract`,this,e)}until(e,t=void 0){return R(this,Ho),Ol(`until`,this,e,t)}since(e,t=void 0){return R(this,Ho),Ol(`since`,this,e,t)}round(e){if(R(this,Ho),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs);return vs(n,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[i],!0),tc(Ul(L(this,ea),n,i,r))}equals(e){R(this,Ho);let t=Ls(e),n=L(this,ea),r=L(t,ea);return I.default.equal(I.default.BigInt(n),I.default.BigInt(r))}toString(e=void 0){R(this,Ho);let t=ru(e),n=ys(t),r=ms(t,`trunc`),i=Ss(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let a=t.timeZone;a!==void 0&&(a=fc(a));let{precision:o,unit:s,increment:c}=bs(i,n);return Tc(tc(Ul(L(this,ea),c,s,r)),a,o)}toJSON(){return R(this,Ho),Tc(this,void 0,`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Ho),new Nu(e,t).format(this)}valueOf(){cu(`Instant`)}toZonedDateTimeISO(e){R(this,Ho);let t=fc(e);return nc(L(this,ea),t,`iso8601`)}static fromEpochMilliseconds(e){return tc(Ql(So(e)))}static fromEpochNanoseconds(e){return tc($l(e))}static from(e){return Ls(e)}static compare(e,t){let n=Ls(e),r=Ls(t),i=L(n,ea),a=L(r,ea);return I.default.lessThan(i,a)?-1:I.default.greaterThan(i,a)?1:0}};La(Wu,`Temporal.Instant`);var Gu=class{constructor(e,t,n,r=`iso8601`){let i=wo(e),a=wo(t),o=wo(n),s=ou(r===void 0?`iso8601`:Oo(r));nl(i,a,o),Ws(this,{year:i,month:a,day:o},s)}get calendarId(){return R(this,Wo),L(this,ia)}get era(){return Ku(this,`era`)}get eraYear(){return Ku(this,`eraYear`)}get year(){return Ku(this,`year`)}get month(){return Ku(this,`month`)}get monthCode(){return Ku(this,`monthCode`)}get day(){return Ku(this,`day`)}get dayOfWeek(){return Ku(this,`dayOfWeek`)}get dayOfYear(){return Ku(this,`dayOfYear`)}get weekOfYear(){return Ku(this,`weekOfYear`)?.week}get yearOfWeek(){return Ku(this,`weekOfYear`)?.year}get daysInWeek(){return Ku(this,`daysInWeek`)}get daysInMonth(){return Ku(this,`daysInMonth`)}get daysInYear(){return Ku(this,`daysInYear`)}get monthsInYear(){return Ku(this,`monthsInYear`)}get inLeapYear(){return Ku(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Wo),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=As(n,L(this,ta));return r=rc(n,r,js(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Gs(lc(n,r,fs(ru(t))),n)}withCalendar(e){R(this,Wo);let t=oc(e);return Gs(L(this,ta),t)}add(e,t=void 0){return R(this,Wo),zl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Wo),zl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Wo),kl(`until`,this,e,t)}since(e,t=void 0){return R(this,Wo),kl(`since`,this,e,t)}equals(e){R(this,Wo);let t=Ns(e);return Jl(L(this,ta),L(t,ta))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){return R(this,Wo),Dc(this,gs(ru(e)))}toJSON(){return R(this,Wo),Dc(this)}toLocaleString(e=void 0,t=void 0){return R(this,Wo),new Nu(e,t).format(this)}valueOf(){cu(`PlainDate`)}toPlainDateTime(e=void 0){R(this,Wo);let t=Bs(e);return qs(ds(L(this,ta),t),L(this,ia))}toZonedDateTime(e){let t,n;if(R(this,Wo),xo(e)){let r=e.timeZone;r===void 0?t=fc(e):(t=fc(r),n=e.plainTime)}else t=fc(e);let r=L(this,ta),i;return n===void 0?i=bc(t,r):(n=zs(n),i=_c(t,ds(r,L(n,ra)),`compatible`)),nc(i,t,L(this,ia))}toPlainYearMonth(){R(this,Wo);let e=L(this,ia);return $s(uc(e,As(e,L(this,ta)),`constrain`),e)}toPlainMonthDay(){R(this,Wo);let e=L(this,ia);return Ys(dc(e,As(e,L(this,ta)),`constrain`),e)}static from(e,t=void 0){return Ns(e,t)}static compare(e,t){let n=Ns(e),r=Ns(t);return Jl(L(n,ta),L(r,ta))}};function Ku(e,t){R(e,Wo);let n=L(e,ta);return ks(e).isoToDate(n,{[t]:!0})[t]}La(Gu,`Temporal.PlainDate`);var qu=class{constructor(e,t,n,r=0,i=0,a=0,o=0,s=0,c=0,l=`iso8601`){let u=wo(e),d=wo(t),f=wo(n),p=r===void 0?0:wo(r),m=i===void 0?0:wo(i),h=a===void 0?0:wo(a),g=o===void 0?0:wo(o),_=s===void 0?0:wo(s),v=c===void 0?0:wo(c),y=ou(l===void 0?`iso8601`:Oo(l));al(u,d,f,p,m,h,g,_,v),Ks(this,{isoDate:{year:u,month:d,day:f},time:{hour:p,minute:m,second:h,millisecond:g,microsecond:_,nanosecond:v}},y)}get calendarId(){return R(this,Ko),L(this,ia)}get year(){return Ju(this,`year`)}get month(){return Ju(this,`month`)}get monthCode(){return Ju(this,`monthCode`)}get day(){return Ju(this,`day`)}get hour(){return Yu(this,`hour`)}get minute(){return Yu(this,`minute`)}get second(){return Yu(this,`second`)}get millisecond(){return Yu(this,`millisecond`)}get microsecond(){return Yu(this,`microsecond`)}get nanosecond(){return Yu(this,`nanosecond`)}get era(){return Ju(this,`era`)}get eraYear(){return Ju(this,`eraYear`)}get dayOfWeek(){return Ju(this,`dayOfWeek`)}get dayOfYear(){return Ju(this,`dayOfYear`)}get weekOfYear(){return Ju(this,`weekOfYear`)?.week}get yearOfWeek(){return Ju(this,`weekOfYear`)?.year}get daysInWeek(){return Ju(this,`daysInWeek`)}get daysInYear(){return Ju(this,`daysInYear`)}get daysInMonth(){return Ju(this,`daysInMonth`)}get monthsInYear(){return Ju(this,`monthsInYear`)}get inLeapYear(){return Ju(this,`inLeapYear`)}with(e,t=void 0){if(R(this,Ko),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=L(this,na),i={...As(n,r.isoDate),...r.time};return i=rc(n,i,js(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`],`partial`)),qs(Ps(n,i,fs(ru(t))),n)}withPlainTime(e=void 0){R(this,Ko);let t=Bs(e);return qs(ds(L(this,na).isoDate,t),L(this,ia))}withCalendar(e){R(this,Ko);let t=oc(e);return qs(L(this,na),t)}add(e,t=void 0){return R(this,Ko),Bl(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Ko),Bl(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Ko),Al(`until`,this,e,t)}since(e,t=void 0){return R(this,Ko),Al(`since`,this,e,t)}round(e){if(R(this,Ko),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];vs(n,a,a===1);let o=L(this,na);return qs(n===1&&i===`nanosecond`?o:Wl(o,n,i,r),L(this,ia))}equals(e){R(this,Ko);let t=Fs(e);return Xl(L(this,na),L(t,na))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){R(this,Ko);let t=ru(e),n=gs(t),r=ys(t),i=ms(t,`trunc`),a=Ss(t,`smallestUnit`,`time`,void 0);if(a===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:o,unit:s,increment:c}=bs(a,r),l=Wl(L(this,na),c,s,i);return ol(l),kc(l,L(this,ia),o,n)}toJSON(){return R(this,Ko),kc(L(this,na),L(this,ia),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Ko),new Nu(e,t).format(this)}valueOf(){cu(`PlainDateTime`)}toZonedDateTime(e,t=void 0){R(this,Ko);let n=fc(e),r=ps(ru(t));return nc(_c(n,L(this,na),r),n,L(this,ia))}toPlainDate(){return R(this,Ko),Gs(L(this,na).isoDate,L(this,ia))}toPlainTime(){return R(this,Ko),Zs(L(this,na).time)}static from(e,t=void 0){return Fs(e,t)}static compare(e,t){let n=Fs(e),r=Fs(t);return Xl(L(n,na),L(r,na))}};function Ju(e,t){R(e,Ko);let n=L(e,na).isoDate;return ks(e).isoToDate(n,{[t]:!0})[t]}function Yu(e,t){return R(e,Ko),L(e,na).time[t]}La(qu,`Temporal.PlainDateTime`);var Xu=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0){let u=e===void 0?0:Eo(e),d=t===void 0?0:Eo(t),f=n===void 0?0:Eo(n),p=r===void 0?0:Eo(r),m=i===void 0?0:Eo(i),h=a===void 0?0:Eo(a),g=o===void 0?0:Eo(o),_=s===void 0?0:Eo(s),v=c===void 0?0:Eo(c),y=l===void 0?0:Eo(l);ul(u,d,f,p,m,h,g,_,v,y),Na(this),Fa(this,la,u),Fa(this,ua,d),Fa(this,da,f),Fa(this,fa,p),Fa(this,pa,m),Fa(this,ma,h),Fa(this,ha,g),Fa(this,ga,_),Fa(this,_a,v),Fa(this,va,y)}get years(){return R(this,Uo),L(this,la)}get months(){return R(this,Uo),L(this,ua)}get weeks(){return R(this,Uo),L(this,da)}get days(){return R(this,Uo),L(this,fa)}get hours(){return R(this,Uo),L(this,pa)}get minutes(){return R(this,Uo),L(this,ma)}get seconds(){return R(this,Uo),L(this,ha)}get milliseconds(){return R(this,Uo),L(this,ga)}get microseconds(){return R(this,Uo),L(this,_a)}get nanoseconds(){return R(this,Uo),L(this,va)}get sign(){return R(this,Uo),Wc(this)}get blank(){return R(this,Uo),Wc(this)===0}with(t){R(this,Uo);let{years:n=L(this,la),months:r=L(this,ua),weeks:i=L(this,da),days:a=L(this,fa),hours:o=L(this,pa),minutes:s=L(this,ma),seconds:c=L(this,ha),milliseconds:l=L(this,ga),microseconds:u=L(this,_a),nanoseconds:d=L(this,va)}=ls(t);return new e(n,r,i,a,o,s,c,l,u,d)}negated(){return R(this,Uo),Qc(this)}abs(){return R(this,Uo),new e(Math.abs(L(this,la)),Math.abs(L(this,ua)),Math.abs(L(this,da)),Math.abs(L(this,fa)),Math.abs(L(this,pa)),Math.abs(L(this,ma)),Math.abs(L(this,ha)),Math.abs(L(this,ga)),Math.abs(L(this,_a)),Math.abs(L(this,va)))}add(e){return R(this,Uo),Ll(`add`,this,e)}subtract(e){return R(this,Uo),Ll(`subtract`,this,e)}round(e){if(R(this,Uo),e===void 0)throw TypeError(`options parameter is required`);let t=ws(this),n=typeof e==`string`?iu(`smallestUnit`,e):ru(e),r=Ss(n,`largestUnit`,`datetime`,void 0,[`auto`]),{plainRelativeTo:i,zonedRelativeTo:a}=Cs(n),o=_s(n),s=ms(n,`halfExpand`),c=Ss(n,`smallestUnit`,`datetime`,void 0),l=!0;c||=(l=!1,`nanosecond`);let u=Ts(t,c),d=!0;if(r||=(d=!1,u),r===`auto`&&(r=u),!l&&!d)throw RangeError(`at least one of smallestUnit or largestUnit is required`);if(Ts(r,c)!==r)throw RangeError(`largestUnit ${r} cannot be smaller than smallestUnit ${c}`);let f={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[c];if(f!==void 0&&vs(o,f,!1),o>1&&Ds(c)===`date`&&r!==c)throw RangeError(`For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit`);if(a){let e=dl(this),t=L(a,ca),n=L(a,ia),i=L(a,ea);return e=El(i,Il(i,t,n,e),t,n,r,o,c,s),Ds(r)===`date`&&(r=`hour`),ml(e,r)}if(i){let e=fl(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),n=L(i,ta),a=L(i,ia),l=ic(a,n,us(e.date,t.deltaDays),`constrain`);return e=Tl(ds(n,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),ds(l,t),a,r,o,c,s),ml(e,r)}if(Es(t))throw RangeError(`a starting point is required for ${t}s balancing`);if(Es(r))throw RangeError(`a starting point is required for ${r}s balancing`);let p=fl(this);if(c===`day`){let{quotient:e,remainder:t}=p.time.divmod(lo),n=p.date.days+e+ql(t,`day`);n=Hl(n,o,s),p=hl({years:0,months:0,weeks:0,days:n},Wa.ZERO)}else p=hl({years:0,months:0,weeks:0,days:0},Kl(p.time,o,c,s));return ml(p,r)}total(e){if(R(this,Uo),e===void 0)throw TypeError(`options argument is required`);let t=typeof e==`string`?iu(`unit`,e):ru(e),{plainRelativeTo:n,zonedRelativeTo:r}=Cs(t),i=Ss(t,`unit`,`datetime`,xs);if(r){let e=dl(this),t=L(r,ca),n=L(r,ia),a=L(r,ea);return function(e,t,n,r,i){return Ds(i)===`time`?ql(Wa.fromEpochNsDiff(t,e),i):wl(xl(e,t,n,r,i),t,gc(n,e),n,r,i)}(a,Il(a,t,n,e),t,n,i)}if(n){let e=fl(this),t=Pl({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},e.time),r=L(n,ta),a=L(n,ia),o=ic(a,r,us(e.date,t.deltaDays),`constrain`);return function(e,t,n,r){if(Xl(e,t)==0)return 0;ol(e),ol(t);let i=bl(e,t,n,r);return r===`nanosecond`?I.default.toNumber(i.time.totalNs):wl(i,Rc(t),e,null,n,r)}(ds(r,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),ds(o,t),a,i)}let a=ws(this);if(Es(a))throw RangeError(`a starting point is required for ${a}s total`);if(Es(i))throw RangeError(`a starting point is required for ${i}s total`);return ql(fl(this).time,i)}toString(e=void 0){R(this,Uo);let t=ru(e),n=ys(t),r=ms(t,`trunc`),i=Ss(t,`smallestUnit`,`time`,void 0);if(i===`hour`||i===`minute`)throw RangeError(`smallestUnit must be a time unit other than "hours" or "minutes"`);let{precision:a,unit:o,increment:s}=bs(i,n);if(o===`nanosecond`&&s===1)return Ec(this,a);let c=ws(this),l=dl(this),u=Kl(l.time,s,o,r);return l=hl(l.date,u),Ec(ml(l,Ts(c,`second`)),a)}toJSON(){return R(this,Uo),Ec(this,`auto`)}toLocaleString(e=void 0,t=void 0){if(R(this,Uo),typeof Intl.DurationFormat==`function`){let n=new Intl.DurationFormat(e,t);return Uu.call(n,this)}return console.warn(`Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat.`),Ec(this,`auto`)}valueOf(){cu(`Duration`)}static from(e){return Is(e)}static compare(e,t,n=void 0){let r=Is(e),i=Is(t),{plainRelativeTo:a,zonedRelativeTo:o}=Cs(ru(n));if(L(r,la)===L(i,la)&&L(r,ua)===L(i,ua)&&L(r,da)===L(i,da)&&L(r,fa)===L(i,fa)&&L(r,pa)===L(i,pa)&&L(r,ma)===L(i,ma)&&L(r,ha)===L(i,ha)&&L(r,ga)===L(i,ga)&&L(r,_a)===L(i,_a)&&L(r,va)===L(i,va))return 0;let s=ws(r),c=ws(i),l=dl(r),u=dl(i);if(o&&(Ds(s)===`date`||Ds(c)===`date`)){let e=L(o,ca),t=L(o,ia),n=L(o,ea),r=Il(n,e,t,l),i=Il(n,e,t,u);return nu(I.default.toNumber(I.default.subtract(r,i)))}let d=l.date.days,f=u.date.days;if(Es(s)||Es(c)){if(!a)throw RangeError(`A starting point is required for years, months, or weeks comparison`);d=Zc(l.date,a),f=Zc(u.date,a)}let p=l.time.add24HourDays(d),m=u.time.add24HourDays(f);return p.cmp(m)}};La(Xu,`Temporal.Duration`);var Zu=class{constructor(e,t,n=`iso8601`,r=1972){let i=wo(e),a=wo(t),o=ou(n===void 0?`iso8601`:Oo(n)),s=wo(r);nl(s,i,a),Js(this,{year:s,month:i,day:a},o)}get monthCode(){return Qu(this,`monthCode`)}get day(){return Qu(this,`day`)}get calendarId(){return R(this,Jo),L(this,ia)}with(e,t=void 0){if(R(this,Jo),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=As(n,L(this,ta),`month-day`);return r=rc(n,r,js(n,e,[`year`,`month`,`monthCode`,`day`],[],`partial`)),Ys(dc(n,r,fs(ru(t))),n)}equals(e){R(this,Jo);let t=Rs(e);return Jl(L(this,ta),L(t,ta))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){return R(this,Jo),Ac(this,gs(ru(e)))}toJSON(){return R(this,Jo),Ac(this)}toLocaleString(e=void 0,t=void 0){return R(this,Jo),new Nu(e,t).format(this)}valueOf(){cu(`PlainMonthDay`)}toPlainDate(e){if(R(this,Jo),!xo(e))throw TypeError(`argument should be an object`);let t=L(this,ia);return Gs(lc(t,rc(t,As(t,L(this,ta),`month-day`),js(t,e,[`year`],[],[])),`constrain`),t)}static from(e,t=void 0){return Rs(e,t)}};function Qu(e,t){R(e,Jo);let n=L(e,ta);return ks(e).isoToDate(n,{[t]:!0})[t]}function $u(e){return gc(e,eu())}La(Zu,`Temporal.PlainMonthDay`);const ed={instant:()=>tc(eu()),plainDateTimeISO:(e=tu())=>qs($u(fc(e)),`iso8601`),plainDateISO:(e=tu())=>Gs($u(fc(e)).isoDate,`iso8601`),plainTimeISO:(e=tu())=>Zs($u(fc(e)).time),timeZoneId:()=>tu(),zonedDateTimeISO:(e=tu())=>{let t=fc(e);return nc(eu(),t,`iso8601`)},[Symbol.toStringTag]:`Temporal.Now`};Object.defineProperty(ed,Symbol.toStringTag,{value:`Temporal.Now`,writable:!1,enumerable:!1,configurable:!0});var td=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0){let o=e===void 0?0:wo(e),s=t===void 0?0:wo(t),c=n===void 0?0:wo(n),l=r===void 0?0:wo(r),u=i===void 0?0:wo(i),d=a===void 0?0:wo(a);il(o,s,c,l,u,d),Xs(this,{hour:o,minute:s,second:c,millisecond:l,microsecond:u,nanosecond:d})}get hour(){return R(this,Go),L(this,ra).hour}get minute(){return R(this,Go),L(this,ra).minute}get second(){return R(this,Go),L(this,ra).second}get millisecond(){return R(this,Go),L(this,ra).millisecond}get microsecond(){return R(this,Go),L(this,ra).microsecond}get nanosecond(){return R(this,Go),L(this,ra).nanosecond}with(t,n=void 0){if(R(this,Go),!xo(t))throw TypeError(`invalid argument`);Xo(t);let r=Ms(t,`partial`),i=Ms(this),{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=Object.assign(i,r),d=fs(ru(n));return{hour:a,minute:o,second:s,millisecond:c,microsecond:l,nanosecond:u}=cs(a,o,s,c,l,u,d),new e(a,o,s,c,l,u)}add(e){return R(this,Go),Vl(`add`,this,e)}subtract(e){return R(this,Go),Vl(`subtract`,this,e)}until(e,t=void 0){return R(this,Go),jl(`until`,this,e,t)}since(e,t=void 0){return R(this,Go),jl(`since`,this,e,t)}round(e){if(R(this,Go),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs);return vs(n,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i],!1),Zs(Gl(L(this,ra),n,i,r))}equals(e){R(this,Go);let t=zs(e);return Yl(L(this,ra),L(t,ra))===0}toString(e=void 0){R(this,Go);let t=ru(e),n=ys(t),r=ms(t,`trunc`),i=Ss(t,`smallestUnit`,`time`,void 0);if(i===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let{precision:a,unit:o,increment:s}=bs(i,n);return Oc(Gl(L(this,ra),s,o,r),a)}toJSON(){return R(this,Go),Oc(L(this,ra),`auto`)}toLocaleString(e=void 0,t=void 0){return R(this,Go),new Nu(e,t).format(this)}valueOf(){cu(`PlainTime`)}static from(e,t=void 0){return zs(e,t)}static compare(e,t){let n=zs(e),r=zs(t);return Yl(L(n,ra),L(r,ra))}};La(td,`Temporal.PlainTime`);var nd=class{constructor(e,t,n=`iso8601`,r=1){let i=wo(e),a=wo(t),o=ou(n===void 0?`iso8601`:Oo(n)),s=wo(r);nl(i,a,s),Qs(this,{year:i,month:a,day:s},o)}get year(){return rd(this,`year`)}get month(){return rd(this,`month`)}get monthCode(){return rd(this,`monthCode`)}get calendarId(){return R(this,qo),L(this,ia)}get era(){return rd(this,`era`)}get eraYear(){return rd(this,`eraYear`)}get daysInMonth(){return rd(this,`daysInMonth`)}get daysInYear(){return rd(this,`daysInYear`)}get monthsInYear(){return rd(this,`monthsInYear`)}get inLeapYear(){return rd(this,`inLeapYear`)}with(e,t=void 0){if(R(this,qo),!xo(e))throw TypeError(`invalid argument`);Xo(e);let n=L(this,ia),r=As(n,L(this,ta),`year-month`);return r=rc(n,r,js(n,e,[`year`,`month`,`monthCode`],[],`partial`)),$s(uc(n,r,fs(ru(t))),n)}add(e,t=void 0){return R(this,qo),cee(`add`,this,e,t)}subtract(e,t=void 0){return R(this,qo),cee(`subtract`,this,e,t)}until(e,t=void 0){return R(this,qo),Ml(`until`,this,e,t)}since(e,t=void 0){return R(this,qo),Ml(`since`,this,e,t)}equals(e){R(this,qo);let t=Vs(e);return Jl(L(this,ta),L(t,ta))===0&&cc(L(this,ia),L(t,ia))}toString(e=void 0){return R(this,qo),nee(this,gs(ru(e)))}toJSON(){return R(this,qo),nee(this)}toLocaleString(e=void 0,t=void 0){return R(this,qo),new Nu(e,t).format(this)}valueOf(){cu(`PlainYearMonth`)}toPlainDate(e){if(R(this,qo),!xo(e))throw TypeError(`argument should be an object`);let t=L(this,ia);return Gs(lc(t,rc(t,As(t,L(this,ta),`year-month`),js(t,e,[`day`],[],[])),`constrain`),t)}static from(e,t=void 0){return Vs(e,t)}static compare(e,t){let n=Vs(e),r=Vs(t);return Jl(L(n,ta),L(r,ta))}};function rd(e,t){R(e,qo);let n=L(e,ta);return ks(e).isoToDate(n,{[t]:!0})[t]}La(nd,`Temporal.PlainYearMonth`);const Kee=Nu.prototype.resolvedOptions;var id=class{constructor(e,t,n=`iso8601`){if(arguments.length<1)throw TypeError(`missing argument: epochNanoseconds is required`);let r=$l(e),i=Oo(t),{tzName:a,offsetMinutes:o}=os(i);if(o===void 0){let e=Nc(a);if(!e)throw RangeError(`unknown time zone ${a}`);i=e.identifier}else i=Ic(o);eee(this,r,i,ou(n===void 0?`iso8601`:Oo(n)))}get calendarId(){return R(this,Yo),L(this,ia)}get timeZoneId(){return R(this,Yo),L(this,ca)}get year(){return od(this,`year`)}get month(){return od(this,`month`)}get monthCode(){return od(this,`monthCode`)}get day(){return od(this,`day`)}get hour(){return sd(this,`hour`)}get minute(){return sd(this,`minute`)}get second(){return sd(this,`second`)}get millisecond(){return sd(this,`millisecond`)}get microsecond(){return sd(this,`microsecond`)}get nanosecond(){return sd(this,`nanosecond`)}get era(){return od(this,`era`)}get eraYear(){return od(this,`eraYear`)}get epochMilliseconds(){return R(this,Yo),Zl(L(this,ea),`floor`)}get epochNanoseconds(){return R(this,Yo),uee(L(this,ea))}get dayOfWeek(){return od(this,`dayOfWeek`)}get dayOfYear(){return od(this,`dayOfYear`)}get weekOfYear(){return od(this,`weekOfYear`)?.week}get yearOfWeek(){return od(this,`weekOfYear`)?.year}get hoursInDay(){R(this,Yo);let e=L(this,ca),t=ad(this).isoDate,n=Jc(t.year,t.month,t.day+1),r=bc(e,t),i=bc(e,n);return ql(Wa.fromEpochNsDiff(i,r),`hour`)}get daysInWeek(){return od(this,`daysInWeek`)}get daysInMonth(){return od(this,`daysInMonth`)}get daysInYear(){return od(this,`daysInYear`)}get monthsInYear(){return od(this,`monthsInYear`)}get inLeapYear(){return od(this,`inLeapYear`)}get offset(){return R(this,Yo),hc(mc(L(this,ca),L(this,ea)))}get offsetNanoseconds(){return R(this,Yo),mc(L(this,ca),L(this,ea))}with(e,t=void 0){if(R(this,Yo),!xo(e))throw TypeError(`invalid zoned-date-time-like`);Xo(e);let n=L(this,ia),r=L(this,ca),i=mc(r,L(this,ea)),a=ad(this),o={...As(n,a.isoDate),...a.time,offset:hc(i)};o=rc(n,o,js(n,e,[`year`,`month`,`monthCode`,`day`],[`hour`,`minute`,`second`,`millisecond`,`microsecond`,`nanosecond`,`offset`],`partial`));let s=ru(t),c=ps(s),l=hs(s,`prefer`),u=Ps(n,o,fs(s)),d=jc(o.offset);return nc(Hs(u.isoDate,u.time,`option`,d,r,c,l,!1),r,n)}withPlainTime(e=void 0){R(this,Yo);let t=L(this,ca),n=L(this,ia),r=ad(this).isoDate,i;return i=e===void 0?bc(t,r):_c(t,ds(r,L(zs(e),ra)),`compatible`),nc(i,t,n)}withTimeZone(e){R(this,Yo);let t=fc(e);return nc(L(this,ea),t,L(this,ia))}withCalendar(e){R(this,Yo);let t=oc(e);return nc(L(this,ea),L(this,ca),t)}add(e,t=void 0){return R(this,Yo),lee(`add`,this,e,t)}subtract(e,t=void 0){return R(this,Yo),lee(`subtract`,this,e,t)}until(e,t=void 0){return R(this,Yo),Nl(`until`,this,e,t)}since(e,t=void 0){return R(this,Yo),Nl(`since`,this,e,t)}round(e){if(R(this,Yo),e===void 0)throw TypeError(`options parameter is required`);let t=typeof e==`string`?iu(`smallestUnit`,e):ru(e),n=_s(t),r=ms(t,`halfExpand`),i=Ss(t,`smallestUnit`,`time`,xs,[`day`]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[i];if(vs(n,a,a===1),i===`nanosecond`&&n===1)return nc(L(this,ea),L(this,ca),L(this,ia));let o=L(this,ca),s=L(this,ea),c=ad(this),l;if(i===`day`){let e=c.isoDate,t=Jc(e.year,e.month,e.day+1),n=bc(o,e),i=bc(o,t),a=I.default.subtract(i,n);l=Wa.fromEpochNsDiff(s,n).round(a,r).addToEpochNs(n)}else{let e=Wl(c,n,i,r),t=mc(o,s);l=Hs(e.isoDate,e.time,`option`,t,o,`compatible`,`prefer`,!1)}return nc(l,o,L(this,ia))}equals(e){R(this,Yo);let t=Us(e),n=L(this,ea),r=L(t,ea);return!!I.default.equal(I.default.BigInt(n),I.default.BigInt(r))&&!!pc(L(this,ca),L(t,ca))&&cc(L(this,ia),L(t,ia))}toString(e=void 0){R(this,Yo);let t=ru(e),n=gs(t),r=ys(t),i=function(e){return au(e,`offset`,[`auto`,`never`],`auto`)}(t),a=ms(t,`trunc`),o=Ss(t,`smallestUnit`,`time`,void 0);if(o===`hour`)throw RangeError(`smallestUnit must be a time unit other than "hour"`);let s=function(e){return au(e,`timeZoneName`,[`auto`,`never`,`critical`],`auto`)}(t),{precision:c,unit:l,increment:u}=bs(o,r);return ree(this,c,n,s,i,{unit:l,increment:u,roundingMode:a})}toLocaleString(e=void 0,t=void 0){R(this,Yo);let n=ru(t),r=Object.create(null);if(function(e,t,n,r){if(t==null)return;let i=Reflect.ownKeys(t);for(let r=0;r<i.length;r++){let a=i[r];!n.some((e=>Object.is(e,a)))&&Object.prototype.propertyIsEnumerable.call(t,a)&&(e[a]=t[a])}}(r,n,[`timeZone`]),n.timeZone!==void 0)throw TypeError(`ZonedDateTime toLocaleString does not accept a timeZone option`);if(r.year===void 0&&r.month===void 0&&r.day===void 0&&r.era===void 0&&r.weekday===void 0&&r.dateStyle===void 0&&r.hour===void 0&&r.minute===void 0&&r.second===void 0&&r.fractionalSecondDigits===void 0&&r.timeStyle===void 0&&r.dayPeriod===void 0&&r.timeZoneName===void 0&&(r.timeZoneName=`short`),r.timeZone=L(this,ca),iee(r.timeZone))throw RangeError(`toLocaleString does not currently support offset time zones`);let i=new Nu(e,r),a=Kee.call(i).calendar,o=L(this,ia);if(o!==`iso8601`&&a!==`iso8601`&&!cc(a,o))throw RangeError(`cannot format ZonedDateTime with calendar ${o} in locale with calendar ${a}`);return i.format(tc(L(this,ea)))}toJSON(){return R(this,Yo),ree(this,`auto`)}valueOf(){cu(`ZonedDateTime`)}startOfDay(){R(this,Yo);let e=L(this,ca);return nc(bc(e,ad(this).isoDate),e,L(this,ia))}getTimeZoneTransition(e){R(this,Yo);let t=L(this,ca);if(e===void 0)throw TypeError(`options parameter is required`);let n=au(typeof e==`string`?iu(`direction`,e):ru(e),`direction`,[`next`,`previous`],xs);if(n===void 0)throw TypeError(`direction option is required`);if(iee(t)||t===`UTC`)return null;let r=L(this,ea),i=n===`next`?zc(t,r):Bc(t,r);return i===null?null:nc(i,t,L(this,ia))}toInstant(){return R(this,Yo),tc(L(this,ea))}toPlainDate(){return R(this,Yo),Gs(ad(this).isoDate,L(this,ia))}toPlainTime(){return R(this,Yo),Zs(ad(this).time)}toPlainDateTime(){return R(this,Yo),qs(ad(this),L(this,ia))}static from(e,t=void 0){return Us(e,t)}static compare(e,t){let n=Us(e),r=Us(t),i=L(n,ea),a=L(r,ea);return I.default.lessThan(I.default.BigInt(i),I.default.BigInt(a))?-1:I.default.greaterThan(I.default.BigInt(i),I.default.BigInt(a))?1:0}};function ad(e){return gc(L(e,ca),L(e,ea))}function od(e,t){R(e,Yo);let n=ad(e).isoDate;return ks(e).isoToDate(n,{[t]:!0})[t]}function sd(e,t){return R(e,Yo),ad(e).time[t]}La(id,`Temporal.ZonedDateTime`);var cd=Object.freeze({__proto__:null,Duration:Xu,Instant:Wu,Now:ed,PlainDate:Gu,PlainDateTime:qu,PlainMonthDay:Zu,PlainTime:td,PlainYearMonth:nd,ZonedDateTime:id});(class{toTemporalInstant(){return tc(Ql(Date.prototype.valueOf.call(this)))}}).prototype.toTemporalInstant;const qee=[Wu,Gu,qu,Xu,Zu,td,nd,id];for(let e of qee){let t=Object.getOwnPropertyDescriptor(e,`prototype`);(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(e,`prototype`,t))}const Jee=Symbol.for(`drizzle:CockroachMaterializedViewConfig`);function Yee(e){return{...e[te]}}function Xee(e){return{...e[te],...e[Jee]}}const Zee=Symbol.for(`drizzle:MsSqlViewConfig`);function Qee(e){return{...e[te],...e[Zee]}}const ld=Ot(import.meta.url);var $ee=Object.create,ud=Object.defineProperty,ete=Object.getOwnPropertyDescriptor,dd=Object.getOwnPropertyNames,tte=Object.getPrototypeOf,nte=Object.prototype.hasOwnProperty,z=(e=>ld===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(ld===void 0?e:ld)[t]}):e:ld)(function(e){if(ld!==void 0)return ld.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),B=(e,t)=>function(){return e&&(t=(0,e[dd(e)[0]])(e=0)),t},V=(e,t)=>function(){return t||(0,e[dd(e)[0]])((t={exports:{}}).exports,t),t.exports},fd=(e,t)=>{for(var n in t)ud(e,n,{get:t[n],enumerable:!0})},pd=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of dd(t))!nte.call(e,i)&&i!==n&&ud(e,i,{get:()=>t[i],enumerable:!(r=ete(t,i))||r.enumerable});return e},md=(e,t,n)=>(n=e==null?{}:$ee(tte(e)),pd(t||!e||!e.__esModule?ud(n,`default`,{value:e,enumerable:!0}):n,e)),hd=e=>pd(ud({},`__esModule`,{value:!0}),e);function gd(e,t){for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let t=e[n];if(r&&typeof r==`object`&&r.CONTAINS!==void 0){if(!Array.isArray(t)||!t.find(e=>xd(e,r.CONTAINS)))return!1}else if(!xd(t,r))return!1}return!0}function _d(e,t){return e.filter(e=>gd(e,t))}function vd(e){return`${e.schema??``}:${e.table??``}:${e.name}:${e.entityType}`}function rte(e,t){let n=vd(t);return e.find(e=>vd(e)===n)}function ite(e,t){let n=vd(t);return e.filter(e=>vd(e)===n)}function yd(e,t,n=!1){if(typeof e!=`object`||!e)return!1;for(let r of Array.from(new Set([...Object.keys(e),...Object.keys(t)])))if(!(!n&&r===`entityType`)){if(!t[r])return!1;if(t[r]===`string[]`){if(!Array.isArray(e[r])||!e[r].every(e=>typeof e==`string`))return!1}else if(typeof t[r]==`string`){let n=t[r].endsWith(`?`);if(e[r]===null&&!n||e[r]!==null&&typeof e[r]!==Ed(t[r]))return!1}else if(Array.isArray(t[r])){if(typeof t[r][0]==`string`){if(!t[r].some(t=>t===e[r]))return!1}else if(!Array.isArray(e[r])||!e[r].every(e=>yd(e,t[r][0]),!0))return!1}else if(e[r]!==null&&!yd(e[r],t[r],!0))return!1}return!0}function bd({entities:e},t,n,r){let i=Object.entries(e),a=Object.fromEntries(Object.entries(n?r:e).map(([e,t])=>[e,Object.keys(t).filter(e=>e in Od).length+4]));return Object.fromEntries(i.map(([i,o])=>[i,{push:kd(n?r:e,t,n?void 0:i),list:Ad(t,n?void 0:i),one:jd(t,n?void 0:i),update:Md(t,n?void 0:i),delete:Nd(t,n?void 0:i),validate:Fd(n?r:e,n?void 0:i),hasDiff:Pd(a)}]))}function xd(e,t){return typeof e==typeof t?Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>xd(e,t[n])):!1:typeof e==`object`?e===t?!0:(e===null||t===null)&&e!==t?!1:Array.from(new Set([...Object.keys(e),...Object.keys(t)])).every(n=>xd(e[n],t[n])):e===t:!1}function Sd(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!Id[e]))}function Cd(e){let t={};for(let n of Object.keys(Od))e[n]===void 0||e[n]===null||(t[n]=e[n]);return t}function wd(e,t,n,r){n??=`entities`,r??=`all`;let i=e.entities.list(n===`entities`?void 0:{entityType:n}),a=t.entities.list(n===`entities`?void 0:{entityType:n}),o={},s={};for(let e of i)o[vd(e)]=e;for(let e of a)s[vd(e)]=e;let c=[],l=[],u=[];for(let[e,t]of Object.entries(o)){let n=s[e];if(!n)(r===`all`||r===`drop`||r===`createdrop`)&&l.push({$diffType:`drop`,entityType:t.entityType,...Cd(t),...Sd(t)});else if(r===`all`||r===`alter`){let e={},r=!1;for(let[i,a]of Object.entries(t))Id[i]||xd(t[i],n[i])||(r=!0,e[i]={from:t[i],to:n[i]});r&&u.push({$diffType:`alter`,entityType:n.entityType,...Cd(n),...e,$left:t,$right:n})}delete s[e]}if(r===`all`||r===`create`||r===`createdrop`)for(let e of Object.values(s))c.push({$diffType:`create`,entityType:e.entityType,...Cd(e),...Sd(e)});return[...c,...l,...u]}function Td(e,t,n){return wd(e,t,n,`createdrop`)}function Ed(e){return e.endsWith(`?`)?e.slice(0,e.length-1):e}function Dd(e){let t=new Ld(e),n=bd(t._,t._.store,!1);for(let[e,r]of Object.entries(n))t[e]=r;return t}var Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd=B({"src/dialects/dialect.ts"(){Od={schema:`string?`,table:`string?`,name:`string`},kd=(e,t,n)=>{let r=n?Object.fromEntries(Object.keys(e[n]).filter(e=>!Od[e]||!Od[e].endsWith(`?`)).map(e=>[e,null])):void 0;return(i,a)=>{let o=Object.fromEntries(Object.entries(i).filter(([e,t])=>t!==void 0)),s=n??o.entityType,c={...r??Object.fromEntries(Object.keys(e[s]).map(e=>[e,null])),...o,entityType:s},l=a?t.collection.find(e=>{if(e.entityType!==c.entityType)return!1;for(let t of a)if(t in c&&!xd(c[t],e[t]))return!1;return!0}):rte(t.collection,c);return l?{status:`CONFLICT`,data:l}:(t.collection.push(c),{status:`OK`,data:c})}},Ad=(e,t)=>n=>{let r=t?_d(e.collection,{entityType:t}):e.collection;return n?_d(r,n):r},jd=(e,t)=>n=>{let r=t?_d(e.collection,{entityType:t}):e.collection;return n?_d(r,n)[0]??null:r[0]??null},Md=(e,t)=>({set:n,where:r})=>{let i=t?{...r,entityType:t}:r,a=i?_d(e.collection,i):e.collection,o=Object.entries(n),s=[],c=0,l=[];for(let t of a){let n={...t};for(let[e,r]of o){if(!(e in t))continue;let i=t[e];n[e]=typeof r==`function`?Array.isArray(i)?i.map(r):r(i):r}let r=ite(e.collection,n).filter(e=>e!==t);l.push(...r.filter(e=>!l.find(t=>t===e))),r.length||s.push({item:n,index:c++})}if(l.length)return{status:`CONFLICT`,data:l};for(let{index:e,item:t}of s)Object.assign(a[e],t);return{status:`OK`,data:a}},Nd=(e,t)=>n=>{let r=[],i=[],a=t?{...n,entityType:t}:n;return a?(e.collection.forEach(e=>{gd(e,a)?i.push(e):r.push(e)}),e.collection=r,i):(e.collection=r,i)},Pd=e=>t=>{let n=e[t.entityType];return Object.keys(t).length>n},Fd=(e,t)=>(n=>{if(typeof n!=`object`||!n)return!1;let r=t??n.entityType;if(typeof r!=`string`||n.entityType!==r)return!1;let i=e[r];return i?yd(n,i):!1}),Id={entityType:!0,name:!0,schema:!0,table:!0},(e=>{function t(e,t,n){return wd(e,t,n,`all`)}e.all=t;function n(e,t,n){return wd(e,t,n,`create`)}e.creates=n;function r(e,t,n){return wd(e,t,n,`drop`)}e.drops=r;function i(e,t,n){return wd(e,t,n,`alter`)}e.alters=i})(Td||={}),Ld=class{_={diffs:{},store:{collection:[]}};entities;constructor(e){let t=Object.entries(e),n=Object.fromEntries(t.map(([e,t])=>{if(e===`entities`||e===`_`)throw Error(`Illegal entity type name: "${e}"`);let n={};for(let r in Object.entries(t).forEach(([t,r])=>{if(n[t]=r,r===`required`){if(!(t in Od))throw Error(`Type value "required" is only applicable to common keys [ ${Object.keys(Od).map(e=>`"${e}"`).join(`, `)} ], used on: "${t}"`);n[t]=Ed(Od[t])}else if(t in Od)throw Error(`Used forbidden key "${t}" in entity "${e}"`)}),Od)Od[r].endsWith(`?`)||(n[r]=Od[r]);return[e,n]}));this._.entities=n,this.entities=bd({...this._,entities:{entities:Od}},this._.store,!0,this._.entities).entities}}}});function zd(e){throw Error(`Didn't expect to get here`)}function Bd(e){return e.replace(/'/g,`''`)}function Vd(e,t,n,r=0){if(!Array.isArray(e))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)?Vd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Hd(e,t,n,r=0){if(!e.find(e=>Array.isArray(e)))return n(e,r);r+=1;let i=e.map(e=>Array.isArray(e)&&e.find(e=>Array.isArray(e))?Hd(e,t,n,r):n(e,r)).join(`,`);return t===`ts`?`[${i}]`:t===`geometry-sql`?`ARRAY[${i}]`:`{${i}}`}function Ud(e){return tf.test(e)}function Wd(e){let t={},n=e.split(` `);if(n.length===1)return t;let r=n.slice(1,n.length).join(` `);if(nf.includes(r))return{...t,fields:r};for(let e of nf)if(r.startsWith(`${e}(`))return{...t,fields:e};return t}function Gd(e){let t=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)},n=(e,t)=>{let n=new ArrayBuffer(8),r=new DataView(n);for(let n=0;n<8;n++)r.setUint8(n,e[t+n]);return r.getFloat64(0,!0)},r=t(e),i=0,a=r[i];i+=1;let o=new DataView(r.buffer),s=o.getUint32(i,a===1);i+=4;let c;if(s&536870912&&(c=o.getUint32(i,a===1),i+=4),(s&65535)==1){let e=n(r,i);i+=8;let t=n(r,i);return i+=8,{srid:c,point:[e,t]}}throw Error(`Unsupported geometry type`)}var Kd,qd,H,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf=B({"src/utils/index.ts"(){Kd=`00000000-0000-0000-0000-000000000000`,qd=e=>e.map(e=>{let t=e.from.schema?`${e.from.schema}.`:``,n=e.to.schema?`${e.to.schema}.`:``,r=e.from.table?`${e.from.table}.`:``,i=e.to.table?`${e.to.table}.`:``;return`${t}${r}${e.from.name}->${n}${i}${e.to.name}`}),H=(e,t)=>e.length<2?e:typeof t==`string`&&e.startsWith(t)&&e.endsWith(t)||Array.isArray(t)&&e.startsWith(t[0])&&e.endsWith(t[1])?e.substring(1,e.length-1):e,Jd=(e,t)=>!e.startsWith(t)||!e.endsWith(t)?`${t}${e}${t}`:e,Yd=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?/,Xd=e=>Yd.test(e),Zd=/^\d{4}-\d{2}-\d{2}/,Qd=e=>Zd.test(e),$d=/^(\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?|\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)$/,ef=e=>$d.test(e),tf=/([+-]\d{2}(:\d{2})?|Z)$/i,nf=[`year`,`month`,`day`,`hour`,`minute`,`second`,`year to month`,`day to hour`,`day to minute`,`day to second`,`hour to minute`,`hour to second`,`minute to second`]}}),af={};fd(af,{StringBuffer:()=>_f,abstract:()=>of,assert:()=>sf,checkNotNull:()=>cte,clone:()=>ate,copyWithoutDuplicates:()=>pf,defineLazyProperty:()=>cf,getDuplicates:()=>ff,isLexical:()=>hf,isSyntactic:()=>mf,padLeft:()=>gf,repeat:()=>df,repeatFn:()=>lf,repeatStr:()=>uf,unescapeCodePoint:()=>ote,unexpectedObjToString:()=>ste});function of(e){let t=e||``;return function(){throw Error(`this method `+t+` is abstract! (it has no implementation in class `+this.constructor.name+`)`)}}function sf(e,t){if(!e)throw Error(t||`Assertion failed`)}function cf(e,t,n){let r;Object.defineProperty(e,t,{get(){return r||=n.call(this),r}})}function ate(e){return e&&Object.assign({},e)}function lf(e,t){let n=[];for(;t-- >0;)n.push(e());return n}function uf(e,t){return Array(t+1).join(e)}function df(e,t){return lf(()=>e,t)}function ff(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];e.lastIndexOf(r)!==n&&t.indexOf(r)<0&&t.push(r)}return t}function pf(e){let t=[];return e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),t}function mf(e){let t=e[0];return t===t.toUpperCase()}function hf(e){return!mf(e)}function gf(e,t,n){let r=n||` `;return e.length<t?uf(r,t-e.length)+e:e}function _f(){this.strings=[]}function ote(e){if(e.charAt(0)===`\\`)switch(e.charAt(1)){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
|
|
84
84
|
`;case`r`:return`\r`;case`t`:return` `;case`v`:return`\v`;case`x`:return yf(e.slice(2,4));case`u`:return e.charAt(2)===`{`?yf(e.slice(3,-1)):yf(e.slice(2,6));default:return e.charAt(1)}else return e}function ste(e){if(e==null)return String(e);let t=Object.prototype.toString.call(e);try{let n;return n=e.constructor&&e.constructor.name?e.constructor.name:t.indexOf(`[object `)===0?t.slice(8,-1):typeof e,n+`: `+JSON.stringify(String(e))}catch{return t}}function cte(e,t=`unexpected null value`){if(e==null)throw Error(t);return e}var vf,yf,bf=B({"../node_modules/.pnpm/ohm-js@17.2.1/node_modules/ohm-js/src/common.js"(){vf={};for(let e=0;e<128;e++)vf[e]=String.fromCharCode(e);vf[39]=`\\'`,vf[34]=`\\"`,vf[92]=`\\\\`,vf[8]=`\\b`,vf[12]=`\\f`,vf[10]=`\\n`,vf[13]=`\\r`,vf[9]=`\\t`,vf[11]=`\\v`,_f.prototype.append=function(e){this.strings.push(e)},_f.prototype.contents=function(){return this.strings.join(``)},yf=e=>String.fromCodePoint(parseInt(e,16))}}),lte,ute=B({"../node_modules/.pnpm/ohm-js@17.2.1/node_modules/ohm-js/src/UnicodeCategories.js"(){lte={Lu:/\p{Lu}/u,Ll:/\p{Ll}/u,Lt:/\p{Lt}/u,Lm:/\p{Lm}/u,Lo:/\p{Lo}/u,Nl:/\p{Nl}/u,Nd:/\p{Nd}/u,Mn:/\p{Mn}/u,Mc:/\p{Mc}/u,Pc:/\p{Pc}/u,Zs:/\p{Zs}/u,L:/\p{Letter}/u,Ltmo:/\p{Lt}|\p{Lm}|\p{Lo}/u}}}),xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf=B({"../node_modules/.pnpm/ohm-js@17.2.1/node_modules/ohm-js/src/pexprs-main.js"(){ute(),bf(),xf=class e{constructor(){if(this.constructor===e)throw Error(`PExpr cannot be instantiated -- it's abstract`)}withSource(e){return e&&(this.source=e.trimmed()),this}},Sf=Object.create(xf.prototype),Cf=Object.create(xf.prototype),wf=class extends xf{constructor(e){super(),this.obj=e}},Tf=class extends xf{constructor(e,t){super(),this.from=e,this.to=t,this.matchCodePoint=e.length>1||t.length>1}},Ef=class extends xf{constructor(e){super(),this.index=e}},Df=class extends xf{constructor(e){super(),this.terms=e}},Of=class extends Df{constructor(e,t,n){let r=e.rules[t].body;super([n,r]),this.superGrammar=e,this.name=t,this.body=n}},kf=class extends Df{constructor(e,t,n,r){let i=e.rules[t].body;super([...n,i,...r]),this.superGrammar=e,this.ruleName=t,this.expansionPos=n.length}},Af=class extends xf{constructor(e){super(),this.factors=e}},jf=class extends xf{constructor(e){super(),this.expr=e}},Mf=class extends jf{},Nf=class extends jf{},Pf=class extends jf{},Mf.prototype.operator=`*`,Nf.prototype.operator=`+`,Pf.prototype.operator=`?`,Mf.prototype.minNumMatches=0,Nf.prototype.minNumMatches=1,Pf.prototype.minNumMatches=0,Mf.prototype.maxNumMatches=1/0,Nf.prototype.maxNumMatches=1/0,Pf.prototype.maxNumMatches=1,Ff=class extends xf{constructor(e){super(),this.expr=e}},If=class extends xf{constructor(e){super(),this.expr=e}},Lf=class extends xf{constructor(e){super(),this.expr=e}},Rf=class extends xf{constructor(e,t=[]){super(),this.ruleName=e,this.args=t}isSyntactic(){return mf(this.ruleName)}toMemoKey(){return this._memoKey||Object.defineProperty(this,`_memoKey`,{value:this.toString()}),this._memoKey}},zf=class extends xf{constructor(e){super(),this.category=e,this.pattern=lte[e]}}}});function Vf(e,t){let n;return t?(n=Error(t.getLineAndColumnMessage()+e),n.shortMessage=e,n.interval=t):n=Error(e),n}function Hf(){return Vf(`Interval sources don't match`)}function dte(e,t,n){return Vf(t?`Grammar ${e} is not declared in namespace '${t}'`:`Undeclared grammar `+e,n)}function fte(e,t){return Vf(`Grammar `+e.name+` is already declared in this namespace`)}function pte(e){return Vf(`Grammar '${e.name}' does not support incremental parsing`)}function Uf(e,t,n){return Vf(`Rule `+e+` is not declared in grammar `+t,n)}function mte(e,t,n){return Vf(`Cannot override rule `+e+` because it is not declared in `+t,n)}function hte(e,t,n){return Vf(`Cannot extend rule `+e+` because it is not declared in `+t,n)}function Wf(e,t,n,r){let i=`Duplicate declaration for rule '`+e+`' in grammar '`+t+`'`;return t!==n&&(i+=` (originally declared in '`+n+`')`),Vf(i,r)}function Gf(e,t,n,r){return Vf(`Wrong number of parameters for rule `+e+` (expected `+t+`, got `+n+`)`,r)}function gte(e,t,n,r){return Vf(`Wrong number of arguments for rule `+e+` (expected `+t+`, got `+n+`)`,r)}function _te(e,t,n){return Vf(`Duplicate parameter names in rule `+e+`: `+t.join(`, `),n)}function vte(e,t){return Vf(`Invalid parameter to rule `+e+`: `+t+` has arity `+t.getArity()+`, but parameter expressions must have arity 1`,t.source)}function yte(e,t){return Vf(`Cannot apply syntactic rule `+e+` from here (inside a lexical context)`,t.source)}function bte(e){let{ruleName:t}=e;return Vf(`applySyntactic is for syntactic rules, but '${t}' is a lexical rule. `+qf,e.source)}function xte(e){return Vf(`applySyntactic is not required here (in a syntactic context)`,e.source)}function Ste(e,t){return Vf(`Incorrect argument type: expected `+e,t.source)}function Cte(e){return Vf(`'...' can appear at most once in a rule body`,e.source)}function wte(e){let t=e._node;sf(t&&t.isNonterminal()&&t.ctorName===`escapeChar_unicodeCodePoint`);let n=e.children.slice(1,-1).map(e=>e.source),r=n[0].coverageWith(...n.slice(1));return Vf(`U+${r.contents} is not a valid Unicode code point`,r)}function Tte(e,t){let n=t.length>0?t[t.length-1].args:[],r=`Nullable expression `+e.expr.substituteParams(n)+` is not allowed inside '`+e.operator+`' (possible infinite loop)`;if(t.length>0){let e=t.map(e=>new Rf(e.ruleName,e.args)).join(`
|
|
85
85
|
`);r+=`
|
|
86
86
|
Application stack (most recent application last):
|
|
@@ -1511,7 +1511,7 @@ export default async function seed(container: AppOS.Container) {}
|
|
|
1511
1511
|
`;async function x9(e){try{return await at.access(e),!0}catch{return!1}}async function uDe(e){if(!await x9(e))return null;let t=(await at.readdir(e,{withFileTypes:!0})).filter(e=>e.isDirectory()&&/^\d{14}_/.test(e.name)).map(e=>e.name).sort().reverse();if(t.length===0)return null;let n=$e.join(e,t[0],`snapshot.json`);if(!await x9(n))return null;let r=await at.readFile(n,`utf-8`);return JSON.parse(r)}async function S9(e){let t=$e.join(process.cwd(),l,d,e);await x9(t)||await at.mkdir(t,{recursive:!0});let n=$e.join(t,`schema.ts`);await x9(n)||await at.writeFile(n,sDe(e));let r=$e.join(t,`relations.ts`);await x9(r)||await at.writeFile(r,cDe(e));let i=$e.join(t,`seed.ts`);await x9(i)||await at.writeFile(i,lDe(e));let a=$e.join(t,`schema-migrations`);await x9(a)||await at.mkdir(a,{recursive:!0});let o=$e.join(t,`data-migrations`);await x9(o)||await at.mkdir(o,{recursive:!0})}async function dDe(e){let{ctx:t}=e,{container:n}=t,r=Object.keys(n.db);if(t.info(`Generating data migration`),r.length===0){t.info(`No databases available`);return}let i=await t.choice({message:`Select database`,options:r.map(e=>({value:e,label:e}))});t.isCancel(i)&&t.cancel();let a=i;await S9(a);let{migrationsFolder:o}=b7(a,`data`),s=await t.task(a,async()=>{let e=`${new Date().toISOString().replace(/[-:T]/g,``).slice(0,14)}_${oDe()}`,t=$e.join(o,e);await at.mkdir(t,{recursive:!0});let n=$e.join(t,`migration.sql`);return await at.writeFile(n,`-- Write your data migration SQL here
|
|
1512
1512
|
`),n});t.success(s)}async function fDe(e){let{ctx:t,migrationType:n}=e,{container:r}=t;if(n===`data`){await dDe(e);return}let i=Object.keys(r.db);if(t.info(`Generating ${n} migrations`),i.length===0){t.info(`Nothing to generate`);return}for(let e of i)await S9(e);let a=!1;for(let e of i){let r=$e.join(process.cwd(),l,d,e,`schema.ts`),{migrationsFolder:i}=b7(e,n);try{let n=await import(r),o=n.default||n,s=await uDe(i)??await _Te({}),c=await _Te(o),l=await vTe(s,c);if(!l||l.length===0){t.taskStatus(e,`no changes`);continue}let u=await t.task(e,async()=>{let e=`${new Date().toISOString().replace(/[-:T]/g,``).slice(0,14)}_${oDe()}`,t=$e.join(i,e);await at.mkdir(t,{recursive:!0});let n=`${l.join(`;
|
|
1513
1513
|
|
|
1514
|
-
`)};`,r=$e.join(t,`migration.sql`),a=$e.join(t,`snapshot.json`);return await at.writeFile(r,n),await at.writeFile(a,JSON.stringify(c,null,2)),r});t.success(u),a=!0}catch(e){t.fail(e instanceof Error?e.message:String(e))}}a||t.info(`Nothing to generate`)}async function C9(e){let{ctx:t,migrationType:n}=e,{container:r}=t,i=Object.keys(r.db),a=r.logger.level;r.logger.level=`silent`,n===`schema`&&await(0,aDe.ensureSystemDatabase)(r.worker.dbUrl,r.logger);let o=(await Promise.all(i.map(async e=>{let{migrationsFolder:t}=b7(e,n);return x9(t)}))).some(Boolean);if(i.length===0||!o){t.info(`Nothing to migrate`),r.logger.level=a;return}for(let e of i){let i=r.db[e],a=b7(e,n);if(await x9(a.migrationsFolder))try{await t.task(e,async()=>{await Ue(i,a)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}r.logger.level=a}async function w9(e){let{ctx:t}=e,{container:n}=t,r=Object.keys(n.db);if(r.length===0){t.info(`Nothing to seed`);return}for(let e of r)await S9(e);for(let e of r){let r=$e.join(process.cwd(),l,d,e,`seed.ts`);try{await t.task(e,async()=>{let e=await import(r),t=e.default||e.seed;if(typeof t!=`function`)throw Error(`seed file does not export a function`);await t(n)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}}var pDe=ki({description:`Generate database data migrations`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:data:gen`),await fDe({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),mDe=ki({description:`Run pending database data migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:data:migrate`),await C9({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),hDe=ki({description:`Generate database schema migrations from schema changes`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:gen`),await fDe({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),gDe=ki({description:`Run pending database schema migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:migrate`),await C9({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),_De=ki({description:`Seed databases with initial data`,devOnly:!0,args:y([]),opts:v({}),async run(e){await w9({ctx:e}),await e.cleanup()}}),vDe=ki({description:`Teardown the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`down`);try{await e.spinner(`Stopping containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`down`,`--remove-orphans`,`--timeout=0`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}await e.cleanup(),e.outro()}}),yDe=ki({description:`Preview the application`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`preview`),e.step(`Starting containers (Ctrl+C to stop)`);let t=Qe(`docker`,[`compose`,`--profile=app`,`up`,`--build`],{stdio:`inherit`,cwd:process.cwd()}),n=!1,r=async()=>{if(!n){n=!0,t.kill(`SIGTERM`),e.step(`Stopping containers`);try{await e.exec(`docker`,[`compose`,`--profile=app`,`down`,`--remove-orphans`,`--timeout=0`])}catch{}await e.cleanup(),process.exit(0)}};process.on(`SIGINT`,r),process.on(`SIGTERM`,r),t.on(`close`,()=>{n||r()}),await new Promise(()=>{})}}),bDe=`0.3.
|
|
1514
|
+
`)};`,r=$e.join(t,`migration.sql`),a=$e.join(t,`snapshot.json`);return await at.writeFile(r,n),await at.writeFile(a,JSON.stringify(c,null,2)),r});t.success(u),a=!0}catch(e){t.fail(e instanceof Error?e.message:String(e))}}a||t.info(`Nothing to generate`)}async function C9(e){let{ctx:t,migrationType:n}=e,{container:r}=t,i=Object.keys(r.db),a=r.logger.level;r.logger.level=`silent`,n===`schema`&&await(0,aDe.ensureSystemDatabase)(r.worker.dbUrl,r.logger);let o=(await Promise.all(i.map(async e=>{let{migrationsFolder:t}=b7(e,n);return x9(t)}))).some(Boolean);if(i.length===0||!o){t.info(`Nothing to migrate`),r.logger.level=a;return}for(let e of i){let i=r.db[e],a=b7(e,n);if(await x9(a.migrationsFolder))try{await t.task(e,async()=>{await Ue(i,a)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}r.logger.level=a}async function w9(e){let{ctx:t}=e,{container:n}=t,r=Object.keys(n.db);if(r.length===0){t.info(`Nothing to seed`);return}for(let e of r)await S9(e);for(let e of r){let r=$e.join(process.cwd(),l,d,e,`seed.ts`);try{await t.task(e,async()=>{let e=await import(r),t=e.default||e.seed;if(typeof t!=`function`)throw Error(`seed file does not export a function`);await t(n)})}catch(e){t.fail(e instanceof Error?e.message:String(e))}}}var pDe=ki({description:`Generate database data migrations`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:data:gen`),await fDe({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),mDe=ki({description:`Run pending database data migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:data:migrate`),await C9({ctx:e,migrationType:`data`}),await e.cleanup(),e.outro()}}),hDe=ki({description:`Generate database schema migrations from schema changes`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:gen`),await fDe({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),gDe=ki({description:`Run pending database schema migrations`,args:y([]),opts:v({}),async run(e){e.intro(`db:schema:migrate`),await C9({ctx:e,migrationType:`schema`}),await e.cleanup(),e.outro()}}),_De=ki({description:`Seed databases with initial data`,devOnly:!0,args:y([]),opts:v({}),async run(e){await w9({ctx:e}),await e.cleanup()}}),vDe=ki({description:`Teardown the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`down`);try{await e.spinner(`Stopping containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`down`,`--remove-orphans`,`--timeout=0`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}await e.cleanup(),e.outro()}}),yDe=ki({description:`Preview the application`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`preview`),e.step(`Starting containers (Ctrl+C to stop)`);let t=Qe(`docker`,[`compose`,`--profile=app`,`up`,`--build`],{stdio:`inherit`,cwd:process.cwd()}),n=!1,r=async()=>{if(!n){n=!0,t.kill(`SIGTERM`),e.step(`Stopping containers`);try{await e.exec(`docker`,[`compose`,`--profile=app`,`down`,`--remove-orphans`,`--timeout=0`])}catch{}await e.cleanup(),process.exit(0)}};process.on(`SIGINT`,r),process.on(`SIGTERM`,r),t.on(`close`,()=>{n||r()}),await new Promise(()=>{})}}),bDe=`0.3.7-0`;const xDe=`(AppOS v${bDe} | Node ${process.version})`;var SDe=ki({description:`Start an interactive REPL with container access`,aliases:[`r`],args:y([]),opts:v({}),async run(e){e.intro(`repl`);let{container:t}=e,n=[],r=Object.keys(t.db);r.length>0&&n.push(`container.db.{${r.join(`, `)}}`);let i=Object.keys(t.cache);i.length>0&&n.push(`container.cache.{${i.join(`, `)}}`);let a=Object.keys(t.storage);a.length>0&&n.push(`container.storage.{${a.join(`, `)}}`);let o=Object.keys(t).filter(e=>e!==`db`&&e!==`cache`&&e!==`storage`).map(e=>`container.${e}`);n.push(...o),e.info(`Starting REPL ${xDe}`),e.info(`Available: ${n.join(`, `)}`),e.line(``);let s=On.start({prompt:`appos(${t.config.APP_NAME})> `,useColors:!0,useGlobal:!0,breakEvalOnSigint:!0});s.context.container=t,s.on(`exit`,async()=>{await e.cleanup(),e.info(`Bye`),process.exit(0)}),await new Promise(()=>{})}}),CDe=ki({description:`Reset the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`reset`);try{await e.spinner(`Stopping containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`down`,`--remove-orphans`,`--timeout=0`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}try{await e.spinner(`Starting containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`up`,`--wait`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}e.step(`Running schema migrations`),await C9({ctx:e,migrationType:`schema`}),e.step(`Seeding databases`),await w9({ctx:e}),await e.cleanup(),e.outro()}}),wDe=t(i(((e,t)=>{var n={decodeValues:!0,map:!1,silent:!1};function r(e){return typeof e!=`string`||e in{}}function i(){return Object.create(null)}function a(e){return typeof e==`string`&&!!e.trim()}function o(e,t){var o=e.split(`;`).filter(a),c=s(o.shift()),l=c.name,u=c.value;if(t=t?Object.assign({},n,t):n,r(l))return null;try{u=t.decodeValues?decodeURIComponent(u):u}catch(e){console.error(`set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.`,e)}var d=i();return d.name=l,d.value=u,o.forEach(function(e){var t=e.split(`=`),n=t.shift().trimLeft().toLowerCase();if(!r(n)){var i=t.join(`=`);if(n===`expires`)d.expires=new Date(i);else if(n===`max-age`){var a=parseInt(i,10);Number.isNaN(a)||(d.maxAge=a)}else n===`secure`?d.secure=!0:n===`httponly`?d.httpOnly=!0:n===`samesite`?d.sameSite=i:n===`partitioned`?d.partitioned=!0:n&&(d[n]=i)}}),d}function s(e){var t=``,n=``,r=e.split(`=`);return r.length>1?(t=r.shift(),n=r.join(`=`)):n=e,{name:t,value:n}}function c(e,t){if(t=t?Object.assign({},n,t):n,!e)return t.map?i():[];if(e.headers)if(typeof e.headers.getSetCookie==`function`)e=e.headers.getSetCookie();else if(e.headers[`set-cookie`])e=e.headers[`set-cookie`];else{var s=e.headers[Object.keys(e.headers).find(function(e){return e.toLowerCase()===`set-cookie`})];!s&&e.headers.cookie&&!t.silent&&console.warn(`Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.`),e=s}if(Array.isArray(e)||(e=[e]),t.map){var c=i();return e.filter(a).reduce(function(e,n){var i=o(n,t);return i&&!r(i.name)&&(e[i.name]=i),e},c)}else return e.filter(a).map(function(e){return o(e,t)}).filter(Boolean)}function l(e){if(Array.isArray(e))return e;if(typeof e!=`string`)return[];var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}t.exports=c,t.exports.parse=c,t.exports.parseString=o,t.exports.splitCookiesString=l}))(),1);function TDe(e,t){let n=e.headers;if(!n[`content-type`])return null;let r=Number(n[`content-length`]);if(e.httpVersionMajor===1&&isNaN(r)&&n[`transfer-encoding`]==null||r===0)return null;let i=r;if(t){if(!i)i=t;else if(i>t)throw Error(`Received content-length of ${i}, but only accept up to ${t} bytes.`)}if(e.destroyed){let e=new ReadableStream;return e.cancel(),e}let a=0,o=!1;return new ReadableStream({start(t){e.on(`error`,e=>{o=!0,t.error(e)}),e.on(`end`,()=>{o||t.close()}),e.on(`data`,n=>{if(!o){if(a+=n.length,a>i){o=!0,t.error(Error(`request body size exceeded ${r?`'content-length'`:`BODY_SIZE_LIMIT`} of ${i}`));return}t.enqueue(n),(t.desiredSize===null||t.desiredSize<=0)&&e.pause()}})},pull(){e.resume()},cancel(t){o=!0,e.destroy(t)}})}function EDe({request:e,base:t,bodySizeLimit:n}){let r=e?.baseUrl,i=r?r+e.url:e.url,a=e,o,s=e.method;if(s!==`GET`&&s!==`HEAD`)if(a.body!==void 0){let e=typeof a.body==`string`?a.body:JSON.stringify(a.body);o=new ReadableStream({start(t){t.enqueue(new TextEncoder().encode(e)),t.close()}})}else o=TDe(e,n);return new Request(t+i,{duplex:`half`,method:e.method,body:o,headers:e.headers})}async function DDe(e,t){for(let[n,r]of t.headers)try{e.setHeader(n,n===`set-cookie`?wDe.splitCookiesString(t.headers.get(n)):r)}catch(t){e.getHeaderNames().forEach(t=>e.removeHeader(t)),e.writeHead(500).end(String(t));return}if(e.writeHead(t.status),!t.body){e.end();return}if(t.body.locked){e.end(`Fatal error: Response body is locked. This can happen when the response was already read (for example through 'response.json()' or 'response.text()').`);return}let n=t.body.getReader();if(e.destroyed){n.cancel();return}let r=t=>{e.off(`close`,r),e.off(`error`,r),n.cancel(t).catch(()=>{}),t&&e.destroy(t)};e.on(`close`,r),e.on(`error`,r),i();async function i(){try{for(;;){let{done:t,value:r}=await n.read();if(t)break;if(!e.write(r)){e.once(`drain`,i);return}}e.end()}catch(e){r(e instanceof Error?e:Error(String(e)))}}}function ODe(e){return async(t,n)=>DDe(n,await e(EDe({base:`${t.headers[`x-forwarded-proto`]||(t.socket.encrypted?`https`:`http`)}://${t.headers[`:authority`]||t.headers.host}`,request:t})))}const kDe=e=>`handler`in e?ODe(e.handler):ODe(e);
|
|
1515
1515
|
/*
|
|
1516
1516
|
object-assign
|
|
1517
1517
|
(c) Sindre Sorhus
|
|
@@ -1554,4 +1554,4 @@ var ADe=i(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnP
|
|
|
1554
1554
|
*/
|
|
1555
1555
|
var qOe=i(((t,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{remixRoutesOptionAdapter:()=>b}),n.exports=f(p);function m(e,t=`root`){let n={};for(let t in e){let r=e[t];n[t]={id:r.id,file:r.file,path:r.path,index:r.index,caseSensitive:r.caseSensitive}}let r=[];for(let i in n){let a=n[i],o=e[a.id].parentId;if(o===t)r.push(a);else{let e=o&&n[o];e&&(e.children=e.children||[],e.children.push(a))}}return r}var h=d(e(`path`));function g(e){return e.replaceAll(h.default.win32.sep,`/`)}var _=e=>{let t=Object.create(null),n=[],r=!1;return e((e,i,a,o)=>{if(r)throw Error("You tried to define routes asynchronously but started defining routes before the async work was done. Please await all async data before calling `defineRoutes()`");let s;typeof a==`function`?(s={},o=a):s=a||{};let c={path:e||void 0,index:s.index?!0:void 0,caseSensitive:s.caseSensitive?!0:void 0,id:s.id||v(i),parentId:n.length>0?n[n.length-1].id:`root`,file:i};if(c.id in t)throw Error(`Unable to define routes with duplicate route id: "${c.id}"`);t[c.id]=c,o&&(n.push(c),o(),n.pop())}),r=!0,t};function v(e){return g(y(e))}function y(e){return e.replace(/\.[a-z0-9]+$/i,``)}async function b(e){return m(await e(_))}}));function JOe(e){return e!=null&&typeof e!=`function`&&Hn(e.length)}function YOe(e){return typeof e==`object`&&!!e&&Vn(e)===`[object Arguments]`}function XOe(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function ZOe(e){return Bn(e)}function QOe(e){if(e==null)return!0;if(JOe(e))return typeof e.splice!=`function`&&typeof e!=`string`&&(typeof Buffer>`u`||!Buffer.isBuffer(e))&&!ZOe(e)&&!YOe(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return XOe(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var $Oe=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.range=e.balanced=void 0,e.balanced=(n,r,i)=>{let a=n instanceof RegExp?t(n,i):n,o=r instanceof RegExp?t(r,i):r,s=a!==null&&o!=null&&(0,e.range)(a,o,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+a.length,s[1]),post:i.slice(s[1]+o.length)}};let t=(e,t)=>{let n=t.match(e);return n?n[0]:null};e.range=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s}})),eke=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.expand=x;let t=$Oe(),n=`\0SLASH`+Math.random()+`\0`,r=`\0OPEN`+Math.random()+`\0`,i=`\0CLOSE`+Math.random()+`\0`,a=`\0COMMA`+Math.random()+`\0`,o=`\0PERIOD`+Math.random()+`\0`,s=new RegExp(n,`g`),c=new RegExp(r,`g`),l=new RegExp(i,`g`),u=new RegExp(a,`g`),d=new RegExp(o,`g`),f=/\\\\/g,p=/\\{/g,m=/\\}/g,h=/\\,/g,g=/\\./g;function _(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function v(e){return e.replace(f,n).replace(p,r).replace(m,i).replace(h,a).replace(g,o)}function y(e){return e.replace(s,`\\`).replace(c,`{`).replace(l,`}`).replace(u,`,`).replace(d,`.`)}function b(e){if(!e)return[``];let n=[],r=(0,t.balanced)(`{`,`}`,e);if(!r)return e.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=b(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),n.push.apply(n,s),n}function x(e){return e?(e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),E(v(e),!0).map(y)):[]}function S(e){return`{`+e+`}`}function C(e){return/^-?0\d/.test(e)}function w(e,t){return e<=t}function T(e,t){return e>=t}function E(e,n){let r=[],a=(0,t.balanced)(`{`,`}`,e);if(!a)return[e];let o=a.pre,s=a.post.length?E(a.post,!1):[``];if(/\$$/.test(a.pre))for(let e=0;e<s.length;e++){let t=o+`{`+a.body+`}`+s[e];r.push(t)}else{let t=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),l=t||c,u=a.body.indexOf(`,`)>=0;if(!l&&!u)return a.post.match(/,(?!,).*\}/)?(e=a.pre+`{`+a.body+i+a.post,E(e)):[e];let d;if(l)d=a.body.split(/\.\./);else if(d=b(a.body),d.length===1&&d[0]!==void 0&&(d=E(d[0],!1).map(S),d.length===1))return s.map(e=>a.pre+d[0]+e);let f;if(l&&d[0]!==void 0&&d[1]!==void 0){let e=_(d[0]),t=_(d[1]),n=Math.max(d[0].length,d[1].length),r=d.length===3&&d[2]!==void 0?Math.abs(_(d[2])):1,i=w;t<e&&(r*=-1,i=T);let a=d.some(C);f=[];for(let o=e;i(o,t);o+=r){let e;if(c)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,E(d[e],!1))}for(let e=0;e<f.length;e++)for(let t=0;t<s.length;t++){let i=o+f[e]+s[t];(!n||l||i)&&r.push(i)}}return r}})),tke=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertValidPattern=void 0,e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)}})),nke=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseClass=void 0;let t={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;WHILE:for(;l<e.length;){let r=e.charAt(l);if((r===`!`||r===`^`)&&l===o+1){p=!0,l++;continue}if(r===`]`&&u&&!f){m=l+1;break}if(u=!0,r===`\\`&&!f){f=!0,l++;continue}if(r===`[`&&!f){for(let[n,[r,i,a]]of Object.entries(t))if(e.startsWith(n,l)){if(h)return[`$.`,!1,e.length-o,!0];l+=n.length,a?c.push(r):s.push(r),d||=i;continue WHILE}}if(f=!1,h){r>h?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m<l)return[``,!1,0,!1];if(!s.length&&!c.length)return[`$.`,!1,e.length-o,!0];if(c.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!p)return[r(s[0].length===2?s[0].slice(-1):s[0]),!1,m-o,!1];let g=`[`+(p?`^`:``)+i(s)+`]`,_=`[`+(p?``:`^`)+i(c)+`]`;return[s.length&&c.length?`(`+g+`|`+_+`)`:s.length?g:_,d,m-o,!0]}})),q9=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`):t?e.replace(/\[([^\/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,`$1$2`).replace(/\\([^\/{}])/g,`$1`)})),rke=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AST=void 0;let t=nke(),n=q9(),r=new Set([`!`,`?`,`+`,`*`,`@`]),i=e=>r.has(e),a=`(?!\\.)`,o=new Set([`[`,`.`]),s=new Set([`..`,`.`]),c=new Set(`().*{}+?[]^$\\!`),l=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),u=`[^/]`,d=u+`*?`,f=u+`+?`;e.AST=class e{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...t){for(let n of t)if(n!==``){if(typeof n!=`string`&&!(n instanceof e&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let t=this.#i;for(let n=0;n<this.#a;n++){let r=t.#r[n];if(!(r instanceof e&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(t){let n=new e(this.type,t);for(let e of this.#r)n.copyIn(e);return n}static#f(t,n,r,a){let o=!1,s=!1,c=-1,l=!1;if(n.type===null){let u=r,d=``;for(;u<t.length;){let r=t.charAt(u++);if(o||r===`\\`){o=!o,d+=r;continue}if(s){u===c+1?(r===`^`||r===`!`)&&(l=!0):r===`]`&&!(u===c+2&&l)&&(s=!1),d+=r;continue}else if(r===`[`){s=!0,c=u,l=!1,d+=r;continue}if(!a.noext&&i(r)&&t.charAt(u)===`(`){n.push(d),d=``;let i=new e(r,n);u=e.#f(t,i,u,a),n.push(i);continue}d+=r}return n.push(d),u}let u=r+1,d=new e(null,n),f=[],p=``;for(;u<t.length;){let r=t.charAt(u++);if(o||r===`\\`){o=!o,p+=r;continue}if(s){u===c+1?(r===`^`||r===`!`)&&(l=!0):r===`]`&&!(u===c+2&&l)&&(s=!1),p+=r;continue}else if(r===`[`){s=!0,c=u,l=!1,p+=r;continue}if(i(r)&&t.charAt(u)===`(`){d.push(p),p=``;let n=new e(r,d);d.push(n),u=e.#f(t,n,u,a);continue}if(r===`|`){d.push(p),p=``,f.push(d),d=new e(null,n);continue}if(r===`)`)return p===``&&n.#r.length===0&&(n.#u=!0),d.push(p),p=``,n.push(...f,d),u;p+=r}return n.type=null,n.#t=void 0,n.#r=[t.substring(r-1)],u}static fromGlob(t,n={}){let r=new e(null,void 0,n);return e.#f(t,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(t){let r=t??!!this.#c.dot;if(this.#e===this&&this.#d(),!this.type){let i=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),c=this.#r.map(n=>{let[r,a,o,s]=typeof n==`string`?e.#m(n,this.#t,i):n.toRegExpSource(t);return this.#t=this.#t||o,this.#n=this.#n||s,r}).join(``),l=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&s.has(this.#r[0]))){let e=o,n=r&&e.has(c.charAt(0))||c.startsWith(`\\.`)&&e.has(c.charAt(2))||c.startsWith(`\\.\\.`)&&e.has(c.charAt(4)),i=!r&&!t&&e.has(c.charAt(0));l=n?`(?!(?:^|/)\\.\\.?(?:$|/))`:i?a:``}let u=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(u=`(?:$|\\/)`),[l+c+u,(0,n.unescape)(c),this.#t=!!this.#t,this.#n]}let i=this.type===`*`||this.type===`+`,c=this.type===`!`?`(?:(?!(?:`:`(?:`,l=this.#p(r);if(this.isStart()&&this.isEnd()&&!l&&this.type!==`!`){let e=this.toString();return this.#r=[e],this.type=null,this.#t=void 0,[e,(0,n.unescape)(this.toString()),!1,!1]}let u=!i||t||r?``:this.#p(!0);u===l&&(u=``),u&&(l=`(?:${l})(?:${u})*?`);let p=``;if(this.type===`!`&&this.#u)p=(this.isStart()&&!r?a:``)+f;else{let e=this.type===`!`?`))`+(this.isStart()&&!r&&!t?a:``)+d+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&u?`)`:this.type===`*`&&u?`)?`:`)${this.type}`;p=c+l+e}return[p,(0,n.unescape)(l),this.#t=!!this.#t,this.#n]}#p(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#m(e,r,i=!1){let a=!1,o=``,s=!1;for(let n=0;n<e.length;n++){let p=e.charAt(n);if(a){a=!1,o+=(c.has(p)?`\\`:``)+p;continue}if(p===`\\`){n===e.length-1?o+=`\\\\`:a=!0;continue}if(p===`[`){let[i,a,c,l]=(0,t.parseClass)(e,n);if(c){o+=i,s||=a,n+=c-1,r||=l;continue}}if(p===`*`){o+=i&&e===`*`?f:d,r=!0;continue}if(p===`?`){o+=u,r=!0;continue}o+=l(p)}return[o,(0,n.unescape)(e),!!r,s]}}})),ike=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)})),ake=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;let t=eke(),n=tke(),r=rke(),i=ike(),a=q9();e.minimatch=(e,t,r={})=>((0,n.assertValidPattern)(t),!r.nocomment&&t.charAt(0)===`#`?!1:new ne(t,r).match(e));let o=/^\*+([^+@!?\*\[\(]*)$/,s=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),c=e=>t=>t.endsWith(e),l=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),u=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),d=/^\*+\.\*+$/,f=e=>!e.startsWith(`.`)&&e.includes(`.`),p=e=>e!==`.`&&e!==`..`&&e.includes(`.`),m=/^\.\*+$/,h=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),g=/^\*+$/,_=e=>e.length!==0&&!e.startsWith(`.`),v=e=>e.length!==0&&e!==`.`&&e!==`..`,y=/^\?+([^+@!?\*\[\(]*)?$/,b=([e,t=``])=>{let n=w([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},x=([e,t=``])=>{let n=T([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},S=([e,t=``])=>{let n=T([e]);return t?e=>n(e)&&e.endsWith(t):n},C=([e,t=``])=>{let n=w([e]);return t?e=>n(e)&&e.endsWith(t):n},w=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},T=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},E=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,ee={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=E===`win32`?ee.win32.sep:ee.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR,e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;let te=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,te(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,te(t,n))}static defaults(e){return n.defaults(te(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,te(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,te(t,r))}},unescape:(e,r={})=>n.unescape(e,te(t,r)),escape:(e,r={})=>n.escape(e,te(t,r)),filter:(e,r={})=>n.filter(e,te(t,r)),defaults:e=>n.defaults(te(t,e)),makeRe:(e,r={})=>n.makeRe(e,te(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,te(t,r)),match:(e,r,i={})=>n.match(e,r,te(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,r={})=>((0,n.assertValidPattern)(e),r.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,t.expand)(e)),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new ne(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new ne(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;let D=/[?*]|[+@!]\(.*?\)|\[|\]/,O=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var ne=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,n.assertValidPattern)(e),t||={},this.options=t,this.pattern=e,this.platform=t.platform||E,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!D.test(e[2]))&&!D.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(t,n,r=!1){let i=this.options;if(this.isWindows){let e=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),r=!e&&t[0]===``&&t[1]===``&&t[2]===`?`&&/^[a-z]:$/i.test(t[3]),i=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),a=!i&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),o=r?3:e?0:void 0,s=a?3:i?0:void 0;if(typeof o==`number`&&typeof s==`number`){let[e,r]=[t[o],n[s]];e.toLowerCase()===r.toLowerCase()&&(n[s]=e,s>o?n=n.slice(s):o>s&&(t=t.slice(o)))}}let{optimizationLevel:a=1}=this.options;a>=2&&(t=this.levelTwoFileOptimize(t)),this.debug(`matchOne`,this,{file:t,pattern:n}),this.debug(`matchOne`,t.length,n.length);for(var o=0,s=0,c=t.length,l=n.length;o<c&&s<l;o++,s++){this.debug(`matchOne loop`);var u=n[s],d=t[o];if(this.debug(n,u,d),u===!1)return!1;if(u===e.GLOBSTAR){this.debug(`GLOBSTAR`,[n,u,d]);var f=o,p=s+1;if(p===l){for(this.debug(`** at the end`);o<c;o++)if(t[o]===`.`||t[o]===`..`||!i.dot&&t[o].charAt(0)===`.`)return!1;return!0}for(;f<c;){var m=t[f];if(this.debug(`
|
|
1556
1556
|
globstar while`,t,f,n,p,m),this.matchOne(t.slice(f),n.slice(p),r))return this.debug(`globstar found match!`,f,c,m),!0;if(m===`.`||m===`..`||!i.dot&&m.charAt(0)===`.`){this.debug(`dot detected!`,t,f,n,p);break}this.debug(`globstar swallow a segment, and continue`),f++}return!!(r&&(this.debug(`
|
|
1557
|
-
>>> no match, partial?`,t,f,n,p),f===c))}let a;if(typeof u==`string`?(a=d===u,this.debug(`string match`,u,d,a)):(a=u.test(d),this.debug(`pattern match`,u,d,a)),!a)return!1}if(o===c&&s===l)return!0;if(o===c)return r;if(s===l)return o===c-1&&t[o]===``;throw Error(`wtf?`)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,n.assertValidPattern)(t);let i=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let a,w=null;(a=t.match(g))?w=i.dot?v:_:(a=t.match(o))?w=(i.nocase?i.dot?u:l:i.dot?c:s)(a[1]):(a=t.match(y))?w=(i.nocase?i.dot?x:b:i.dot?S:C)(a):(a=t.match(d))?w=i.dot?p:f:(a=t.match(m))&&(w=h);let T=r.AST.fromGlob(t,this.options).toMMPattern();return w&&typeof T==`object`&&Reflect.defineProperty(T,`test`,{value:w}),T}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?`[^/]*?`:n.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?O(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|\\/`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))});let a=n.filter(t=>t!==e.GLOBSTAR);if(this.partial&&a.length>=1){let e=[];for(let t=1;t<=a.length;t++)e.push(a.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return a.join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.partial&&(a=`^(?:\\/|`+o+a.slice(1,-1)+s+`)$`),this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};e.Minimatch=ne;var k=rke();Object.defineProperty(e,`AST`,{enumerable:!0,get:function(){return k.AST}});var A=ike();Object.defineProperty(e,`escape`,{enumerable:!0,get:function(){return A.escape}});var re=q9();Object.defineProperty(e,`unescape`,{enumerable:!0,get:function(){return re.unescape}}),e.minimatch.AST=r.AST,e.minimatch.Minimatch=ne,e.minimatch.escape=i.escape,e.minimatch.unescape=a.unescape})),oke=i(((t,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{createRouteId:()=>A,createRoutePath:()=>ee,default:()=>y,defaultVisitFiles:()=>k,flatRoutes:()=>y,getRouteInfo:()=>E,getRouteSegments:()=>D,isIndexRoute:()=>T,isRouteModuleFile:()=>C,normalizeSlashes:()=>re}),n.exports=f(p);var m=d(e(`fs`),1),h=ake(),g=d(e(`path`),1),_={appDir:`app`,routeDir:`routes`,basePath:`/`,paramPrefixChar:`$`,nestedDirectoryChar:`+`,routeRegex:/((\${nestedDirectoryChar}[\/\\][^\/\\:?*]+)|[\/\\]((index|route|layout|page)|(_[^\/\\:?*]+)|([^\/\\:?*]+\.route)))\.(ts|tsx|js|jsx|md|mdx)$$/},v=void 0;function y(e,t,n={}){let r=b(n.appDir??_.appDir,n.ignoredRouteFiles??[],{..._,...n,routeDir:e,defineRoutes:t});return Object.values(r).forEach(e=>{e.parentId===void 0&&(e.parentId=`root`)}),r}function b(e,t,n){let r=[];t&&!Array.isArray(t)?n=t:r=t??[],n||=_;let i=new Map,a=new Map,o=Array.isArray(n.routeDir)?n.routeDir:[n.routeDir??`routes`],s=n.defineRoutes??v;if(!s)throw Error(`You must provide a defineRoutes function`);let c=n.visitFiles??k,l=ae(n.routeRegex??_.routeRegex,n.nestedDirectoryChar??_.nestedDirectoryChar);for(let t of o)c(g.join(e,t),e=>{if(!(r&&r.some(t=>(0,h.minimatch)(e,t,{dot:!0})))&&C(e,l)){let r=E(t,e,n);i.set(r.id,r),a.set(r.name,r);return}});Array.from(i.values()).forEach(e=>{e.parentId=te(e,a)});function u(e,t){let n=Array.from(i.values()).filter(e=>e.parentId===t),r=(t?i.get(t):void 0)?.path??`/`;for(let t of n){let n=t?.path?.slice(r.length)??``;if(n.startsWith(`/`)&&(n=n.slice(1)),t.index){if(Object.values(i).filter(e=>e.parentId===t.id).length>0)throw Error(`Child routes are not allowed in index routes. Please remove child routes of ${t.id}`);e(n,i.get(t.id).file,{index:!0})}else e(n,i.get(t.id).file,()=>{u(e,t.id)})}}return s(u)}var x=[`.js`,`.jsx`,`.ts`,`.tsx`,`.md`,`.mdx`],S=/\.server\.(ts|tsx|js|jsx|md|mdx)$/;function C(e,t){return e.includes(g.sep)?t.test(e)?!S.test(e):!1:x.includes(g.extname(e))}var w=(()=>{let e={};return t=>{if(t in e)return e[t];let n=new RegExp(t);return e[t]=n,n}})();function T(e,t){return w(`((^|[.]|[${t.nestedDirectoryChar.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`)}]\\/)(index|_index))(\\/[^\\/]+)?$|(\\/_?index\\/)`).test(e)}function E(e,t,n){let r=re(g.join(e,t)),i=A(r),a=i.slice(e.length+1),o=T(a,n),s=D(a,o,n.paramPrefixChar,n.nestedDirectoryChar);return{id:i,path:ee(s,o,n),file:r,name:s.join(`/`),segments:s,index:o}}function ee(e,t,n){let r=``,i=n.basePath??`/`,a=n.paramPrefixChar??`$`;t&&(e[e.length-1]=``);for(let t=0;t<e.length;t++){let n=e[t];if(!n.startsWith(`_`)){if(n.endsWith(`_`)&&(n=n.slice(0,-1)),n.includes(`[`)&&n.includes(`]`)){let e=``,t=0;for(let r of n)r===`[`&&t===0?t++:r===`]`&&t>0?t--:e+=r;n=e}n.startsWith(a)?n===a?r+=`/*`:r+=`/:${n.slice(1)}`:n.startsWith(`(${a}`)?r+=`/:${n.slice(2,n.length-1)}?`:n.startsWith(`(`)?r+=`/${n.slice(1,n.length-1)}?`:r+=`/${n}`}}return i!==`/`&&(r=i+r),r.endsWith(`/`)&&(r=r.slice(0,-1)),r||void 0}function te(e,t){let n=e.segments.slice(0,-1).join(`/`);for(;n;){if(t.has(n))return t.get(n).id;n=n.substring(0,n.lastIndexOf(`/`))}}function D(e,t,n=`$`,r=`+`){let i=[],a=0,o=``,s=`START`,c=`NORMAL`,l=!1,u=r.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`),d=RegExp(`${u}[/\\\\]`,`g`),f=RegExp(`${u}[/\\\\]`),p=`${u}/_\\.`;if(new RegExp(p).test(e)){let t=new RegExp(p,`g`);e=e.replace(t,`_${r}/`)}f.test(e)&&(e=e.replace(d,`.`),l=!0);let m=/\//.test(e);if((l&&m||!l)&&!e.endsWith(`.route`)){let t=e.lastIndexOf(`/`);t>=0&&(e=e.substring(0,t))}let h=e=>{e&&i.push(e)};for(;a<e.length;){let t=e[a];switch(s){case`START`:if(o.includes(n)&&!(o.startsWith(n)||o.startsWith(`(${n}`)))throw Error(`Route params must start with prefix char ${n}: ${o}`);if(o.includes(`(`)&&!o.startsWith(`(`)&&!o.endsWith(`)`))throw Error(`Optional routes must start and end with parentheses: ${o}`);h(o),o=``,s=`PATH`;continue;case`PATH`:if(ne(t)&&c===`NORMAL`){s=`START`;break}else t===`[`?c=`ESCAPE`:t===`]`&&(c=`NORMAL`);o+=t;break}a++}return h(o),i.at(-1)===`route`&&(i=i.slice(0,-1)),!t&&l&&i.at(-1)?.startsWith(`_`)&&(i=i.slice(0,-1)),i}var O=/[\/\\.]/;function ne(e){return O.test(e)}function k(e,t,n=e){for(let r of m.readdirSync(e)){let i=g.resolve(e,r),a=m.statSync(i);a.isDirectory()?k(i,t,n):a.isFile()&&t(g.relative(n,i))}}function A(e){return re(ie(e))}function re(e){return e.split(g.win32.sep).join(`/`)}function ie(e){return e.replace(/\.[a-z0-9]+$/i,``)}var ae=(e,t)=>(t=t.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`),new RegExp(e.source.replace("\\${nestedDirectoryChar}",`[${t}]`)))}))(),ske=qOe();const J9=e=>typeof e==`object`&&!!e&&`_zod`in e,cke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e))r[i]=t.addExample(a,[...n,i]);return r},lke=(e,t,n)=>{let{schema:r,examples:i,...a}=e,o=a;return J9(r)?o.schema=t.registry.addSchema(r,[...n,`schema`],{io:t.io,source:{type:`mediaType`}}):o.schema=r,i&&(o.examples=cke(i,t.registry,[...n,`examples`])),o},uke=(e,t,n)=>{let r={};for(let[i,a]of Object.entries(e))a&&(r[i]=lke(a,t,[...n,i]));return r},Y9=(e,t,n)=>{let r=e._zod.def;switch(r.type){case`object`:return e;case`lazy`:return Y9(r.getter(),t,n);case`pipe`:return Y9(t===`input`?r.in:r.out,t,n)}throw Error(`Failed to unwrap ZodObject from type: ${e._zod.def.type} at ${n.join(` > `)}`)},dke=(e,t)=>t===`input`?e._zod.optin===void 0:e._zod.optout===void 0,fke=(e,t,n)=>{if(e){if(J9(e)){let r=Y9(e,`output`,n),i={};for(let[e,a]of Object.entries(r._zod.def.shape))i[e]=t.addHeader(a,[...n,e]);return i}return e}},pke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e))r[i]=t.addLink(a,[...n,i]);return r},mke=(e,t,n)=>{if(!e)return;let r=[];for(let i of e){if(J9(i)){let e=t.addParameter(i,[...n,`parameters`]);r.push(e);continue}r.push(i)}return r},hke=(e,t,n)=>{if(!e)return;let r=[];for(let[i,a]of Object.entries(e??{})){let e=Y9(a,`input`,n);for(let[a,o]of Object.entries(e._zod.def.shape)){let e=t.addParameter(o,[...n,i,a],{location:{in:i,name:a}});r.push(e)}}return r},X9=e=>e.startsWith(`x-`),gke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e)){if(X9(i)){r[i]=a;continue}r[i]=t.addCallback(a,[...n,i])}return r},_ke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e))if(a){if(X9(i)){r[i]=a;continue}if(`$ref`in a){r[i]=a;continue}r[i]=t.addResponse(a,[...n,i])}return r},vke=(e,t,n)=>{let{parameters:r,requestParams:i,requestBody:a,responses:o,callbacks:s,...c}=e,l=c,u=mke(r,t,[...n,`parameters`]),d=hke(i,t,[...n,`requestParams`]);(d||u)&&(l.parameters=[...d??[],...u??[]]);let f=a&&t.addRequestBody(a,n);f&&(l.requestBody=f);let p=_ke(o,t,[...n,`responses`]);p&&(l.responses=p);let m=gke(s,t,[...n,`callbacks`]);return m&&(l.callbacks=m),l},yke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e)){if(X9(i)){r[i]=a;continue}r[i]=t.addPathItem(a,[...n,i])}return r},bke=[`3.0.0`,`3.0.1`,`3.0.2`,`3.0.3`,`3.1.0`,`3.1.1`],xke=(e,t)=>bke.indexOf(e)>=bke.indexOf(t),Ske=e=>{let t=e.zodSchema._zod.def;switch(t.type){case`bigint`:e.jsonSchema.type=`integer`,e.jsonSchema.format=`int64`;break;case`union`:{if(`discriminator`in t&&typeof t.discriminator==`string`){e.jsonSchema.oneOf??=e.jsonSchema.anyOf,delete e.jsonSchema.anyOf,e.jsonSchema.type=`object`,e.jsonSchema.discriminator={propertyName:t.discriminator};let n={};for(let[r,i]of Object.entries(e.jsonSchema.oneOf)){let a=i.$ref;if(!a){delete e.jsonSchema.discriminator;return}let o=t.options[Number(r)]._zod.propValues?.[t.discriminator];if(!o?.size)return;for(let e of[...o??[]]){if(typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)return;n[String(e)]=a}}e.jsonSchema.discriminator.mapping=n}let n=_.get(e.zodSchema);typeof n?.unionOneOf==`boolean`&&(n.unionOneOf&&(e.jsonSchema.oneOf=e.jsonSchema.anyOf,delete e.jsonSchema.anyOf),delete e.jsonSchema.unionOneOf);break}case`date`:e.jsonSchema.type=`string`;break;case`literal`:if(t.values.includes(void 0))break;break;case`undefined`:e.jsonSchema.not={};break}},Cke=(e,t)=>{if(Object.keys(e.jsonSchema).length)return;let n=e.zodSchema._zod.def,r=t.allowEmptySchema?.[n.type];if(!(r===!0||r?.[e.io])){switch(n.type){case`optional`:Cke({...e,zodSchema:n.innerType},t);return;case`any`:return;case`unknown`:return;case`pipe`:if(e.io===`output`)throw Error(`Zod transform found at ${e.path.join(` > `)} are not supported in output schemas. Please use \`.overwrite()\` or wrap the schema in a \`.pipe()\` or assign it manual metadata with \`.meta()\``);return;case`transform`:if(e.io===`output`)return;break;case`literal`:if(n.values.includes(void 0))throw Error(`Zod literal at ${e.path.join(` > `)} cannot include \`undefined\` as a value. Please use \`z.undefined()\` or \`.optional()\` instead.`);return}throw Error(`Zod schema of type \`${n.type}\` at ${e.path.join(` > `)} cannot be represented in OpenAPI. Please assign it metadata with \`.meta()\``)}},wke=(e,t,n,r)=>{let i=new Map;if(n.io===`input`)return i;let a=new Map,o=new Map;for(let[t,n]of Object.entries(e)){let e=JSON.stringify(n),i=RegExp(`"${r}([^"]+)"`,`g`),s=e.matchAll(i),c=new Set;for(let e of s){let n=e[1];n!==t&&c.add(n)}o.set(t,e),a.set(t,{dependencies:c})}for(let[r]of o){if(!n.registry.components.schemas.ids.get(r)||Tke(a,o,n.registry,r))continue;let s=t.get(r)??`${r}${n.opts.outputIdSuffix??`Output`}`;i.set(r,s),e[s]=e[r],delete e[r]}return i},Tke=(e,t,n,r,i=new Set)=>{if(i.has(r))return!0;let a=e.get(r);if(a.pure!==void 0)return a.pure;let o=t.get(r),s=n.components.schemas.ids.get(r);if(s&&o!==JSON.stringify(s))return a.pure=!1,!1;i.add(r);let c=[...a.dependencies].every(r=>Tke(e,t,n,r,new Set(i)));return a.pure=c,c},Eke=[`param`,`header`,`unusedIO`,`override`,`outputId`],Dke=e=>{Eke.forEach(t=>{delete e[t]})},Z9=e=>{delete e.$schema,delete e.id,delete e.$id},Oke=(e,t)=>{let n=t.opts.schemaRefPath??`#/components/schemas/`,r={};for(let[t,{zodType:n}]of Object.entries(e))r[t]=n;let i=h();i.add(v(r),{id:`zodOpenApiCreateSchema`});for(let[e,{zodType:n}]of t.registry.components.schemas.manual)i.add(n,{id:e});let a=new Map,o=xke(t.openapiVersion??`3.1.0`,`3.1.0`)?`$defs`:`definitions`,s=m(i,{override(e){let n=_.get(e.zodSchema);if(n?.outputId&&n?.id&&a.set(n.id,n.outputId),e.jsonSchema.$ref)return;let r={...e,io:t.io};Ske(r),typeof t.opts.override==`function`&&t.opts.override(r),typeof n?.override==`function`&&(n.override(r),delete e.jsonSchema.override),typeof n?.override==`object`&&n.override!==null&&(Object.assign(e.jsonSchema,n.override),delete e.jsonSchema.override),Z9(e.jsonSchema),Dke(e.jsonSchema),Cke(r,t.opts)},io:t.io,unrepresentable:`any`,reused:t.opts.reused,cycles:t.opts.cycles,target:xke(t.openapiVersion??`3.1.0`,`3.1.0`)?void 0:`openapi-3.0`,uri:e=>e===`__shared`?`#ZOD_OPENAPI/${e}`:`#ZOD_OPENAPI/__shared#/${o}/${e}`}),c=s.schemas.__shared?.[o]??{};s.schemas.__shared??={[o]:c};let l=new Map;for(let[e,r]of Object.entries(c))if(Z9(r),/^schema\d+$/.test(e)){let i=`__schema${t.registry.components.schemas.dynamicSchemaCount++}`;l.set(e,`"${n}${i}"`),i!==e&&(c[i]=r,delete c[e])}for(let[e]of t.registry.components.schemas.manual){let t=s.schemas[e];t&&Z9(t)}let u={},d=JSON.parse(JSON.stringify(s).replace(/"#ZOD_OPENAPI\/__shared#\/(?:\$defs|definitions)\/([^"]+)"/g,(e,r)=>l.get(r)||(t.registry.components.schemas.manual.get(r)&&(u[r]=!0),`"${n}${r}"`))),f=d.schemas.__shared?.[o]??{};d.schemas.__shared??={[o]:f};for(let[e]of t.registry.components.schemas.manual){let t=d.schemas[e];if(t&&u[e]){if(f[e])throw Error(`Component "${e}" is already registered as a component in the registry`);f[e]=t}}let p=wke(f,a,t,n);if(!p.size){let e=d.schemas.zodOpenApiCreateSchema?.properties;return delete d.schemas.zodOpenApiCreateSchema,delete d.schemas.__shared,{schemas:e,components:f,manual:d.schemas}}let g=JSON.parse(JSON.stringify(d).replace(RegExp(`"${n}([^"]+)"`,`g`),(e,t)=>{let r=p.get(t);return r?`"${n}${r}"`:`"${n}${t}"`})),y=g.schemas.zodOpenApiCreateSchema?.properties,b=g.schemas.__shared?.[o]??{};return delete g.schemas.zodOpenApiCreateSchema,delete g.schemas.__shared,{schemas:y,components:b,manual:g.schemas}},kke=e=>{let t={components:{schemas:{dynamicSchemaCount:0,input:new Map,output:new Map,ids:new Map,manual:new Map},headers:{ids:new Map,seen:new WeakMap},requestBodies:{ids:new Map,seen:new WeakMap},responses:{ids:new Map,seen:new WeakMap},parameters:{ids:new Map,seen:new WeakMap},callbacks:{ids:new Map,seen:new WeakMap},pathItems:{ids:new Map,seen:new WeakMap},securitySchemes:{ids:new Map,seen:new WeakMap},links:{ids:new Map,seen:new WeakMap},examples:{ids:new Map,seen:new WeakMap}},addSchema:(e,n,r)=>{let i={};return t.components.schemas[r.io].set(n.join(` > `),{schemaObject:i,zodType:e,source:{path:n,...r?.source}}),i},addParameter:(e,n,r)=>{let i=t.components.parameters.seen.get(e);if(i)return i;let a=_.get(e),o=r?.location?.name??a?.param?.name,s=r?.location?.in??a?.param?.in;if(r?.location?.name&&a?.param?.name||r?.location?.in&&a?.param?.in)throw Error(`Parameter at ${n.join(` > `)} has both \`.meta({ param: { name, in } })\` and \`.meta({ param: { location: { in, name } } })\` information`);if(!o||!s)throw Error(`Parameter at ${n.join(` > `)} is missing \`.meta({ param: { name, in } })\` information`);let c=t.addSchema(e,[...n,s,o,`schema`],{io:`input`,source:{type:`parameter`,location:{in:s,name:o}}}),{id:l,examples:u,...d}=a?.param??{},f={in:s,name:o,schema:c,...d},p=cke(u,t,[...n,s,o,`examples`]);p&&(f.examples=p),dke(e,`input`)&&(f.required=!0),!f.description&&a?.description&&(f.description=a.description);let m=l??r?.manualId;if(m){if(t.components.parameters.ids.has(m))throw Error(`Schema "${m}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/parameters/${m}`};return t.components.parameters.seen.set(e,i),t.components.parameters.ids.set(m,f),r?.manualId?f:i}return r?.location?.name||r?.location?.in||t.components.parameters.seen.set(e,f),f},addHeader:(e,n,r)=>{let i=t.components.headers.seen.get(e);if(i)return i;let a=_.get(e),{id:o,...s}=a?.header??{},c=o??r?.manualId,l=s;if(dke(e,`output`)&&(l.required=!0),!l.description&&a?.description&&(l.description=a.description),l.schema=t.addSchema(e,[...n,`schema`],{io:`output`,source:{type:`header`}}),c){if(t.components.schemas.ids.has(c))throw Error(`Schema "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/headers/${c}`};return t.components.headers.ids.set(c,l),t.components.headers.seen.set(e,i),r?.manualId?l:i}return t.components.headers.seen.set(e,l),l},addRequestBody:(e,n,r)=>{let i=t.components.requestBodies.seen.get(e);if(i)return i;let{content:a,id:o,...s}=e,c={...s,content:uke(a,{registry:t,io:`input`},[...n,`content`])},l=o??r?.manualId;if(l){if(t.components.requestBodies.ids.has(l))throw Error(`RequestBody "${l}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/requestBodies/${l}`};return t.components.requestBodies.ids.set(l,c),t.components.requestBodies.seen.set(e,i),r?.manualId?c:i}return t.components.requestBodies.seen.set(e,c),c},addPathItem:(e,n,r)=>{let i=t.components.pathItems.seen.get(e);if(i)return i;let a={},{id:o,...s}=e,c=o??r?.manualId;for(let[e,r]of Object.entries(s)){if(X9(e)){a[e]=r;continue}if(e===`get`||e===`put`||e===`post`||e===`delete`||e===`options`||e===`head`||e===`patch`||e===`trace`){a[e]=vke(r,t,[...n,e]);continue}if(e===`parameters`){a[e]=mke(r,t,[...n,e]);continue}a[e]=r}if(c){if(t.components.pathItems.ids.has(c))throw Error(`PathItem "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/pathItems/${c}`};return t.components.pathItems.ids.set(c,a),t.components.pathItems.seen.set(e,i),r?.manualId?a:i}return t.components.pathItems.seen.set(e,a),a},addResponse:(e,n,r)=>{let i=t.components.responses.seen.get(e);if(i)return i;let{content:a,headers:o,links:s,id:c,...l}=e,u=l,d=fke(o,t,[...n,`headers`]);d&&(u.headers=d),a&&(u.content=uke(a,{registry:t,io:`output`},[...n,`content`])),s&&(u.links=pke(s,t,[...n,`links`]));let f=c??r?.manualId;if(f){if(t.components.responses.ids.has(f))throw Error(`Response "${f}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/responses/${f}`};return t.components.responses.ids.set(f,u),t.components.responses.seen.set(e,i),r?.manualId?u:i}return t.components.responses.seen.set(e,u),u},addCallback:(e,n,r)=>{let i=t.components.callbacks.seen.get(e);if(i)return i;let{id:a,...o}=e,s={};for(let[e,r]of Object.entries(o)){if(X9(e)){s[e]=r;continue}s[e]=t.addPathItem(r,[...n,e])}let c=a??r?.manualId;if(c){if(t.components.callbacks.ids.has(c))throw Error(`Callback "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/callbacks/${c}`};return t.components.callbacks.ids.set(c,s),t.components.callbacks.seen.set(e,i),r?.manualId?s:i}return t.components.callbacks.seen.set(e,s),s},addSecurityScheme:(e,n,r)=>{let i=t.components.securitySchemes.seen.get(e);if(i)return i;let{id:a,...o}=e,s=o,c=a??r?.manualId;if(c){if(t.components.securitySchemes.ids.has(c))throw Error(`SecurityScheme "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/securitySchemes/${c}`};return t.components.securitySchemes.ids.set(c,s),t.components.securitySchemes.seen.set(e,i),r?.manualId?s:i}return t.components.securitySchemes.seen.set(e,s),s},addLink:(e,n,r)=>{let i=t.components.links.seen.get(e);if(i)return i;let{id:a,...o}=e,s=o,c=a??r?.manualId;if(c){if(t.components.links.ids.has(c))throw Error(`Link "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/links/${c}`};return t.components.links.ids.set(c,s),t.components.links.seen.set(e,i),r?.manualId?s:i}return t.components.links.seen.set(e,s),s},addExample:(e,n,r)=>{let i=t.components.examples.seen.get(e);if(i)return i;let{id:a,...o}=e,s=o,c=a??r?.manualId;if(c){if(t.components.examples.ids.has(c))throw Error(`Example "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/examples/${c}`};return t.components.examples.ids.set(c,s),t.components.examples.seen.set(e,i),r?.manualId?s:i}return t.components.examples.seen.set(e,s),s}};return Ake(e?.schemas,t),jke(e?.parameters,t),Mke(e?.headers,t),Nke(e?.responses,t),Ike(e?.pathItems,t),Pke(e?.requestBodies,t),Fke(e?.callbacks,t),Lke(e?.securitySchemes,t),Rke(e?.links,t),zke(e?.examples,t),t},Ake=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){let e=_.get(r)?.id??n;t.components.schemas.manual.set(e,{input:{schemaObject:{}},output:{schemaObject:{}},zodType:r});continue}t.components.schemas.ids.set(n,r)}},jke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){let e=[`components`,`parameters`,n];t.addParameter(r,e,{manualId:n});continue}t.components.parameters.ids.set(n,r)}},Mke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){let e=[`components`,`headers`,n];t.addHeader(r,e,{manualId:n});continue}t.components.headers.ids.set(n,r)}},Nke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){let e=t.addResponse(r,[`components`,`responses`,n],{manualId:n});t.components.responses.ids.set(n,e),t.components.responses.seen.set(r,e)}},Pke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){t.addRequestBody(r,[`components`,`requestBodies`,n],{manualId:n});continue}t.components.requestBodies.ids.set(n,r)}},Fke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addCallback(r,[`components`,`callbacks`,n],{manualId:n})},Ike=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addPathItem(r,[`components`,`pathItems`,n],{manualId:n})},Lke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addSecurityScheme(r,[`components`,`securitySchemes`,n],{manualId:n})},Rke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addLink(r,[`components`,`links`,n],{manualId:n})},zke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.components.examples.ids.set(n,r)},Bke=e=>{let{schemas:t,components:n,manual:r}=Oke(Object.fromEntries(e.registry.components.schemas[e.io]),e);for(let[t,r]of Object.entries(n))e.registry.components.schemas.ids.set(t,r);for(let[n,r]of Object.entries(t)){let t=e.registry.components.schemas[e.io].get(n);t&&Object.assign(t.schemaObject,r)}for(let[t,i]of Object.entries(r)){let r=e.registry.components.schemas.manual.get(t);r&&(n[t]&&(r[e.io].used=!0),Object.assign(r[e.io].schemaObject,i))}},Vke=e=>{for(let[t,n]of e.components.schemas.manual)if(!n.input.used){let r=n[_.get(n.zodType)?.unusedIO??`output`].schemaObject;e.components.schemas.ids.set(t,r)}},Hke=(e,t,n)=>{Bke({registry:e,io:`input`,opts:t,openapiVersion:n}),Bke({registry:e,io:`output`,opts:t,openapiVersion:n}),Vke(e);let r={};return e.components.schemas.ids.size>0&&(r.schemas=Object.fromEntries(e.components.schemas.ids)),e.components.headers.ids.size>0&&(r.headers=Object.fromEntries(e.components.headers.ids)),e.components.requestBodies.ids.size>0&&(r.requestBodies=Object.fromEntries(e.components.requestBodies.ids)),e.components.responses.ids.size>0&&(r.responses=Object.fromEntries(e.components.responses.ids)),e.components.parameters.ids.size>0&&(r.parameters=Object.fromEntries(e.components.parameters.ids)),e.components.callbacks.ids.size>0&&(r.callbacks=Object.fromEntries(e.components.callbacks.ids)),e.components.pathItems.ids.size>0&&(r.pathItems=Object.fromEntries(e.components.pathItems.ids)),e.components.securitySchemes.ids.size>0&&(r.securitySchemes=Object.fromEntries(e.components.securitySchemes.ids)),e.components.links.ids.size>0&&(r.links=Object.fromEntries(e.components.links.ids)),e.components.examples.ids.size>0&&(r.examples=Object.fromEntries(e.components.examples.ids)),r},Uke=(e,t={})=>{let{paths:n,webhooks:r,components:i,...a}=e,o=a,s=kke(i),c=yke(n,s,[`paths`]);c&&(o.paths=c);let l=yke(r,s,[`webhooks`]);l&&(o.webhooks=l);let u=Hke(s,t,e.openapi);return Object.keys(u).length>0&&(o.components=u),o},Wke=M(p,`openapi`);function Gke(e){return e.match(/^\/(v\d+)/)?.[1]}function Kke(e){return e.replace(/:(\w+)/g,`{$1}`)}function qke(e,t){let n=Kke(e),r={summary:t.summary,description:t.description};(t.request?.params||t.request?.query||t.request?.headers)&&(r.requestParams={},t.request.params&&(r.requestParams.path=t.request.params),t.request.query&&(r.requestParams.query=t.request.query),t.request.headers&&(r.requestParams.header=t.request.headers)),t.request?.body&&(r.requestBody={content:{"application/json":{schema:t.request.body}}}),r.responses={};for(let[e,n]of Object.entries(t.responses))r.responses[e]={description:n.description,content:{"application/json":{schema:n.content[`application/json`].schema}}};return{path:n,config:r}}function Jke(e,t,n){let r={};for(let n of e){if(n.version!==t)continue;let e=n.path.replace(`/${t}`,``)||`/`;for(let t of n.openAPISpec){let{path:n,config:i}=qke(e,t);r[n]||(r[n]={}),r[n][t.method]=i}}return Uke({openapi:`3.1.0`,info:n?.info||{title:`API ${t.toUpperCase()}`,version:t.replace(`v`,``),description:`OpenAPI specification for ${t} API`},servers:n?.servers||[{url:`http://localhost:8000/${t}`,description:process.env.NODE_ENV===`production`?`Production server`:`Development server`}],paths:r})}async function Yke(e){let t=M(l,s);try{await N(t)}catch(t){return e.logger.error({error:t},`OpenAPI routes directory not found`),[]}let n=await(0,ske.remixRoutesOptionAdapter)(e=>(0,oke.flatRoutes)(s,e,{appDir:l,ignoredRouteFiles:[`**/.*`,`**/*.{spec,test}.{ts,tsx}`,`**/*-????????.{js,ts}`]})),r=[];for(let[t,i]of Object.entries(n)){let t=M(l,i.file).replace(/\.ts$/,`.${o}`);try{let n=(await import(t)).default;if(!n||QOe(n)||/\/openapi.(j|t)s$/.test(t))continue;if(!n?.handlers&&!n?.openAPISpec){e.logger.warn(`Missing default export with 'defineOpenAPI' for '${l}/${i.file}'`);continue}let a=`/${i.path}`;r.push({path:a,filePath:t,handlers:n.handlers,openAPISpec:n.openAPISpec,version:Gke(a)})}catch(t){e.logger.error(t,`Error loading route ${i.file}:`)}}return r}function Xke(e,t){for(let n of t)for(let[t,r]of Object.entries(n.handlers))e[t.toLowerCase()](n.path,r)}async function Zke(e,t){let n=M(l,s,`${t}+/openapi.${o}`);try{let t=(await import(n)).default;return t?t(e):void 0}catch{return}}async function Qke(e,t){let n=[...new Set(t.map(e=>e.version).filter(Boolean))];n.length>0&&await ct(Wke,{recursive:!0});for(let r of n){let n=Jke(t,r,await Zke(e,r));await ut(nt(Wke,`${r}.json`),JSON.stringify(n,null,2),`utf-8`)}}async function $ke(e){let t=await Yke(e.locals.container);Xke(e,t),process.env.NODE_ENV!==`production`&&await Qke(e.locals.container,t)}async function eAe({container:e}){let t=!1,{host:n=`0.0.0.0`,port:r,timeout:i=3e4,bodyLimit:a=`1mb`,healthPath:o=`/health`,cors:s,helmet:c,rateLimit:d,redisUrl:f}=e.server,m=An();m.disable(`x-powered-by`),m.locals.container=e;let h=null;if(f&&d)try{h=(0,FOe.createClient)({url:f}),h.on(`error`,t=>{e.logger.error({error:t.message},`Redis client error`)}),await h.connect(),e.logger.info(`Connected to Redis for rate limiting`)}catch(t){e.logger.error({error:t instanceof Error?t.message:t},`Failed to connect to Redis, falling back to in-memory rate limiting`),h=null}if(m.use(UOe(e.logger,()=>t),WOe(e.logger,i),HOe(e.logger),ROe(o)),c!==void 0&&m.use(AOe(c)),s!==void 0&&m.use((0,BDe.default)(s)),d)for(let[e,t]of d.entries()){let n=sOe({windowMs:t.windowMs??60*1e3,limit:t.limit??100,standardHeaders:t.standardHeaders??`draft-8`,legacyHeaders:t.legacyHeaders??!1,skip:t.skip,keyGenerator:t.keyGenerator,handler:t.handler,message:t.message,statusCode:t.statusCode,requestPropertyName:t.requestPropertyName,skipFailedRequests:t.skipFailedRequests,skipSuccessfulRequests:t.skipSuccessfulRequests,requestWasSuccessful:t.requestWasSuccessful,validate:t.validate,store:h?new POe({sendCommand:(...e)=>h.sendCommand(e),prefix:`rl:${e}:`}):t.store});m.use(n)}if(m.use(zOe(e.i18n),An.json({limit:a}),An.urlencoded({extended:!0,limit:a})),await KOe(nt(process.cwd(),l,u),e,m),m.get(`/`,(t,n)=>{n.json({message:`${e.config.APP_NAME} server is running.`})}).all(`${e.auth.options.basePath}/*`,kDe(e.auth)),await $ke(m),m.use(An.static(M(p))),process.env.NODE_ENV!==`production`){let{defineYouchErrorHandler:t}=await import(`./youch-handler-DrYdbUhe.mjs`);m.use(t(e.logger))}else m.use(LOe(e.logger));return{app:m,host:n,port:r,async start(){await new Promise((e,t)=>{try{m.listen(r,n,()=>{e()})}catch(e){t(e)}})},async close(){if(t=!0,m.uwsApp.close(),h)try{await h.destroy()}catch(t){e.logger.warn({error:t instanceof Error?t.message:t},`Error disconnecting from Redis`)}}}}function tAe(){return{async start(){await it.launch()},async close(){await it.shutdown()}}}const nAe=`(AppOS v${bDe} | Node ${process.version})`;var rAe=ki({description:`Start the HTTP server and/or DBOS workflow worker`,aliases:[`s`],args:y([]),opts:v({service:g([`server`,`worker`]).optional().meta({short:`s`,description:`Start only a specific service (default: both)`})}),async run(e){let{container:t,opts:n}=e,{logger:r}=t,i=!n.service||n.service===`server`,a=!n.service||n.service===`worker`,o=null,s=null,c=!1,l=async t=>{if(!c){c=!0,r.info(`Shutdown initiated (${t})`);try{o&&(await o.close(),r.info(`HTTP server stopped`)),s&&(await s.close(),r.info(`DBOS worker stopped`)),await e.cleanup()}catch(e){r.error({error:e},`Shutdown error`)}process.exit(0)}};process.on(`SIGINT`,()=>l(`SIGINT`)),process.on(`SIGTERM`,()=>l(`SIGTERM`)),a&&(s=tAe(),await s.start(),r.info(`DBOS worker ready ${nAe}`)),i&&(o=await eAe({container:t}),await o.start(),r.info(`HTTP server ready at http://${o.host}:${o.port} ${nAe}`))}}),iAe=ki({description:`Setup the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`up`);try{await e.spinner(`Starting containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`up`,`--wait`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}e.step(`Running schema migrations`),await C9({ctx:e,migrationType:`schema`}),e.step(`Seeding databases`),await w9({ctx:e}),await e.cleanup(),e.outro()}});const aAe={build:Pi,"db:data:gen":pDe,"db:data:migrate":mDe,"db:schema:gen":hDe,"db:schema:migrate":gDe,"db:seed":_De,down:vDe,preview:yDe,repl:SDe,reset:CDe,start:rAe,up:iAe};function oAe(e,t=e){let n=[];try{let r=rt.readdirSync(e,{withFileTypes:!0});for(let i of r){let r=$e.join(e,i.name);i.isDirectory()?n.push(...oAe(r,t)):i.isFile()&&i.name.endsWith(`.${o}`)&&!/\.(spec|test)\.[jt]sx?$/.test(i.name)&&n.push(r)}}catch{}return n}function sAe(e,t){return $e.relative(t,e).replace(RegExp(`\\.${o}$`),``).replace(/\//g,`:`)}async function cAe(e,t){let n={},r=[],i=new Map;if(t.opts&&`shape`in t.opts){let e=t.opts.shape;for(let[t,n]of Object.entries(e)){let e=n.meta?.();e?.short&&typeof e.short==`string`&&i.set(e.short,t)}}for(let t=0;t<e.length;t++){let a=e[t];if(a.startsWith(`--`)){let[r,...i]=a.slice(2).split(`=`);if(i.length>0)n[r]=i.join(`=`);else{let i=e[t+1];i&&!i.startsWith(`-`)?(n[r]=i,t++):n[r]=!0}}else if(a.startsWith(`-`)&&a.length>1){let r=a.slice(1);if(r.length>1)for(let e of r){let t=i.get(e);t&&(n[t]=!0)}else{let a=r,o=i.get(a)||a,s=e[t+1];s&&!s.startsWith(`-`)?(n[o]=s,t++):n[o]=!0}}else r.push(a)}let a={};if(t.opts&&`safeParse`in t.opts){let e=t.opts.safeParse(n);if(!e.success){for(let t of e.error.issues){let e=t.path.join(`.`);console.error(F.default.red(`Error:\n --${e} => ${t.message.toLowerCase()}`))}process.exit(1)}a=e.data}let o=[];if(t.args&&`safeParse`in t.args){let e=t.args.safeParse(r);if(!e.success){for(let t of e.error.issues){let e=t.path.join(`.`);console.error(F.default.red(`Error:\n ${e} => ${t.message.toLowerCase()}`))}process.exit(1)}o=e.data}return{args:o,options:a}}function Q9(e,t){console.log(`${F.default.bold(e.config.APP_NAME)} - ${e.config.APP_DESC}\n`),console.log(`Commands:`);let n=0;for(let[e,r]of t){let t=r.aliases&&r.aliases.length>0?` (${r.aliases.join(`, `)})`:``,i=e.length+t.length;n=Math.max(n,i)}n+=8;for(let[e,r]of t){let t=r.aliases&&r.aliases.length>0?` (${r.aliases.join(`, `)})`:``,i=r.aliases&&r.aliases.length>0?F.default.dim(` (${r.aliases.join(`, `)})`):``,a=`${F.default.cyan(e)}${i}`,o=e.length+t.length,s=` `.repeat(Math.max(0,n-o));console.log(` ${a}${s}${r.description||`No description`}`)}}function lAe(e,t){console.log(`${t.description||`No description`}`),console.log();let n=`Usage: ${F.default.cyan(e)}`;if(t.args){let e=t.args._def,r=e?.typeName||e?.type;if(r===`ZodTuple`||r===`tuple`){let t=e.items||[];for(let e of t){let t=e,r=t.meta?.()?.name||t._def?.description||`arg`,i=t.isOptional?.()??!1;n+=i?` [${r}]`:` <${r}>`}if(e.rest){let t=e.rest._def?.description||`args`;n+=` [${t}...]`}}else if(r===`ZodArray`||r===`array`){let r=t.args.meta?.()?.name||`args`,i=e.minLength?.value||0;i===0?n+=` [${r}...]`:i===1?n+=` <${r}>`:n+=` <${r}...>`}}if(t.opts&&(n+=` [options]`),console.log(n),console.log(),t.args){let e=t.args._def,n=e?.typeName||e?.type;if(n===`ZodTuple`||n===`tuple`||n===`ZodArray`||n===`array`){if(console.log(`Arguments:`),n===`ZodTuple`||n===`tuple`){let t=e.items||[];for(let e=0;e<t.length;e++){let n=t[e],r=n.meta?.(),i=r?.name||n._def?.description||`arg${e+1}`,a=r?.description||n._def?.description||i,o=n.isOptional?.()??!1?``:` (required)`;console.log(` ${F.default.cyan(i)}${F.default.dim(o)}\t\t${a}`)}if(e.rest){let t=e.rest._def?.description||`additional args`;console.log(` ${F.default.cyan(`${t}...`)}\t\t${t}`)}}else{let n=t.args.meta?.(),r=n?.name||`args`,i=n?.description||``,a=e.minLength?.value||0,o=r;(a===0||a>1)&&(o=`${r}...`);let s=a>0?` (required)`:``;console.log(` ${F.default.cyan(o)}${F.default.dim(s)}\t\t${i}`)}console.log()}}if(console.log(`Options:`),console.log(` ${F.default.cyan(`-h, --help`)}\t\t\tShow help for this command`),t.opts&&`shape`in t.opts){let e=t.opts.shape;for(let[t,n]of Object.entries(e)){let e=n,r=e.meta?.(),i=e.isOptional?.()??!0,a=e._def?.typeName===`ZodBoolean`,o=r?.short?`-${r.short}, `:` `,s=`--${t}`,c=a?``:` <value>`,l=i?``:` (required)`,u=e._def?.defaultValue,d=u===void 0?``:`(default: ${JSON.stringify(u)})`,f=r?.description||``;console.log(` ${F.default.cyan(o+s+c)}\t\t${f} ${F.default.dim(l+d)}`)}}}async function uAe(e,t,n){let r=oAe(e);for(let i of r)try{let r=(await import(i)).default;if(r&&typeof r==`object`&&`run`in r){let a=sAe(i,e);if(t.set(a,r),r.aliases)for(let e of r.aliases)n.set(e,a)}}catch(e){console.warn(F.default.yellow(`Warning: Could not load command from ${i}: ${e instanceof Error?e.message:String(e)}`))}}async function dAe(e){let t=new Map,n=new Map,r=process.env.NODE_ENV===`production`;for(let[e,i]of Object.entries(aAe))if(!(r&&i.devOnly)&&(t.set(e,i),i.aliases))for(let t of i.aliases)n.set(t,e);return await uAe(e.commandsDir,t,n),await b({container:e.container}),it.setConfig({name:e.container.config.APP_NAME,runAdminServer:!1,systemDatabaseUrl:e.container.worker.dbUrl}),await f({container:e.container,dbos:it}),{async run(r=process.argv.slice(2)){let[i,...a]=r;if(!i||i===`--help`||i===`-h`){Q9(e.container,t);return}let o=n.get(i)||i,s=t.get(o);if(s||(console.error(F.default.red(`Unknown command: ${i}\n`)),Q9(e.container,t),process.exit(1)),a.includes(`--help`)||a.includes(`-h`)){lAe(o,s);return}try{let{args:t,options:n}=await cAe(a,s),r=Oi(t,n,e.container);await s.run(r)}catch(e){e instanceof Error&&(console.error(F.default.red(`Error:`),e.message),(e.message.includes(`argument`)||e.message.includes(`Invalid arguments`))&&(console.log(),console.log(`Run '${F.default.cyan(`${o} --help`)}' to see usage information.`))),process.exit(1)}},showHelp(){Q9(e.container,t)},showCommandHelp(e){lAe(Array.from(t.entries()).find(([t,n])=>n===e)?.[0]||`unknown`,e)}}}const $9=Xe(import.meta.url),{GlobalLogger:fAe}=$9(nt(tt(tt(tt($9.resolve(`@dbos-inc/dbos-sdk`)))),`dist/src/telemetry/logs`));async function pAe(){let{defineContainer:e}=await import(nt(process.cwd(),l,`main.${o}`)),t=await e();fAe.prototype.info=(e,n)=>{if(typeof e==`string`){if(e.startsWith(`Initializing DBOS`)||e.startsWith(`System Database URL:`)||e.startsWith(`Executor ID:`)||e.startsWith(`Application version:`)||e.startsWith(`No workflows to recover from application`)||e.startsWith(`DBOS launched!`))return;t.logger.info(n,e)}else t.logger.info(n,JSON.stringify(e))},await(await dAe({container:t,commandsDir:nt(process.cwd(),l,a)})).run(process.argv.slice(2))}try{await pAe()}catch(e){console.error(e),process.exit(1)}export{};
|
|
1557
|
+
>>> no match, partial?`,t,f,n,p),f===c))}let a;if(typeof u==`string`?(a=d===u,this.debug(`string match`,u,d,a)):(a=u.test(d),this.debug(`pattern match`,u,d,a)),!a)return!1}if(o===c&&s===l)return!0;if(o===c)return r;if(s===l)return o===c-1&&t[o]===``;throw Error(`wtf?`)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,n.assertValidPattern)(t);let i=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let a,w=null;(a=t.match(g))?w=i.dot?v:_:(a=t.match(o))?w=(i.nocase?i.dot?u:l:i.dot?c:s)(a[1]):(a=t.match(y))?w=(i.nocase?i.dot?x:b:i.dot?S:C)(a):(a=t.match(d))?w=i.dot?p:f:(a=t.match(m))&&(w=h);let T=r.AST.fromGlob(t,this.options).toMMPattern();return w&&typeof T==`object`&&Reflect.defineProperty(T,`test`,{value:w}),T}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?`[^/]*?`:n.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?O(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|\\/`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))});let a=n.filter(t=>t!==e.GLOBSTAR);if(this.partial&&a.length>=1){let e=[];for(let t=1;t<=a.length;t++)e.push(a.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return a.join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.partial&&(a=`^(?:\\/|`+o+a.slice(1,-1)+s+`)$`),this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};e.Minimatch=ne;var k=rke();Object.defineProperty(e,`AST`,{enumerable:!0,get:function(){return k.AST}});var A=ike();Object.defineProperty(e,`escape`,{enumerable:!0,get:function(){return A.escape}});var re=q9();Object.defineProperty(e,`unescape`,{enumerable:!0,get:function(){return re.unescape}}),e.minimatch.AST=r.AST,e.minimatch.Minimatch=ne,e.minimatch.escape=i.escape,e.minimatch.unescape=a.unescape})),oke=i(((t,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{createRouteId:()=>A,createRoutePath:()=>ee,default:()=>y,defaultVisitFiles:()=>k,flatRoutes:()=>y,getRouteInfo:()=>E,getRouteSegments:()=>D,isIndexRoute:()=>T,isRouteModuleFile:()=>C,normalizeSlashes:()=>re}),n.exports=f(p);var m=d(e(`fs`),1),h=ake(),g=d(e(`path`),1),_={appDir:`app`,routeDir:`routes`,basePath:`/`,paramPrefixChar:`$`,nestedDirectoryChar:`+`,routeRegex:/((\${nestedDirectoryChar}[\/\\][^\/\\:?*]+)|[\/\\]((index|route|layout|page)|(_[^\/\\:?*]+)|([^\/\\:?*]+\.route)))\.(ts|tsx|js|jsx|md|mdx)$$/},v=void 0;function y(e,t,n={}){let r=b(n.appDir??_.appDir,n.ignoredRouteFiles??[],{..._,...n,routeDir:e,defineRoutes:t});return Object.values(r).forEach(e=>{e.parentId===void 0&&(e.parentId=`root`)}),r}function b(e,t,n){let r=[];t&&!Array.isArray(t)?n=t:r=t??[],n||=_;let i=new Map,a=new Map,o=Array.isArray(n.routeDir)?n.routeDir:[n.routeDir??`routes`],s=n.defineRoutes??v;if(!s)throw Error(`You must provide a defineRoutes function`);let c=n.visitFiles??k,l=ae(n.routeRegex??_.routeRegex,n.nestedDirectoryChar??_.nestedDirectoryChar);for(let t of o)c(g.join(e,t),e=>{if(!(r&&r.some(t=>(0,h.minimatch)(e,t,{dot:!0})))&&C(e,l)){let r=E(t,e,n);i.set(r.id,r),a.set(r.name,r);return}});Array.from(i.values()).forEach(e=>{e.parentId=te(e,a)});function u(e,t){let n=Array.from(i.values()).filter(e=>e.parentId===t),r=(t?i.get(t):void 0)?.path??`/`;for(let t of n){let n=t?.path?.slice(r.length)??``;if(n.startsWith(`/`)&&(n=n.slice(1)),t.index){if(Object.values(i).filter(e=>e.parentId===t.id).length>0)throw Error(`Child routes are not allowed in index routes. Please remove child routes of ${t.id}`);e(n,i.get(t.id).file,{index:!0})}else e(n,i.get(t.id).file,()=>{u(e,t.id)})}}return s(u)}var x=[`.js`,`.jsx`,`.ts`,`.tsx`,`.md`,`.mdx`],S=/\.server\.(ts|tsx|js|jsx|md|mdx)$/;function C(e,t){return e.includes(g.sep)?t.test(e)?!S.test(e):!1:x.includes(g.extname(e))}var w=(()=>{let e={};return t=>{if(t in e)return e[t];let n=new RegExp(t);return e[t]=n,n}})();function T(e,t){return w(`((^|[.]|[${t.nestedDirectoryChar.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`)}]\\/)(index|_index))(\\/[^\\/]+)?$|(\\/_?index\\/)`).test(e)}function E(e,t,n){let r=re(g.join(e,t)),i=A(r),a=i.slice(e.length+1),o=T(a,n),s=D(a,o,n.paramPrefixChar,n.nestedDirectoryChar);return{id:i,path:ee(s,o,n),file:r,name:s.join(`/`),segments:s,index:o}}function ee(e,t,n){let r=``,i=n.basePath??`/`,a=n.paramPrefixChar??`$`;t&&(e[e.length-1]=``);for(let t=0;t<e.length;t++){let n=e[t];if(!n.startsWith(`_`)){if(n.endsWith(`_`)&&(n=n.slice(0,-1)),n.includes(`[`)&&n.includes(`]`)){let e=``,t=0;for(let r of n)r===`[`&&t===0?t++:r===`]`&&t>0?t--:e+=r;n=e}n.startsWith(a)?n===a?r+=`/*`:r+=`/:${n.slice(1)}`:n.startsWith(`(${a}`)?r+=`/:${n.slice(2,n.length-1)}?`:n.startsWith(`(`)?r+=`/${n.slice(1,n.length-1)}?`:r+=`/${n}`}}return i!==`/`&&(r=i+r),r.endsWith(`/`)&&(r=r.slice(0,-1)),r||void 0}function te(e,t){let n=e.segments.slice(0,-1).join(`/`);for(;n;){if(t.has(n))return t.get(n).id;n=n.substring(0,n.lastIndexOf(`/`))}}function D(e,t,n=`$`,r=`+`){let i=[],a=0,o=``,s=`START`,c=`NORMAL`,l=!1,u=r.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`),d=RegExp(`${u}[/\\\\]`,`g`),f=RegExp(`${u}[/\\\\]`),p=`${u}/_\\.`;if(new RegExp(p).test(e)){let t=new RegExp(p,`g`);e=e.replace(t,`_${r}/`)}f.test(e)&&(e=e.replace(d,`.`),l=!0);let m=/\//.test(e);if((l&&m||!l)&&!e.endsWith(`.route`)){let t=e.lastIndexOf(`/`);t>=0&&(e=e.substring(0,t))}let h=e=>{e&&i.push(e)};for(;a<e.length;){let t=e[a];switch(s){case`START`:if(o.includes(n)&&!(o.startsWith(n)||o.startsWith(`(${n}`)))throw Error(`Route params must start with prefix char ${n}: ${o}`);if(o.includes(`(`)&&!o.startsWith(`(`)&&!o.endsWith(`)`))throw Error(`Optional routes must start and end with parentheses: ${o}`);h(o),o=``,s=`PATH`;continue;case`PATH`:if(ne(t)&&c===`NORMAL`){s=`START`;break}else t===`[`?c=`ESCAPE`:t===`]`&&(c=`NORMAL`);o+=t;break}a++}return h(o),i.at(-1)===`route`&&(i=i.slice(0,-1)),!t&&l&&i.at(-1)?.startsWith(`_`)&&(i=i.slice(0,-1)),i}var O=/[\/\\.]/;function ne(e){return O.test(e)}function k(e,t,n=e){for(let r of m.readdirSync(e)){let i=g.resolve(e,r),a=m.statSync(i);a.isDirectory()?k(i,t,n):a.isFile()&&t(g.relative(n,i))}}function A(e){return re(ie(e))}function re(e){return e.split(g.win32.sep).join(`/`)}function ie(e){return e.replace(/\.[a-z0-9]+$/i,``)}var ae=(e,t)=>(t=t.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`),new RegExp(e.source.replace("\\${nestedDirectoryChar}",`[${t}]`)))}))(),ske=qOe();const J9=e=>typeof e==`object`&&!!e&&`_zod`in e,cke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e))r[i]=t.addExample(a,[...n,i]);return r},lke=(e,t,n)=>{let{schema:r,examples:i,...a}=e,o=a;return J9(r)?o.schema=t.registry.addSchema(r,[...n,`schema`],{io:t.io,source:{type:`mediaType`}}):o.schema=r,i&&(o.examples=cke(i,t.registry,[...n,`examples`])),o},uke=(e,t,n)=>{let r={};for(let[i,a]of Object.entries(e))a&&(r[i]=lke(a,t,[...n,i]));return r},Y9=(e,t,n)=>{let r=e._zod.def;switch(r.type){case`object`:return e;case`lazy`:return Y9(r.getter(),t,n);case`pipe`:return Y9(t===`input`?r.in:r.out,t,n)}throw Error(`Failed to unwrap ZodObject from type: ${e._zod.def.type} at ${n.join(` > `)}`)},dke=(e,t)=>t===`input`?e._zod.optin===void 0:e._zod.optout===void 0,fke=(e,t,n)=>{if(e){if(J9(e)){let r=Y9(e,`output`,n),i={};for(let[e,a]of Object.entries(r._zod.def.shape))i[e]=t.addHeader(a,[...n,e]);return i}return e}},pke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e))r[i]=t.addLink(a,[...n,i]);return r},mke=(e,t,n)=>{if(!e)return;let r=[];for(let i of e){if(J9(i)){let e=t.addParameter(i,[...n,`parameters`]);r.push(e);continue}r.push(i)}return r},hke=(e,t,n)=>{if(!e)return;let r=[];for(let[i,a]of Object.entries(e??{})){let e=Y9(a,`input`,n);for(let[a,o]of Object.entries(e._zod.def.shape)){let e=t.addParameter(o,[...n,i,a],{location:{in:i,name:a}});r.push(e)}}return r},X9=e=>e.startsWith(`x-`),gke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e)){if(X9(i)){r[i]=a;continue}r[i]=t.addCallback(a,[...n,i])}return r},_ke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e))if(a){if(X9(i)){r[i]=a;continue}if(`$ref`in a){r[i]=a;continue}r[i]=t.addResponse(a,[...n,i])}return r},vke=(e,t,n)=>{let{parameters:r,requestParams:i,requestBody:a,responses:o,callbacks:s,...c}=e,l=c,u=mke(r,t,[...n,`parameters`]),d=hke(i,t,[...n,`requestParams`]);(d||u)&&(l.parameters=[...d??[],...u??[]]);let f=a&&t.addRequestBody(a,n);f&&(l.requestBody=f);let p=_ke(o,t,[...n,`responses`]);p&&(l.responses=p);let m=gke(s,t,[...n,`callbacks`]);return m&&(l.callbacks=m),l},yke=(e,t,n)=>{if(!e)return;let r={};for(let[i,a]of Object.entries(e)){if(X9(i)){r[i]=a;continue}r[i]=t.addPathItem(a,[...n,i])}return r},bke=[`3.0.0`,`3.0.1`,`3.0.2`,`3.0.3`,`3.1.0`,`3.1.1`],xke=(e,t)=>bke.indexOf(e)>=bke.indexOf(t),Ske=e=>{let t=e.zodSchema._zod.def;switch(t.type){case`bigint`:e.jsonSchema.type=`integer`,e.jsonSchema.format=`int64`;break;case`union`:{if(`discriminator`in t&&typeof t.discriminator==`string`){e.jsonSchema.oneOf??=e.jsonSchema.anyOf,delete e.jsonSchema.anyOf,e.jsonSchema.type=`object`,e.jsonSchema.discriminator={propertyName:t.discriminator};let n={};for(let[r,i]of Object.entries(e.jsonSchema.oneOf)){let a=i.$ref;if(!a){delete e.jsonSchema.discriminator;return}let o=t.options[Number(r)]._zod.propValues?.[t.discriminator];if(!o?.size)return;for(let e of[...o??[]]){if(typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)return;n[String(e)]=a}}e.jsonSchema.discriminator.mapping=n}let n=_.get(e.zodSchema);typeof n?.unionOneOf==`boolean`&&(n.unionOneOf&&(e.jsonSchema.oneOf=e.jsonSchema.anyOf,delete e.jsonSchema.anyOf),delete e.jsonSchema.unionOneOf);break}case`date`:e.jsonSchema.type=`string`;break;case`literal`:if(t.values.includes(void 0))break;break;case`undefined`:e.jsonSchema.not={};break}},Cke=(e,t)=>{if(Object.keys(e.jsonSchema).length)return;let n=e.zodSchema._zod.def,r=t.allowEmptySchema?.[n.type];if(!(r===!0||r?.[e.io])){switch(n.type){case`optional`:Cke({...e,zodSchema:n.innerType},t);return;case`any`:return;case`unknown`:return;case`pipe`:if(e.io===`output`)throw Error(`Zod transform found at ${e.path.join(` > `)} are not supported in output schemas. Please use \`.overwrite()\` or wrap the schema in a \`.pipe()\` or assign it manual metadata with \`.meta()\``);return;case`transform`:if(e.io===`output`)return;break;case`literal`:if(n.values.includes(void 0))throw Error(`Zod literal at ${e.path.join(` > `)} cannot include \`undefined\` as a value. Please use \`z.undefined()\` or \`.optional()\` instead.`);return}throw Error(`Zod schema of type \`${n.type}\` at ${e.path.join(` > `)} cannot be represented in OpenAPI. Please assign it metadata with \`.meta()\``)}},wke=(e,t,n,r)=>{let i=new Map;if(n.io===`input`)return i;let a=new Map,o=new Map;for(let[t,n]of Object.entries(e)){let e=JSON.stringify(n),i=RegExp(`"${r}([^"]+)"`,`g`),s=e.matchAll(i),c=new Set;for(let e of s){let n=e[1];n!==t&&c.add(n)}o.set(t,e),a.set(t,{dependencies:c})}for(let[r]of o){if(!n.registry.components.schemas.ids.get(r)||Tke(a,o,n.registry,r))continue;let s=t.get(r)??`${r}${n.opts.outputIdSuffix??`Output`}`;i.set(r,s),e[s]=e[r],delete e[r]}return i},Tke=(e,t,n,r,i=new Set)=>{if(i.has(r))return!0;let a=e.get(r);if(a.pure!==void 0)return a.pure;let o=t.get(r),s=n.components.schemas.ids.get(r);if(s&&o!==JSON.stringify(s))return a.pure=!1,!1;i.add(r);let c=[...a.dependencies].every(r=>Tke(e,t,n,r,new Set(i)));return a.pure=c,c},Eke=[`param`,`header`,`unusedIO`,`override`,`outputId`],Dke=e=>{Eke.forEach(t=>{delete e[t]})},Z9=e=>{delete e.$schema,delete e.id,delete e.$id},Oke=(e,t)=>{let n=t.opts.schemaRefPath??`#/components/schemas/`,r={};for(let[t,{zodType:n}]of Object.entries(e))r[t]=n;let i=h();i.add(v(r),{id:`zodOpenApiCreateSchema`});for(let[e,{zodType:n}]of t.registry.components.schemas.manual)i.add(n,{id:e});let a=new Map,o=xke(t.openapiVersion??`3.1.0`,`3.1.0`)?`$defs`:`definitions`,s=m(i,{override(e){let n=_.get(e.zodSchema);if(n?.outputId&&n?.id&&a.set(n.id,n.outputId),e.jsonSchema.$ref)return;let r={...e,io:t.io};Ske(r),typeof t.opts.override==`function`&&t.opts.override(r),typeof n?.override==`function`&&(n.override(r),delete e.jsonSchema.override),typeof n?.override==`object`&&n.override!==null&&(Object.assign(e.jsonSchema,n.override),delete e.jsonSchema.override),Z9(e.jsonSchema),Dke(e.jsonSchema),Cke(r,t.opts)},io:t.io,unrepresentable:`any`,reused:t.opts.reused,cycles:t.opts.cycles,target:xke(t.openapiVersion??`3.1.0`,`3.1.0`)?void 0:`openapi-3.0`,uri:e=>e===`__shared`?`#ZOD_OPENAPI/${e}`:`#ZOD_OPENAPI/__shared#/${o}/${e}`}),c=s.schemas.__shared?.[o]??{};s.schemas.__shared??={[o]:c};let l=new Map;for(let[e,r]of Object.entries(c))if(Z9(r),/^schema\d+$/.test(e)){let i=`__schema${t.registry.components.schemas.dynamicSchemaCount++}`;l.set(e,`"${n}${i}"`),i!==e&&(c[i]=r,delete c[e])}for(let[e]of t.registry.components.schemas.manual){let t=s.schemas[e];t&&Z9(t)}let u={},d=JSON.parse(JSON.stringify(s).replace(/"#ZOD_OPENAPI\/__shared#\/(?:\$defs|definitions)\/([^"]+)"/g,(e,r)=>l.get(r)||(t.registry.components.schemas.manual.get(r)&&(u[r]=!0),`"${n}${r}"`))),f=d.schemas.__shared?.[o]??{};d.schemas.__shared??={[o]:f};for(let[e]of t.registry.components.schemas.manual){let t=d.schemas[e];if(t&&u[e]){if(f[e])throw Error(`Component "${e}" is already registered as a component in the registry`);f[e]=t}}let p=wke(f,a,t,n);if(!p.size){let e=d.schemas.zodOpenApiCreateSchema?.properties;return delete d.schemas.zodOpenApiCreateSchema,delete d.schemas.__shared,{schemas:e,components:f,manual:d.schemas}}let g=JSON.parse(JSON.stringify(d).replace(RegExp(`"${n}([^"]+)"`,`g`),(e,t)=>{let r=p.get(t);return r?`"${n}${r}"`:`"${n}${t}"`})),y=g.schemas.zodOpenApiCreateSchema?.properties,b=g.schemas.__shared?.[o]??{};return delete g.schemas.zodOpenApiCreateSchema,delete g.schemas.__shared,{schemas:y,components:b,manual:g.schemas}},kke=e=>{let t={components:{schemas:{dynamicSchemaCount:0,input:new Map,output:new Map,ids:new Map,manual:new Map},headers:{ids:new Map,seen:new WeakMap},requestBodies:{ids:new Map,seen:new WeakMap},responses:{ids:new Map,seen:new WeakMap},parameters:{ids:new Map,seen:new WeakMap},callbacks:{ids:new Map,seen:new WeakMap},pathItems:{ids:new Map,seen:new WeakMap},securitySchemes:{ids:new Map,seen:new WeakMap},links:{ids:new Map,seen:new WeakMap},examples:{ids:new Map,seen:new WeakMap}},addSchema:(e,n,r)=>{let i={};return t.components.schemas[r.io].set(n.join(` > `),{schemaObject:i,zodType:e,source:{path:n,...r?.source}}),i},addParameter:(e,n,r)=>{let i=t.components.parameters.seen.get(e);if(i)return i;let a=_.get(e),o=r?.location?.name??a?.param?.name,s=r?.location?.in??a?.param?.in;if(r?.location?.name&&a?.param?.name||r?.location?.in&&a?.param?.in)throw Error(`Parameter at ${n.join(` > `)} has both \`.meta({ param: { name, in } })\` and \`.meta({ param: { location: { in, name } } })\` information`);if(!o||!s)throw Error(`Parameter at ${n.join(` > `)} is missing \`.meta({ param: { name, in } })\` information`);let c=t.addSchema(e,[...n,s,o,`schema`],{io:`input`,source:{type:`parameter`,location:{in:s,name:o}}}),{id:l,examples:u,...d}=a?.param??{},f={in:s,name:o,schema:c,...d},p=cke(u,t,[...n,s,o,`examples`]);p&&(f.examples=p),dke(e,`input`)&&(f.required=!0),!f.description&&a?.description&&(f.description=a.description);let m=l??r?.manualId;if(m){if(t.components.parameters.ids.has(m))throw Error(`Schema "${m}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/parameters/${m}`};return t.components.parameters.seen.set(e,i),t.components.parameters.ids.set(m,f),r?.manualId?f:i}return r?.location?.name||r?.location?.in||t.components.parameters.seen.set(e,f),f},addHeader:(e,n,r)=>{let i=t.components.headers.seen.get(e);if(i)return i;let a=_.get(e),{id:o,...s}=a?.header??{},c=o??r?.manualId,l=s;if(dke(e,`output`)&&(l.required=!0),!l.description&&a?.description&&(l.description=a.description),l.schema=t.addSchema(e,[...n,`schema`],{io:`output`,source:{type:`header`}}),c){if(t.components.schemas.ids.has(c))throw Error(`Schema "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/headers/${c}`};return t.components.headers.ids.set(c,l),t.components.headers.seen.set(e,i),r?.manualId?l:i}return t.components.headers.seen.set(e,l),l},addRequestBody:(e,n,r)=>{let i=t.components.requestBodies.seen.get(e);if(i)return i;let{content:a,id:o,...s}=e,c={...s,content:uke(a,{registry:t,io:`input`},[...n,`content`])},l=o??r?.manualId;if(l){if(t.components.requestBodies.ids.has(l))throw Error(`RequestBody "${l}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/requestBodies/${l}`};return t.components.requestBodies.ids.set(l,c),t.components.requestBodies.seen.set(e,i),r?.manualId?c:i}return t.components.requestBodies.seen.set(e,c),c},addPathItem:(e,n,r)=>{let i=t.components.pathItems.seen.get(e);if(i)return i;let a={},{id:o,...s}=e,c=o??r?.manualId;for(let[e,r]of Object.entries(s)){if(X9(e)){a[e]=r;continue}if(e===`get`||e===`put`||e===`post`||e===`delete`||e===`options`||e===`head`||e===`patch`||e===`trace`){a[e]=vke(r,t,[...n,e]);continue}if(e===`parameters`){a[e]=mke(r,t,[...n,e]);continue}a[e]=r}if(c){if(t.components.pathItems.ids.has(c))throw Error(`PathItem "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/pathItems/${c}`};return t.components.pathItems.ids.set(c,a),t.components.pathItems.seen.set(e,i),r?.manualId?a:i}return t.components.pathItems.seen.set(e,a),a},addResponse:(e,n,r)=>{let i=t.components.responses.seen.get(e);if(i)return i;let{content:a,headers:o,links:s,id:c,...l}=e,u=l,d=fke(o,t,[...n,`headers`]);d&&(u.headers=d),a&&(u.content=uke(a,{registry:t,io:`output`},[...n,`content`])),s&&(u.links=pke(s,t,[...n,`links`]));let f=c??r?.manualId;if(f){if(t.components.responses.ids.has(f))throw Error(`Response "${f}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/responses/${f}`};return t.components.responses.ids.set(f,u),t.components.responses.seen.set(e,i),r?.manualId?u:i}return t.components.responses.seen.set(e,u),u},addCallback:(e,n,r)=>{let i=t.components.callbacks.seen.get(e);if(i)return i;let{id:a,...o}=e,s={};for(let[e,r]of Object.entries(o)){if(X9(e)){s[e]=r;continue}s[e]=t.addPathItem(r,[...n,e])}let c=a??r?.manualId;if(c){if(t.components.callbacks.ids.has(c))throw Error(`Callback "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/callbacks/${c}`};return t.components.callbacks.ids.set(c,s),t.components.callbacks.seen.set(e,i),r?.manualId?s:i}return t.components.callbacks.seen.set(e,s),s},addSecurityScheme:(e,n,r)=>{let i=t.components.securitySchemes.seen.get(e);if(i)return i;let{id:a,...o}=e,s=o,c=a??r?.manualId;if(c){if(t.components.securitySchemes.ids.has(c))throw Error(`SecurityScheme "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/securitySchemes/${c}`};return t.components.securitySchemes.ids.set(c,s),t.components.securitySchemes.seen.set(e,i),r?.manualId?s:i}return t.components.securitySchemes.seen.set(e,s),s},addLink:(e,n,r)=>{let i=t.components.links.seen.get(e);if(i)return i;let{id:a,...o}=e,s=o,c=a??r?.manualId;if(c){if(t.components.links.ids.has(c))throw Error(`Link "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/links/${c}`};return t.components.links.ids.set(c,s),t.components.links.seen.set(e,i),r?.manualId?s:i}return t.components.links.seen.set(e,s),s},addExample:(e,n,r)=>{let i=t.components.examples.seen.get(e);if(i)return i;let{id:a,...o}=e,s=o,c=a??r?.manualId;if(c){if(t.components.examples.ids.has(c))throw Error(`Example "${c}" at ${n.join(` > `)} is already registered`);let i={$ref:`#/components/examples/${c}`};return t.components.examples.ids.set(c,s),t.components.examples.seen.set(e,i),r?.manualId?s:i}return t.components.examples.seen.set(e,s),s}};return Ake(e?.schemas,t),jke(e?.parameters,t),Mke(e?.headers,t),Nke(e?.responses,t),Ike(e?.pathItems,t),Pke(e?.requestBodies,t),Fke(e?.callbacks,t),Lke(e?.securitySchemes,t),Rke(e?.links,t),zke(e?.examples,t),t},Ake=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){let e=_.get(r)?.id??n;t.components.schemas.manual.set(e,{input:{schemaObject:{}},output:{schemaObject:{}},zodType:r});continue}t.components.schemas.ids.set(n,r)}},jke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){let e=[`components`,`parameters`,n];t.addParameter(r,e,{manualId:n});continue}t.components.parameters.ids.set(n,r)}},Mke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){let e=[`components`,`headers`,n];t.addHeader(r,e,{manualId:n});continue}t.components.headers.ids.set(n,r)}},Nke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){let e=t.addResponse(r,[`components`,`responses`,n],{manualId:n});t.components.responses.ids.set(n,e),t.components.responses.seen.set(r,e)}},Pke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e)){if(J9(r)){t.addRequestBody(r,[`components`,`requestBodies`,n],{manualId:n});continue}t.components.requestBodies.ids.set(n,r)}},Fke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addCallback(r,[`components`,`callbacks`,n],{manualId:n})},Ike=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addPathItem(r,[`components`,`pathItems`,n],{manualId:n})},Lke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addSecurityScheme(r,[`components`,`securitySchemes`,n],{manualId:n})},Rke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.addLink(r,[`components`,`links`,n],{manualId:n})},zke=(e,t)=>{if(e)for(let[n,r]of Object.entries(e))t.components.examples.ids.set(n,r)},Bke=e=>{let{schemas:t,components:n,manual:r}=Oke(Object.fromEntries(e.registry.components.schemas[e.io]),e);for(let[t,r]of Object.entries(n))e.registry.components.schemas.ids.set(t,r);for(let[n,r]of Object.entries(t)){let t=e.registry.components.schemas[e.io].get(n);t&&Object.assign(t.schemaObject,r)}for(let[t,i]of Object.entries(r)){let r=e.registry.components.schemas.manual.get(t);r&&(n[t]&&(r[e.io].used=!0),Object.assign(r[e.io].schemaObject,i))}},Vke=e=>{for(let[t,n]of e.components.schemas.manual)if(!n.input.used){let r=n[_.get(n.zodType)?.unusedIO??`output`].schemaObject;e.components.schemas.ids.set(t,r)}},Hke=(e,t,n)=>{Bke({registry:e,io:`input`,opts:t,openapiVersion:n}),Bke({registry:e,io:`output`,opts:t,openapiVersion:n}),Vke(e);let r={};return e.components.schemas.ids.size>0&&(r.schemas=Object.fromEntries(e.components.schemas.ids)),e.components.headers.ids.size>0&&(r.headers=Object.fromEntries(e.components.headers.ids)),e.components.requestBodies.ids.size>0&&(r.requestBodies=Object.fromEntries(e.components.requestBodies.ids)),e.components.responses.ids.size>0&&(r.responses=Object.fromEntries(e.components.responses.ids)),e.components.parameters.ids.size>0&&(r.parameters=Object.fromEntries(e.components.parameters.ids)),e.components.callbacks.ids.size>0&&(r.callbacks=Object.fromEntries(e.components.callbacks.ids)),e.components.pathItems.ids.size>0&&(r.pathItems=Object.fromEntries(e.components.pathItems.ids)),e.components.securitySchemes.ids.size>0&&(r.securitySchemes=Object.fromEntries(e.components.securitySchemes.ids)),e.components.links.ids.size>0&&(r.links=Object.fromEntries(e.components.links.ids)),e.components.examples.ids.size>0&&(r.examples=Object.fromEntries(e.components.examples.ids)),r},Uke=(e,t={})=>{let{paths:n,webhooks:r,components:i,...a}=e,o=a,s=kke(i),c=yke(n,s,[`paths`]);c&&(o.paths=c);let l=yke(r,s,[`webhooks`]);l&&(o.webhooks=l);let u=Hke(s,t,e.openapi);return Object.keys(u).length>0&&(o.components=u),o},Wke=M(p,`openapi`);function Gke(e){return e.match(/^\/(v\d+)/)?.[1]}function Kke(e){return e.replace(/:(\w+)/g,`{$1}`)}function qke(e,t){let n=Kke(e),r={summary:t.summary,description:t.description};(t.request?.params||t.request?.query||t.request?.headers)&&(r.requestParams={},t.request.params&&(r.requestParams.path=t.request.params),t.request.query&&(r.requestParams.query=t.request.query),t.request.headers&&(r.requestParams.header=t.request.headers)),t.request?.body&&(r.requestBody={content:{"application/json":{schema:t.request.body}}}),r.responses={};for(let[e,n]of Object.entries(t.responses))r.responses[e]={description:n.description,content:{"application/json":{schema:n.content[`application/json`].schema}}};return{path:n,config:r}}function Jke(e,t,n){let r={};for(let n of e){if(n.version!==t)continue;let e=n.path.replace(`/${t}`,``)||`/`;for(let t of n.openAPISpec){let{path:n,config:i}=qke(e,t);r[n]||(r[n]={}),r[n][t.method]=i}}return Uke({openapi:`3.1.0`,info:n?.info||{title:`API ${t.toUpperCase()}`,version:t.replace(`v`,``),description:`OpenAPI specification for ${t} API`},servers:n?.servers||[{url:`http://localhost:8000/${t}`,description:process.env.NODE_ENV===`production`?`Production server`:`Development server`}],paths:r})}async function Yke(e){let t=M(l,s);try{await N(t)}catch(t){return e.logger.error({error:t},`OpenAPI routes directory not found`),[]}let n=await(0,ske.remixRoutesOptionAdapter)(e=>(0,oke.flatRoutes)(s,e,{appDir:l,ignoredRouteFiles:[`**/.*`,`**/*.{spec,test}.{ts,tsx}`,`**/*-????????.{js,ts}`]})),r=[];for(let[t,i]of Object.entries(n)){let t=M(l,i.file).replace(/\.ts$/,`.${o}`);try{let n=(await import(t)).default;if(!n||QOe(n)||/\/openapi.(j|t)s$/.test(t))continue;if(!n?.handlers&&!n?.openAPISpec){e.logger.warn(`Missing default export with 'defineOpenAPI' for '${l}/${i.file}'`);continue}let a=`/${i.path}`;r.push({path:a,filePath:t,handlers:n.handlers,openAPISpec:n.openAPISpec,version:Gke(a)})}catch(t){e.logger.error(t,`Error loading route ${i.file}:`)}}return r}function Xke(e,t){for(let n of t)for(let[t,r]of Object.entries(n.handlers))e[t.toLowerCase()](n.path,r)}async function Zke(e,t){let n=M(l,s,`${t}+/openapi.${o}`);try{let t=(await import(n)).default;return t?t(e):void 0}catch{return}}async function Qke(e,t){let n=[...new Set(t.map(e=>e.version).filter(Boolean))];n.length>0&&await ct(Wke,{recursive:!0});for(let r of n){let n=Jke(t,r,await Zke(e,r));await ut(nt(Wke,`${r}.json`),JSON.stringify(n,null,2),`utf-8`)}}async function $ke(e){let t=await Yke(e.locals.container);Xke(e,t),process.env.NODE_ENV!==`production`&&await Qke(e.locals.container,t)}async function eAe({container:e}){let t=!1,{host:n=`0.0.0.0`,port:r,timeout:i=3e4,bodyLimit:a=`1mb`,healthPath:o=`/health`,cors:s,helmet:c,rateLimit:d,redisUrl:f}=e.server,m=An();m.disable(`x-powered-by`),m.locals.container=e;let h=null;if(f&&d)try{h=(0,FOe.createClient)({url:f}),h.on(`error`,t=>{e.logger.error({error:t.message},`Redis client error`)}),await h.connect(),e.logger.info(`Connected to Redis for rate limiting`)}catch(t){e.logger.error({error:t instanceof Error?t.message:t},`Failed to connect to Redis, falling back to in-memory rate limiting`),h=null}if(m.use(UOe(e.logger,()=>t),WOe(e.logger,i),HOe(e.logger),ROe(o)),c!==void 0&&m.use(AOe(c)),s!==void 0&&m.use((0,BDe.default)(s)),d)for(let[e,t]of d.entries()){let n=sOe({windowMs:t.windowMs??60*1e3,limit:t.limit??100,standardHeaders:t.standardHeaders??`draft-8`,legacyHeaders:t.legacyHeaders??!1,skip:t.skip,keyGenerator:t.keyGenerator,handler:t.handler,message:t.message,statusCode:t.statusCode,requestPropertyName:t.requestPropertyName,skipFailedRequests:t.skipFailedRequests,skipSuccessfulRequests:t.skipSuccessfulRequests,requestWasSuccessful:t.requestWasSuccessful,validate:t.validate,store:h?new POe({sendCommand:(...e)=>h.sendCommand(e),prefix:`rl:${e}:`}):t.store});m.use(n)}if(m.use(zOe(e.i18n),An.json({limit:a}),An.urlencoded({extended:!0,limit:a})),await KOe(nt(process.cwd(),l,u),e,m),m.get(`/`,(t,n)=>{n.json({message:`${e.config.APP_NAME} server is running.`})}).all(`${e.auth.options.basePath}/*`,kDe(e.auth)),await $ke(m),m.use(An.static(M(p))),process.env.NODE_ENV!==`production`){let{defineYouchErrorHandler:t}=await import(`./youch-handler-D7REmh8Z.mjs`);m.use(t(e.logger))}else m.use(LOe(e.logger));return{app:m,host:n,port:r,async start(){await new Promise((e,t)=>{try{m.listen(r,n,()=>{e()})}catch(e){t(e)}})},async close(){if(t=!0,m.uwsApp.close(),h)try{await h.destroy()}catch(t){e.logger.warn({error:t instanceof Error?t.message:t},`Error disconnecting from Redis`)}}}}function tAe(){return{async start(){await it.launch()},async close(){await it.shutdown()}}}const nAe=`(AppOS v${bDe} | Node ${process.version})`;var rAe=ki({description:`Start the HTTP server and/or DBOS workflow worker`,aliases:[`s`],args:y([]),opts:v({service:g([`server`,`worker`]).optional().meta({short:`s`,description:`Start only a specific service (default: both)`})}),async run(e){let{container:t,opts:n}=e,{logger:r}=t,i=!n.service||n.service===`server`,a=!n.service||n.service===`worker`,o=null,s=null,c=!1,l=async t=>{if(!c){c=!0,r.info(`Shutdown initiated (${t})`);try{o&&(await o.close(),r.info(`HTTP server stopped`)),s&&(await s.close(),r.info(`DBOS worker stopped`)),await e.cleanup()}catch(e){r.error({error:e},`Shutdown error`)}process.exit(0)}};process.on(`SIGINT`,()=>l(`SIGINT`)),process.on(`SIGTERM`,()=>l(`SIGTERM`)),a&&(s=tAe(),await s.start(),r.info(`DBOS worker ready ${nAe}`)),i&&(o=await eAe({container:t}),await o.start(),r.info(`HTTP server ready at http://${o.host}:${o.port} ${nAe}`))}}),iAe=ki({description:`Setup the infrastructure`,devOnly:!0,args:y([]),opts:v({}),async run(e){e.intro(`up`);try{await e.spinner(`Starting containers`,()=>e.exec(`docker`,[`compose`,`--profile=infra`,`up`,`--wait`]))}catch(t){e.fail(t instanceof Error?t.message:String(t))}e.step(`Running schema migrations`),await C9({ctx:e,migrationType:`schema`}),e.step(`Seeding databases`),await w9({ctx:e}),await e.cleanup(),e.outro()}});const aAe={build:Pi,"db:data:gen":pDe,"db:data:migrate":mDe,"db:schema:gen":hDe,"db:schema:migrate":gDe,"db:seed":_De,down:vDe,preview:yDe,repl:SDe,reset:CDe,start:rAe,up:iAe};function oAe(e,t=e){let n=[];try{let r=rt.readdirSync(e,{withFileTypes:!0});for(let i of r){let r=$e.join(e,i.name);i.isDirectory()?n.push(...oAe(r,t)):i.isFile()&&i.name.endsWith(`.${o}`)&&!/\.(spec|test)\.[jt]sx?$/.test(i.name)&&n.push(r)}}catch{}return n}function sAe(e,t){return $e.relative(t,e).replace(RegExp(`\\.${o}$`),``).replace(/\//g,`:`)}async function cAe(e,t){let n={},r=[],i=new Map;if(t.opts&&`shape`in t.opts){let e=t.opts.shape;for(let[t,n]of Object.entries(e)){let e=n.meta?.();e?.short&&typeof e.short==`string`&&i.set(e.short,t)}}for(let t=0;t<e.length;t++){let a=e[t];if(a.startsWith(`--`)){let[r,...i]=a.slice(2).split(`=`);if(i.length>0)n[r]=i.join(`=`);else{let i=e[t+1];i&&!i.startsWith(`-`)?(n[r]=i,t++):n[r]=!0}}else if(a.startsWith(`-`)&&a.length>1){let r=a.slice(1);if(r.length>1)for(let e of r){let t=i.get(e);t&&(n[t]=!0)}else{let a=r,o=i.get(a)||a,s=e[t+1];s&&!s.startsWith(`-`)?(n[o]=s,t++):n[o]=!0}}else r.push(a)}let a={};if(t.opts&&`safeParse`in t.opts){let e=t.opts.safeParse(n);if(!e.success){for(let t of e.error.issues){let e=t.path.join(`.`);console.error(F.default.red(`Error:\n --${e} => ${t.message.toLowerCase()}`))}process.exit(1)}a=e.data}let o=[];if(t.args&&`safeParse`in t.args){let e=t.args.safeParse(r);if(!e.success){for(let t of e.error.issues){let e=t.path.join(`.`);console.error(F.default.red(`Error:\n ${e} => ${t.message.toLowerCase()}`))}process.exit(1)}o=e.data}return{args:o,options:a}}function Q9(e,t){console.log(`${F.default.bold(e.config.APP_NAME)} - ${e.config.APP_DESC}\n`),console.log(`Commands:`);let n=0;for(let[e,r]of t){let t=r.aliases&&r.aliases.length>0?` (${r.aliases.join(`, `)})`:``,i=e.length+t.length;n=Math.max(n,i)}n+=8;for(let[e,r]of t){let t=r.aliases&&r.aliases.length>0?` (${r.aliases.join(`, `)})`:``,i=r.aliases&&r.aliases.length>0?F.default.dim(` (${r.aliases.join(`, `)})`):``,a=`${F.default.cyan(e)}${i}`,o=e.length+t.length,s=` `.repeat(Math.max(0,n-o));console.log(` ${a}${s}${r.description||`No description`}`)}}function lAe(e,t){console.log(`${t.description||`No description`}`),console.log();let n=`Usage: ${F.default.cyan(e)}`;if(t.args){let e=t.args._def,r=e?.typeName||e?.type;if(r===`ZodTuple`||r===`tuple`){let t=e.items||[];for(let e of t){let t=e,r=t.meta?.()?.name||t._def?.description||`arg`,i=t.isOptional?.()??!1;n+=i?` [${r}]`:` <${r}>`}if(e.rest){let t=e.rest._def?.description||`args`;n+=` [${t}...]`}}else if(r===`ZodArray`||r===`array`){let r=t.args.meta?.()?.name||`args`,i=e.minLength?.value||0;i===0?n+=` [${r}...]`:i===1?n+=` <${r}>`:n+=` <${r}...>`}}if(t.opts&&(n+=` [options]`),console.log(n),console.log(),t.args){let e=t.args._def,n=e?.typeName||e?.type;if(n===`ZodTuple`||n===`tuple`||n===`ZodArray`||n===`array`){if(console.log(`Arguments:`),n===`ZodTuple`||n===`tuple`){let t=e.items||[];for(let e=0;e<t.length;e++){let n=t[e],r=n.meta?.(),i=r?.name||n._def?.description||`arg${e+1}`,a=r?.description||n._def?.description||i,o=n.isOptional?.()??!1?``:` (required)`;console.log(` ${F.default.cyan(i)}${F.default.dim(o)}\t\t${a}`)}if(e.rest){let t=e.rest._def?.description||`additional args`;console.log(` ${F.default.cyan(`${t}...`)}\t\t${t}`)}}else{let n=t.args.meta?.(),r=n?.name||`args`,i=n?.description||``,a=e.minLength?.value||0,o=r;(a===0||a>1)&&(o=`${r}...`);let s=a>0?` (required)`:``;console.log(` ${F.default.cyan(o)}${F.default.dim(s)}\t\t${i}`)}console.log()}}if(console.log(`Options:`),console.log(` ${F.default.cyan(`-h, --help`)}\t\t\tShow help for this command`),t.opts&&`shape`in t.opts){let e=t.opts.shape;for(let[t,n]of Object.entries(e)){let e=n,r=e.meta?.(),i=e.isOptional?.()??!0,a=e._def?.typeName===`ZodBoolean`,o=r?.short?`-${r.short}, `:` `,s=`--${t}`,c=a?``:` <value>`,l=i?``:` (required)`,u=e._def?.defaultValue,d=u===void 0?``:`(default: ${JSON.stringify(u)})`,f=r?.description||``;console.log(` ${F.default.cyan(o+s+c)}\t\t${f} ${F.default.dim(l+d)}`)}}}async function uAe(e,t,n){let r=oAe(e);for(let i of r)try{let r=(await import(i)).default;if(r&&typeof r==`object`&&`run`in r){let a=sAe(i,e);if(t.set(a,r),r.aliases)for(let e of r.aliases)n.set(e,a)}}catch(e){console.warn(F.default.yellow(`Warning: Could not load command from ${i}: ${e instanceof Error?e.message:String(e)}`))}}async function dAe(e){let t=new Map,n=new Map,r=process.env.NODE_ENV===`production`;for(let[e,i]of Object.entries(aAe))if(!(r&&i.devOnly)&&(t.set(e,i),i.aliases))for(let t of i.aliases)n.set(t,e);return await uAe(e.commandsDir,t,n),await b({container:e.container}),it.setConfig({name:e.container.config.APP_NAME,runAdminServer:!1,systemDatabaseUrl:e.container.worker.dbUrl}),await f({container:e.container,dbos:it}),{async run(r=process.argv.slice(2)){let[i,...a]=r;if(!i||i===`--help`||i===`-h`){Q9(e.container,t);return}let o=n.get(i)||i,s=t.get(o);if(s||(console.error(F.default.red(`Unknown command: ${i}\n`)),Q9(e.container,t),process.exit(1)),a.includes(`--help`)||a.includes(`-h`)){lAe(o,s);return}try{let{args:t,options:n}=await cAe(a,s),r=Oi(t,n,e.container);await s.run(r)}catch(e){e instanceof Error&&(console.error(F.default.red(`Error:`),e.message),(e.message.includes(`argument`)||e.message.includes(`Invalid arguments`))&&(console.log(),console.log(`Run '${F.default.cyan(`${o} --help`)}' to see usage information.`))),process.exit(1)}},showHelp(){Q9(e.container,t)},showCommandHelp(e){lAe(Array.from(t.entries()).find(([t,n])=>n===e)?.[0]||`unknown`,e)}}}const $9=Xe(import.meta.url),{GlobalLogger:fAe}=$9(nt(tt(tt(tt($9.resolve(`@dbos-inc/dbos-sdk`)))),`dist/src/telemetry/logs`));async function pAe(){let{defineContainer:e}=await import(nt(process.cwd(),l,`main.${o}`)),t=await e();fAe.prototype.info=(e,n)=>{if(typeof e==`string`){if(e.startsWith(`Initializing DBOS`)||e.startsWith(`System Database URL:`)||e.startsWith(`Executor ID:`)||e.startsWith(`Application version:`)||e.startsWith(`No workflows to recover from application`)||e.startsWith(`DBOS launched!`))return;t.logger.info(n,e)}else t.logger.info(n,JSON.stringify(e))},await(await dAe({container:t,commandsDir:nt(process.cwd(),l,a)})).run(process.argv.slice(2))}try{await pAe()}catch(e){console.error(e),process.exit(1)}export{};
|