gemi 0.4.124 → 0.4.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/app/App.d.ts +3 -0
  2. package/dist/app/App.d.ts.map +1 -1
  3. package/dist/app/index.js +2 -2
  4. package/dist/app/index.js.map +3 -3
  5. package/dist/auth/AuthenticationServiceProvider.d.ts +2 -0
  6. package/dist/auth/AuthenticationServiceProvider.d.ts.map +1 -1
  7. package/dist/bin/index.js +430 -430
  8. package/dist/broadcasting/index.d.ts +2 -0
  9. package/dist/broadcasting/index.d.ts.map +1 -0
  10. package/dist/broadcasting/index.js +1 -1
  11. package/dist/chunk-1qw2v7pp.js +20 -0
  12. package/dist/{chunk-m1838202.js.map → chunk-1qw2v7pp.js.map} +8 -11
  13. package/dist/chunk-2h3dg6ak.js +4 -0
  14. package/dist/{chunk-5bsvn385.js.map → chunk-2h3dg6ak.js.map} +2 -2
  15. package/dist/chunk-2srb036m.js +4 -0
  16. package/dist/{chunk-6wj5qxwf.js.map → chunk-2srb036m.js.map} +1 -1
  17. package/dist/chunk-3sgwee0d.js +4 -0
  18. package/dist/{chunk-9vb54d71.js.map → chunk-3sgwee0d.js.map} +2 -2
  19. package/dist/chunk-49eas1md.js +4 -0
  20. package/dist/{chunk-93r4rez6.js.map → chunk-49eas1md.js.map} +2 -2
  21. package/dist/chunk-4rgtv394.js +4 -0
  22. package/dist/{chunk-j618jvh4.js.map → chunk-4rgtv394.js.map} +4 -4
  23. package/dist/chunk-5e4ahq43.js +4 -0
  24. package/dist/{chunk-cw23pjra.js.map → chunk-5e4ahq43.js.map} +6 -6
  25. package/dist/chunk-5vx2z0tr.js +4 -0
  26. package/dist/{chunk-t6cspqr4.js.map → chunk-5vx2z0tr.js.map} +2 -2
  27. package/dist/chunk-716jpkxk.js +22 -0
  28. package/dist/chunk-716jpkxk.js.map +10 -0
  29. package/dist/chunk-75wm7ysh.js +11 -0
  30. package/dist/{chunk-hddz9z7a.js.map → chunk-75wm7ysh.js.map} +5 -5
  31. package/dist/chunk-7sn2drtt.js +5 -0
  32. package/dist/chunk-7sn2drtt.js.map +64 -0
  33. package/dist/chunk-7vggss3r.js +4 -0
  34. package/dist/{chunk-kqyj62v4.js.map → chunk-7vggss3r.js.map} +2 -2
  35. package/dist/chunk-99h5xbnm.js +4 -0
  36. package/dist/{chunk-gz4h6jsy.js.map → chunk-99h5xbnm.js.map} +2 -2
  37. package/dist/chunk-a0zzg1ga.js +3 -0
  38. package/dist/chunk-a0zzg1ga.js.map +16 -0
  39. package/dist/chunk-cqn3123n.js +3 -0
  40. package/dist/{chunk-1we4kcb2.js.map → chunk-cqn3123n.js.map} +2 -2
  41. package/dist/chunk-h64zrvbm.js +4 -0
  42. package/dist/chunk-h64zrvbm.js.map +10 -0
  43. package/dist/chunk-hxntatg7.js +4 -0
  44. package/dist/chunk-hxntatg7.js.map +10 -0
  45. package/dist/chunk-jtv3vbyw.js +4 -0
  46. package/dist/{chunk-dq276gmc.js.map → chunk-jtv3vbyw.js.map} +2 -2
  47. package/dist/chunk-mkwkxzth.js +4 -0
  48. package/dist/{chunk-ksckhxbt.js.map → chunk-mkwkxzth.js.map} +5 -5
  49. package/dist/chunk-mr2ew71j.js +4 -0
  50. package/dist/{chunk-m7wq4g1v.js.map → chunk-mr2ew71j.js.map} +6 -6
  51. package/dist/chunk-qcdwj08x.js +8 -0
  52. package/dist/{chunk-9xeqzq5a.js.map → chunk-qcdwj08x.js.map} +2 -2
  53. package/dist/chunk-qf0qr76c.js +4 -0
  54. package/dist/{chunk-8vjfr0mp.js.map → chunk-qf0qr76c.js.map} +2 -2
  55. package/dist/chunk-sdejryyp.js +4 -0
  56. package/dist/{chunk-3ynep2h9.js.map → chunk-sdejryyp.js.map} +1 -1
  57. package/dist/chunk-tmp6k3re.js +4 -0
  58. package/dist/{chunk-2c4nwgcj.js.map → chunk-tmp6k3re.js.map} +2 -2
  59. package/dist/chunk-tq3grsay.js +4 -0
  60. package/dist/chunk-tq3grsay.js.map +14 -0
  61. package/dist/chunk-w1t51rk3.js +4 -0
  62. package/dist/{chunk-34x1c2ey.js.map → chunk-w1t51rk3.js.map} +4 -4
  63. package/dist/chunk-wdx058ey.js +4 -0
  64. package/dist/{chunk-d7hn6b85.js.map → chunk-wdx058ey.js.map} +2 -2
  65. package/dist/chunk-yd2678ws.js +4 -0
  66. package/dist/{chunk-ycz2czq7.js.map → chunk-yd2678ws.js.map} +4 -4
  67. package/dist/client/index.js.map +1 -1
  68. package/dist/client/rpc.d.ts +2 -3
  69. package/dist/client/rpc.d.ts.map +1 -1
  70. package/dist/client/useRoute.d.ts +1 -1
  71. package/dist/email/index.js +2 -2
  72. package/dist/email/index.js.map +2 -2
  73. package/dist/facades/Broadcast.d.ts.map +1 -1
  74. package/dist/facades/index.js +2 -2
  75. package/dist/facades/index.js.map +11 -11
  76. package/dist/http/AuthenticationMiddlware.d.ts +1 -1
  77. package/dist/http/AuthenticationMiddlware.d.ts.map +1 -1
  78. package/dist/http/CacheMiddleware.d.ts +5 -0
  79. package/dist/http/CacheMiddleware.d.ts.map +1 -0
  80. package/dist/http/HttpRequest.d.ts +2 -1
  81. package/dist/http/HttpRequest.d.ts.map +1 -1
  82. package/dist/http/I18nServiceContainer.d.ts +1 -0
  83. package/dist/http/I18nServiceContainer.d.ts.map +1 -1
  84. package/dist/http/Middleware.d.ts +3 -3
  85. package/dist/http/Middleware.d.ts.map +1 -1
  86. package/dist/http/MiddlewareServiceProvider.d.ts +2 -1
  87. package/dist/http/MiddlewareServiceProvider.d.ts.map +1 -1
  88. package/dist/http/RateLimitMiddleware.d.ts +1 -2
  89. package/dist/http/RateLimitMiddleware.d.ts.map +1 -1
  90. package/dist/http/index.d.ts +1 -0
  91. package/dist/http/index.d.ts.map +1 -1
  92. package/dist/http/index.js +2 -2
  93. package/dist/http/index.js.map +9 -8
  94. package/dist/kernel/Kernel.d.ts +3 -1
  95. package/dist/kernel/Kernel.d.ts.map +1 -1
  96. package/dist/kernel/index.js +2 -2
  97. package/dist/kernel/index.js.map +3 -3
  98. package/dist/server/index.js +5 -5
  99. package/dist/server/index.js.map +4 -5
  100. package/dist/services/index.d.ts +2 -0
  101. package/dist/services/index.d.ts.map +1 -1
  102. package/dist/services/index.js +12 -3
  103. package/dist/services/index.js.map +23 -9
  104. package/dist/services/logging/LoggingRouter.d.ts +1 -0
  105. package/dist/services/logging/LoggingRouter.d.ts.map +1 -1
  106. package/dist/services/logging/LoggingServiceContainer.d.ts +1 -1
  107. package/dist/services/logging/LoggingServiceContainer.d.ts.map +1 -1
  108. package/dist/services/middleware/MiddlewareServiceContainer.d.ts +2 -2
  109. package/dist/services/middleware/MiddlewareServiceContainer.d.ts.map +1 -1
  110. package/dist/services/queue/Job.d.ts +11 -0
  111. package/dist/services/queue/Job.d.ts.map +1 -0
  112. package/dist/services/queue/QueueServiceContainer.d.ts +24 -0
  113. package/dist/services/queue/QueueServiceContainer.d.ts.map +1 -0
  114. package/dist/services/queue/QueueServiceProvider.d.ts +8 -0
  115. package/dist/services/queue/QueueServiceProvider.d.ts.map +1 -0
  116. package/dist/services/queue/queueWorker.d.ts +2 -0
  117. package/dist/services/queue/queueWorker.d.ts.map +1 -0
  118. package/dist/services/router/ApiRouterServiceContainer.d.ts +2 -1
  119. package/dist/services/router/ApiRouterServiceContainer.d.ts.map +1 -1
  120. package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -1
  121. package/package.json +1 -2
  122. package/dist/chunk-1we4kcb2.js +0 -3
  123. package/dist/chunk-2c4nwgcj.js +0 -4
  124. package/dist/chunk-34x1c2ey.js +0 -4
  125. package/dist/chunk-39kxd828.js +0 -4
  126. package/dist/chunk-39kxd828.js.map +0 -10
  127. package/dist/chunk-3ynep2h9.js +0 -4
  128. package/dist/chunk-5bsvn385.js +0 -4
  129. package/dist/chunk-6wj5qxwf.js +0 -4
  130. package/dist/chunk-8vjfr0mp.js +0 -4
  131. package/dist/chunk-93r4rez6.js +0 -4
  132. package/dist/chunk-9vb54d71.js +0 -4
  133. package/dist/chunk-9xeqzq5a.js +0 -8
  134. package/dist/chunk-cw23pjra.js +0 -4
  135. package/dist/chunk-d7hn6b85.js +0 -4
  136. package/dist/chunk-dq276gmc.js +0 -4
  137. package/dist/chunk-g290rywa.js +0 -5
  138. package/dist/chunk-g290rywa.js.map +0 -65
  139. package/dist/chunk-g31vhvsw.js +0 -3
  140. package/dist/chunk-g31vhvsw.js.map +0 -15
  141. package/dist/chunk-gz4h6jsy.js +0 -4
  142. package/dist/chunk-hddz9z7a.js +0 -11
  143. package/dist/chunk-j618jvh4.js +0 -4
  144. package/dist/chunk-k4rg25z3.js +0 -4
  145. package/dist/chunk-k4rg25z3.js.map +0 -16
  146. package/dist/chunk-kqyj62v4.js +0 -4
  147. package/dist/chunk-ksckhxbt.js +0 -4
  148. package/dist/chunk-m1838202.js +0 -20
  149. package/dist/chunk-m7wq4g1v.js +0 -4
  150. package/dist/chunk-t6cspqr4.js +0 -4
  151. package/dist/chunk-wrm0pxh2.js +0 -4
  152. package/dist/chunk-wrm0pxh2.js.map +0 -14
  153. package/dist/chunk-ycz2czq7.js +0 -4
@@ -1,9 +1,8 @@
1
- import { type AuthApiRouter, type AuthViewRouter } from "../auth/AuthenticationServiceProvider";
1
+ import { type AuthApiRouter } from "../auth/AuthenticationServiceProvider";
2
2
  import type { CreateRPC } from "../http/ApiRouter";
3
- import type { CreateViewRPC } from "../http/ViewRouter";
4
3
  export interface RPC extends CreateRPC<AuthApiRouter, "/auth"> {
5
4
  }
6
- export interface ViewRPC extends CreateViewRPC<AuthViewRouter, "/auth"> {
5
+ export interface ViewRPC {
7
6
  }
8
7
  export interface I18nDictionary {
9
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../client/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,GAAI,SAAQ,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC;CAAG;AAEjE,MAAM,WAAW,OAAQ,SAAQ,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC;CAAG;AAE1E,MAAM,WAAW,cAAc;CAAG"}
1
+ {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../client/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,GAAI,SAAQ,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC;CAAG;AAEjE,MAAM,WAAW,OAAO;CAAG;AAE3B,MAAM,WAAW,cAAc;CAAG"}
@@ -1,7 +1,7 @@
1
1
  import type { ViewPaths } from "./types";
2
2
  type Pathname = ViewPaths;
3
3
  export declare function useRoute(): {
4
- pathname: ViewPaths;
4
+ pathname: never;
5
5
  startsWith: (pathname: Pathname) => boolean;
6
6
  };
7
7
  export {};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"../chunk-2c4nwgcj.js";import"../chunk-6wj5qxwf.js";import{O as A}from"../chunk-93r4rez6.js";import{render as K}from"jsx-email";import{jsx as L}from"react/jsx-runtime";class B{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;static async send(q){const k=new this,{to:D=k.to,from:F=k.from,subject:w=k.subject,cc:G=k.cc,bcc:H=k.bcc,attachments:I=k.attachments,data:J}=q,x=await k.render(J);if(process.env.EMAIL_DEBUG==="true"){const z=`${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${w}.html`;await Bun.write(z,x),Bun.spawnSync(["open",z]);return}await A.use().service.driver.send({bcc:H,cc:G,from:F,subject:w,to:D,attachments:I,html:x})}async render(q){const k=this.template;return await K(L(k,{...q}))}}export{B as Email};
2
+ import{B}from"../chunk-49eas1md.js";import"../chunk-tmp6k3re.js";import"../chunk-2srb036m.js";import{render as L}from"jsx-email";import{jsx as M}from"react/jsx-runtime";class D{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;static async send(q){let k=new this,{to:F=k.to,from:G=k.from,subject:w=k.subject,cc:H=k.cc,bcc:I=k.bcc,attachments:J=k.attachments,data:K}=q,z=await k.render(K);if(process.env.EMAIL_DEBUG==="true"){let A=`${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${w}.html`;await Bun.write(A,z),Bun.spawnSync(["open",A]);return}await B.use().service.driver.send({bcc:I,cc:H,from:G,subject:w,to:F,attachments:J,html:z})}async render(q){let k=this.template;return await L(M(k,{...q}))}}export{D as Email};
3
3
 
4
- //# debugId=F563A1E0EC0412E764756E2164756E21
4
+ //# debugId=448AC7B58D7BD60264756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "import { ComponentType } from \"react\";\nimport { render } from \"jsx-email\";\nimport { EmailServiceContainer } from \"../services/email/EmailServiceContainer\";\nimport { SendEmailParams } from \"../services/email/drivers/types\";\n\ninterface SendEmailArgs<T> extends Partial<Omit<SendEmailParams, \"html\">> {\n data: T;\n}\n\nexport class Email {\n from = \"\";\n to = [];\n subject = \"No Subject\";\n cc = [];\n bcc = [];\n attachments = [];\n template: ComponentType<any>;\n\n static async send<T extends Email>(\n this: new () => T,\n args: SendEmailArgs<\n T[\"template\"] extends (p: infer P) => JSX.Element ? P : never\n >,\n ) {\n const instance = new this();\n\n const {\n to = instance.to,\n from = instance.from,\n subject = instance.subject,\n cc = instance.cc,\n bcc = instance.bcc,\n attachments = instance.attachments,\n data,\n } = args;\n\n const html = await instance.render(data);\n\n if (process.env.EMAIL_DEBUG === \"true\") {\n const fileName = `${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${subject}.html`;\n await Bun.write(fileName, html);\n Bun.spawnSync([\"open\", fileName]);\n return;\n }\n\n await EmailServiceContainer.use().service.driver.send({\n bcc,\n cc,\n from,\n subject,\n to,\n attachments,\n html,\n });\n }\n\n protected async render<T extends Record<string, any>>(props: T) {\n const Template = this.template;\n return await render(<Template {...props} />);\n }\n}\n"
6
6
  ],
7
- "mappings": ";6GACA,YAAS,qDAQF,MAAM,CAAM,CACjB,KAAO,GACP,GAAK,CAAC,EACN,QAAU,aACV,GAAK,CAAC,EACN,IAAM,CAAC,EACP,YAAc,CAAC,EACf,qBAEa,KAAqB,CAEhC,EAGA,CACA,MAAM,EAAW,IAAI,MAGnB,KAAK,EAAS,GACd,OAAO,EAAS,KAChB,UAAU,EAAS,QACnB,KAAK,EAAS,GACd,MAAM,EAAS,IACf,cAAc,EAAS,YACvB,QACE,EAEE,EAAO,MAAM,EAAS,OAAO,CAAI,EAEvC,GAAI,QAAQ,IAAI,cAAgB,OAAQ,CACtC,MAAM,EAAW,GAAG,QAAQ,IAAI,0BAA0B,IAAI,KAAK,EAAE,YAAY,IAAI,SACrF,MAAM,IAAI,MAAM,EAAU,CAAI,EAC9B,IAAI,UAAU,CAAC,OAAQ,CAAQ,CAAC,EAChC,OAGF,MAAM,EAAsB,IAAI,EAAE,QAAQ,OAAO,KAAK,CACpD,MACA,KACA,OACA,UACA,KACA,cACA,MACF,CAAC,OAGa,OAAqC,CAAC,EAAU,CAC9D,MAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,CAAE,EAE/C",
8
- "debugId": "F563A1E0EC0412E764756E2164756E21",
7
+ "mappings": ";wGACA,YAAS,qDAQF,MAAM,CAAM,CACjB,KAAO,GACP,GAAK,CAAC,EACN,QAAU,aACV,GAAK,CAAC,EACN,IAAM,CAAC,EACP,YAAc,CAAC,EACf,qBAEa,KAAqB,CAEhC,EAGA,CACA,IAAM,EAAW,IAAI,MAGnB,KAAK,EAAS,GACd,OAAO,EAAS,KAChB,UAAU,EAAS,QACnB,KAAK,EAAS,GACd,MAAM,EAAS,IACf,cAAc,EAAS,YACvB,QACE,EAEE,EAAO,MAAM,EAAS,OAAO,CAAI,EAEvC,GAAI,QAAQ,IAAI,cAAgB,OAAQ,CACtC,IAAM,EAAW,GAAG,QAAQ,IAAI,0BAA0B,IAAI,KAAK,EAAE,YAAY,IAAI,SACrF,MAAM,IAAI,MAAM,EAAU,CAAI,EAC9B,IAAI,UAAU,CAAC,OAAQ,CAAQ,CAAC,EAChC,OAGF,MAAM,EAAsB,IAAI,EAAE,QAAQ,OAAO,KAAK,CACpD,MACA,KACA,OACA,UACA,KACA,cACA,MACF,CAAC,OAGa,OAAqC,CAAC,EAAU,CAC9D,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,CAAE,EAE/C",
8
+ "debugId": "448AC7B58D7BD60264756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Broadcast.d.ts","sourceRoot":"","sources":["../../facades/Broadcast.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG;wBAS3B,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,iBAAiB,aACtD,OAAO;;CAWxB"}
1
+ {"version":3,"file":"Broadcast.d.ts","sourceRoot":"","sources":["../../facades/Broadcast.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG;wBAY3B,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,iBAAiB,aACtD,OAAO;;CAWxB"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{a as _m,b as Qm,c as zi,d as Hm,e as xo,f as Io,g as pi,h as H,i as e,k as Gm,l as Ra,m as oa}from"../http/index.js";import{I as hs}from"../chunk-2c4nwgcj.js";import{J as Bm}from"../chunk-3ynep2h9.js";import{K as ip}from"../chunk-6wj5qxwf.js";import{N as ap}from"../chunk-dq276gmc.js";import{AsyncLocalStorage as sp}from"async_hooks";class Ii extends hs{s;static _name="BroadcastingServiceContainer";publishCb;context=new sp;constructor(s){super();this.service=s}onPublish(s){this.publishCb=s}publish(...s){const[i,a,t]=s;this.publishCb(i,a,t)}async handleMessage(s,i){const a=JSON.parse(i);if(a.type==="subscribe"){const t=Object.entries(this.service.channels).sort(([r],[l])=>r.length-l.length);for(let[r,l]of t){const o=new URLPattern({pathname:r});if(o.test({pathname:a.topic})){const c=o.exec({pathname:a.topic})?.pathname.groups,d=new l;if(await d.subscribe.call(d,c))s.subscribe(a.topic);break}}}if(a.type==="broadcast")s.publish(a.topic,JSON.stringify({topic:a.topic,data:a.payload}));if(a.type==="unsubscribe")s.unsubscribe(a.topic)}run(s,i){const a=s.get("Cookie"),t=new Map;if(a){const r=a.split(";");for(let l of r){const[o,c]=l.split("=");t.set(o.trim(),c.trim())}}this.context.run({headers:s,cookies:t},i)}}class As{static async user(){const s=H.getStore(),i=Ii.use().context.getStore();let a="",t="";if(s?.req)a=s.req.cookies.get("access_token"),t=s.req.headers.get("User-Agent");if(i?.cookies)t=i.headers.get("User-Agent"),a=i.cookies.get("access_token");let r=s?.user;if(!r)r=(await oa.use().getSession(a,t))?.user,s?.setUser(r);if(r)return r;return null}static async guard(s){const i=await As.user();if(!i)throw new Ra;try{if(!await s(i))throw new Ra}catch(a){throw new Ra}}static async guardSafe(s){const i=await As.user();if(!i)return!1;try{return await s(i)}catch(a){return!1}}}function ns(s,i){return s.replace(/:([^/]+)/g,(a,t)=>{const r=t.endsWith("?"),l=r?t.slice(0,-1):t,o=i[l];if(o===void 0){if(r)return"";throw new Error(`Missing parameter: ${l}`)}return String(o)}).replace(/\/\//g,"/")}class zo extends Io{constructor(s){super("Redirect error");this.name="RedirectError",this.payload={api:{status:200,data:{},directive:{kind:"Redirect",path:s}},view:{status:302,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:s}}}}}class Co{static to(s,...i){const[a={}]=i;throw new zo(ns(s,a))}}class et extends zi{routes={"/translations":this.get(async()=>{const s=new e,{scope:i,locale:a}=s.search.toJSON(),t=a??gi.use().detectLocale(s),r=gi.use().getPageTranslations(t,i);return s.ctx.setHeaders("Cache-Control",s.ctx.user?"private, max-age=1200, must-revalidate":"public, max-age=864000, must-revalidate"),s.ctx.setCookie("i18n-locale",t,{expires:new Date(Date.now()+31536000000)}),{[t]:r}})}}class gi extends hs{s;static _name="I18nServiceContainer";isEnabled=!1;translations=new Map;supportedLocales=[];constructor(s){super();this.service=s;const i=new Map;for(let[t,r]of Object.entries(this.service.dictionary))for(let[l,o]of Object.entries(r))for(let[c,d]of Object.entries(o)){const f=c==="default"?this.service.defaultLocale:c;if(!i.has(`${f}.${t}`))i.set(`${f}.${t}`,new Map);i.get(`${f}.${t}`)?.set(l,d),this.isEnabled=!0}const a=new Set(s.supportedLocales);for(let[t,r]of i.entries()){this.translations.set(t,Object.fromEntries(r.entries()));const[l]=t.split(".");if(!a.has(l))a.add(l)}this.supportedLocales=Array.from(a)}detectLocale(s){const i=this.service.detectLocale(s);if(this.supportedLocales.includes(i))return i;const t=s.cookies.get("i18n-locale")??(s.headers.get("accept-language")||"en-US"),[r]=t.split(","),l=r.length===2?`${r}-${r.toUpperCase()}`:r;if(this.supportedLocales.includes(l))return l;const o=this.service.defaultLocale??this.supportedLocales[0];if(o)return o;return"en-US"}getPageTranslations(s,i){if(!i)return{};const a=this.translations.get(`${s}.view:${i}`)??{},t={[`view:${i}`]:a};for(let[r]of this.translations.entries()){const l=r.split(".")[1];if(!l.startsWith("layout:"))continue;const o=l.split(":")[1];if(i?.startsWith(o))t[l]=this.translations.get(`${s}.${l}`)??{}}return t}}function No(s,i){return s.replace(/{{([^}]+)}}/g,(a,t)=>{const r=i[t];if(r===void 0)throw new Error(`Missing parameter: ${t}`);return r})}class Wo{static scope(s){return s}static translate(s,...i){const a=gi.use(),t=a.detectLocale(H.getStore().req),r=a.translations.get(`${t}.server`)?.[s];if(!r)return s;return No(r,i[0])}}var Ro=ip(ap(),1);import{Buffer as tp}from"buffer";class ca extends hs{s;static _name="FileStorageServiceContainer";constructor(s){super();this.service=s}}class Eo{static async put(s){return ca.use().service.driver.put(s)}static async metadata(s){const i=tp.from(await s.arrayBuffer());try{return await Ro.default(i).metadata()}catch{return{}}}static async fetch(s){return ca.use().service.driver.fetch(s)}static list(s){return ca.use().service.driver.list(s)}static delete(){}}function Jo(s){return Object.fromEntries(Object.entries(s).filter(([,i])=>{return i!==null&&i!==void 0}))}function Ns(s,i,a,t,r){function l(...d){if(!(this instanceof l))throw new TypeError(Nl);vm(this,i(...d))}function o(d,f){return Object.defineProperties(function(...m){return d.call(this,c(this),...m)},ur(f))}function c(d){const f=q(d);if(!f||f.branding!==s)throw new TypeError(Nl);return f}return Object.defineProperties(l.prototype,{...ac(Ss(o,a)),...wi(Ss(o,t)),...ea("Temporal."+s)}),Object.defineProperties(l,{...wi(r),...ur(s)}),[l,(d)=>{const f=Object.create(l.prototype);return vm(f,d),f},c]}function jm(s){return s=s.concat("id").sort(),(i)=>{if(!tc(i,s))throw new TypeError(Yf);return i}}function ta(s){if(q(s)||s.calendar!==void 0||s.timeZone!==void 0)throw new TypeError(_f);return s}function Bt(s,i){const a={};for(let t in s)a[t]=({o:r},l)=>{const o=q(l)||{},{branding:c}=o,d=c===ji||i.includes(c)?o:cs(l);return r[t](d)};return a}function ho(s){const i={};for(let a in s)i[a]=(t)=>{const{calendar:r}=t;return(l=r,typeof l=="string"?qi(l):(o=l,Object.assign(Object.create(hg),{i:o})))[a](t);var l,o};return i}function mi(){throw new TypeError(Bf)}function Ia({calendar:s}){return typeof s=="string"?new So(s):s}function Om(s,i){if(i=W(i),G(s)){const t=q(s);if(t&&t.branding===ki)return F(i),t;const r=xm(s);return Ml(Vt(r||O),!r,s,i)}const a=ud(qi,s);return F(i),a}function Zm(s,i,a){return t=i.call(s,os(Y(a))),Xr(ba(t));var t}function Gt(s,i=Cm){const a=Object.keys(i).sort(),t={};for(let r of a)t[r]=y(i[r],s,om(s[r]));return t}function M(s,i){return typeof s=="string"?_t(s):Gt(s,i)}function U(s){return M(s,go)}function zs(s){if(G(s)){const i=q(s);if(i)switch(i.branding){case Jt:return i;case Ys:return Y(i.epochNanoseconds)}}return cd(s)}function Fm(s,i,a){const t=i.l(zs(a).epochNanoseconds,s);return t?os(Y(t)):null}function j(s){return G(s)?(q(s)||{}).timeZone||yg(s):((i)=>vt(Pd(I(i))))(s)}function oi(s,i){if(G(s)){const a=q(s)||{};switch(a.branding){case Et:return F(i),a;case Zi:return F(i),Ls(a);case Ys:return F(i),$l(U,a)}return Qd(s,i)}return F(i),gd(s)}function To(s){return s===void 0?void 0:oi(s)}function sa(s,i){if(i=W(i),G(s)){const t=q(s);return t&&t.branding===Vi?(F(i),t):vl(At(za(s)),s,i)}const a=pd(qi,s);return F(i),a}function ci(s,i){if(i=W(i),G(s)){const t=q(s)||{};switch(t.branding){case Zi:return F(i),t;case ji:return F(i),R({...t,...Fs});case Ys:return F(i),nl(U,t)}return Ad(Qt(za(s)),s,i)}const a=md(s);return F(i),a}function cs(s,i){if(i=W(i),G(s)){const t=q(s)||{};switch(t.branding){case ji:return F(i),t;case Zi:return F(i),E(t);case Ys:return F(i),xl(U,t)}return Sl(Qt(za(s)),s,i)}const a=Ft(s);return F(i),a}function nm(s,i,a){return vs(i.call(s,C(E(a,s))))}function Ws(s){return(i)=>typeof i=="string"?qi(i):((a,t)=>{const r=Object.keys(t).sort(),l={};for(let o of r)l[o]=y(t[o],a,a[o]);return l})(i,s)}function z(s){if(G(s)){const i=q(s);return i&&i.branding===Ut?i:Vd(s)}return hd(s)}function $a(s){if(s!==void 0){if(G(s)){const i=q(s)||{};switch(i.branding){case Ys:case ji:return i;case Zi:return E(i)}const a=za(s);return{...Xd(j,M,Qt(a),s),calendar:a}}return dd(s)}}function za(s){return xm(s)||O}function xm(s){const{calendar:i}=s;if(i!==void 0)return k(i)}function k(s){return G(s)?(q(s)||{}).calendar||Ng(s):((i)=>Oa(Td(I(i))))(s)}function ia(s,i){if(i=W(i),G(s)){const a=q(s);if(a&&a.branding===Ys)return Da(i),a;const t=za(s);return Kd(j,M,Qt(t),t,s,i)}return fd(s,i)}function Sm(s){return Ss((i)=>(a)=>i(uo(a)),s)}function uo(s){return rs(s,U)}function eu(){const s=li.prototype,i=Object.getOwnPropertyDescriptors(s),a=Object.getOwnPropertyDescriptors(li),t=function(r,l={}){if(!(this instanceof t))return new t(r,l);vo.set(this,((o,c={})=>{const d=new li(o,c),f=d.resolvedOptions(),m=f.locale,p=gs(Object.keys(c),f),u=ps(ag),g=(...h)=>{let T;const P=h.map((b,w)=>{const D=q(b),N=(D||{}).branding;if(w&&T&&T!==N)throw new TypeError(Af);return T=N,D});return T?u(T)(m,p,...P):[d,...h]};return g.u=d,g})(r,l))};for(let r in i){const l=i[r],o=r.startsWith("format")&&sg(r);typeof l.value=="function"?l.value=r==="constructor"?t:o||ig(r):o&&(l.get=function(){return o.bind(this)})}return a.prototype.value=Object.create(s,i),Object.defineProperties(t,a),t}function sg(s){return function(...i){const a=vo.get(this),[t,...r]=a(...i);return t[s](...r)}}function ig(s){return function(...i){return vo.get(this).u[s](...i)}}function ag(s){const i=tg[s];if(!i)throw new TypeError(Kf(s));return Hs(i,ps(Il))}function ds(s,i,a,t,r){return Ds(i,ic(s,i),a,t,r)}function Ds(s,i,a,t,r,l){const o=rr(i,a,t);if(r&&i!==o)throw new RangeError(Jf(s,i,a,t,l));return o}function ic(s,i){const a=s[i];if(a===void 0)throw new TypeError(zl(i));return a}function G(s){return s!==null&&/object|function/.test(typeof s)}function ps(s,i=Map){const a=new i;return(t,...r)=>{if(a.has(t))return a.get(t);const l=s(t,...r);return a.set(t,l),l}}function ur(s){return wi({name:s},1)}function wi(s,i){return Ss((a)=>({value:a,configurable:1,writable:!i}),s)}function ac(s){return Ss((i)=>({get:i,configurable:1}),s)}function ea(s){return{[Symbol.toStringTag]:{value:s,configurable:1}}}function Ui(s,i){const a={};let t=s.length;for(let r of i)a[s[--t]]=r;return a}function Ss(s,i,a){const t={};for(let r in i)t[r]=s(i[r],r,a);return t}function Pa(s,i,a){const t={};for(let r=0;r<i.length;r++){const l=i[r];t[l]=s(l,r,a)}return t}function rp(s,i,a){const t={};for(let r=0;r<s.length;r++)t[i[r]]=a[s[r]];return t}function gs(s,i){const a={};for(let t of s)a[t]=i[t];return a}function gr(s,i){const a={};for(let t in i)s.has(t)||(a[t]=i[t]);return a}function hr(s){s={...s};const i=Object.keys(s);for(let a of i)s[a]===void 0&&delete s[a];return s}function tc(s,i){for(let a of i)if(!(a in s))return 0;return 1}function rc(s,i,a){for(let t of s)if(i[t]!==a[t])return 0;return 1}function lc(s,i,a){const t={...a};for(let r=0;r<i;r++)t[s[r]]=0;return t}function y(s,...i){return(...a)=>s(...i,...a)}function Uo(s){return s[0].toUpperCase()+s.substring(1)}function wa(s){return s.slice().sort()}function Ga(s,i){return String(i).padStart(s,"0")}function Qs(s,i){return Math.sign(s-i)}function rr(s,i,a){return Math.min(Math.max(s,i),a)}function Es(s,i){return[Math.floor(s/i),fa(s,i)]}function fa(s,i){return(s%i+i)%i}function qs(s,i){return[st(s,i),Tr(s,i)]}function st(s,i){return Math.trunc(s/i)||0}function Tr(s,i){return s%i||0}function Ea(s){return Math.abs(s%1)===0.5}function oc(s,i,a){let t=0,r=0;for(let c=0;c<=i;c++){const d=s[a[c]],f=$s[c],m=v/f,[p,u]=qs(d,m);t+=u*f,r+=p}const[l,o]=qs(t,v);return[r+l,o]}function it(s,i,a){const t={};for(let r=i;r>=0;r--){const l=$s[r];t[a[r]]=st(s,l),s=Tr(s,l)}return t}function cc(s){return s===O?Nt:[]}function dc(s){return s===O?ja:[]}function fc(s){return s===O?["year","day"]:[]}function mc(s){if(s!==void 0)return I(s)}function pc(s){if(s!==void 0)return vs(s)}function Pr(s){if(s!==void 0)return ba(s)}function vs(s){return hc(ba(s))}function ba(s){return gc(Qp(s))}function wr(s){if(s==null)throw new TypeError("Cannot be null or undefined");return s}function uc(s,i){if(i==null)throw new RangeError(zl(s));return i}function Us(s){if(!G(s))throw new TypeError(Ef);return s}function at(s,i,a=s){if(typeof i!==s)throw new TypeError(va(a,i));return i}function gc(s,i="number"){if(!Number.isInteger(s))throw new RangeError(yp(i,s));return s||0}function hc(s,i="number"){if(s<=0)throw new RangeError(Op(i,s));return s}function br(s){if(typeof s=="symbol")throw new TypeError(Mp);return String(s)}function Ya(s,i){return G(s)?String(s):I(s,i)}function tt(s){if(typeof s=="string")return BigInt(s);if(typeof s!="bigint")throw new TypeError(vp(s));return s}function Tc(s,i="number"){if(typeof s=="bigint")throw new TypeError(Sp(i));if(s=Number(s),!Number.isFinite(s))throw new RangeError(Fp(i,s));return s}function ss(s,i){return Math.trunc(Tc(s,i))||0}function Pc(s,i){return gc(Tc(s,i),i)}function _o(s,i){return hc(ss(s,i),i)}function Dr(s,i){let[a,t]=qs(i,v),r=s+a;const l=Math.sign(r);return l&&l===-Math.sign(t)&&(r-=l,t+=l*v),[r,t]}function Ni(s,i,a=1){return Dr(s[0]+i[0]*a,s[1]+i[1]*a)}function Wi(s,i){return Dr(s[0],s[1]+i)}function Ts(s,i){return Ni(i,s,-1)}function as(s,i){return Qs(s[0],i[0])||Qs(s[1],i[1])}function wc(s,i,a){return as(s,i)===-1||as(s,a)===1}function rt(s,i=1){const a=BigInt(v/i);return[Number(s/a),Number(s%a)*i]}function Ri(s,i=1){const a=v/i,[t,r]=qs(s,a);return[t,r*i]}function bc(s,i=1){const[a,t]=s,r=Math.floor(t/i),l=v/i;return BigInt(a)*BigInt(l)+BigInt(r)}function Ps(s,i=1,a){const[t,r]=s,[l,o]=qs(r,i);return t*(v/i)+(l+(a?o/i:0))}function yr(s,i,a=Es){const[t,r]=s,[l,o]=a(r,i);return[t*(v/i)+l,o]}function Or(s,i){const a=s.formatToParts(i),t={};for(let r of a)t[r.type]=r.value;return t}function Fr(s){return ds(s,"isoYear",Ta,ha,1),s.isoYear===Ta?ds(s,"isoMonth",4,12,1):s.isoYear===ha&&ds(s,"isoMonth",1,9,1),s}function Vs(s){return _s({...s,...Fs,isoHour:12}),s}function _s(s){const i=ds(s,"isoYear",Ta,ha,1),a=i===Ta?1:i===ha?-1:0;return a&&ws(is({...s,isoDay:s.isoDay+a,isoNanosecond:s.isoNanosecond-a})),s}function ws(s){if(!s||wc(s,au,iu))throw new RangeError($t);return s}function es(s){return oc(s,5,Zs)[1]}function lt(s){const[i,a]=Es(s,v);return[it(a,5,Zs),i]}function Dc(s){return yc(s)[0]}function yc(s){return yr(s,Os)}function ts(s){return _i(s.isoYear,s.isoMonth,s.isoDay,s.isoHour,s.isoMinute,s.isoSecond,s.isoMillisecond)}function is(s){const i=ts(s);if(i!==void 0){const[a,t]=qs(i,ms);return[a,t*Is+(s.isoMicrosecond||0)*Li+(s.isoNanosecond||0)]}}function Sr(s,i){const[a,t]=lt(es(s)-i);return ws(is({...s,isoDay:s.isoDay+t,...a}))}function Xa(...s){return _i(...s)/Vf}function _i(...s){const[i,a]=Oc(...s),t=i.valueOf();if(!isNaN(t))return t-a*ms}function Oc(s,i=1,a=1,t=0,r=0,l=0,o=0){const c=s===Ta?1:s===ha?-1:0,d=new Date;return d.setUTCHours(t,r,l,o),d.setUTCFullYear(s,i-1,a+c),[d,c]}function ii(s,i){let[a,t]=Wi(s,i);t<0&&(t+=v,a-=1);const[r,l]=Es(t,Is),[o,c]=Es(l,Li);return ot(a*ms+r,o,c)}function ot(s,i=0,a=0){const t=Math.ceil(Math.max(0,Math.abs(s)-su)/ms)*Math.sign(s),r=new Date(s-t*ms);return Ui(Rt,[r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate()+t,r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds(),i,a])}function Fc(s){return[s.isoYear,s.isoMonth,s.isoDay]}function Sc(){return Rs}function vr(s,i){switch(i){case 2:return Mr(s)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function vc(s){return Mr(s)?366:365}function Mr(s){return s%4==0&&(s%100!=0||s%400==0)}function Mc(s){const[i,a]=Oc(s.isoYear,s.isoMonth,s.isoDay);return fa(i.getUTCDay()-a,7)||7}function Lc({isoYear:s}){return s<1?["bce",1-s]:["ce",s]}function lp(s){const i=ts(s);if(i<ru)return Lc(s);const a=Or(kl(Ei),i),{era:t,eraYear:r}=Rd(a,Ei);return[t,r]}function ct(s){return bi(s),dt(s,1),s}function bi(s){return jc(s,1),s}function Ho(s){return rc(Bl,s,jc(s))}function jc(s,i){const{isoYear:a}=s,t=ds(s,"isoMonth",1,Sc(),i);return{isoYear:a,isoMonth:t,isoDay:ds(s,"isoDay",1,vr(a,t),i)}}function dt(s,i){return Ui(Zs,[ds(s,"isoHour",0,23,i),ds(s,"isoMinute",0,59,i),ds(s,"isoSecond",0,59,i),ds(s,"isoMillisecond",0,999,i),ds(s,"isoMicrosecond",0,999,i),ds(s,"isoNanosecond",0,999,i)])}function F(s){return s===void 0?0:gm(Us(s))}function Da(s,i=0){s=Ms(s);const a=hm(s),t=hu(s,i);return[gm(s),t,a]}function Lr(s){return hm(Ms(s))}function Zc(s){return s=Ms(s),Xl(s,9,6,1)}function Hi(s,i,a,t=9,r=0,l=4){i=Ms(i);let o=Xl(i,t,r),c=nr(i),d=na(i,l);const f=Za(i,t,r,1);return o==null?o=Math.max(a,f):Ic(o,f),c=xr(c,f,1),s&&(d=((m)=>m<4?(m+2)%4:m)(d)),[o,f,c,d]}function ft(s,i=6,a){let t=nr(s=$r(s,qa));const r=na(s,7);let l=Za(s,i);return l=uc(qa,l),t=xr(t,l,void 0,a),[l,t,r]}function jr(s){return Kl(Ms(s))}function nc(s,i){return Zr(Ms(s),i)}function Zr(s,i=4){const a=$c(s);return[na(s,4),...xc(Za(s,i),a)]}function xc(s,i){return s!=null?[$s[s],s<4?9-3*s:-1]:[i===void 0?1:10**(9-i),i]}function nr(s){const i=s[ma];return i===void 0?1:ss(i,ma)}function xr(s,i,a,t){const r=t?v:$s[i+1];if(r){const l=$s[i];if(r%((s=Ds(ma,s,1,r/l-(t?0:1),1))*l))throw new RangeError(va(ma,s))}else s=Ds(ma,s,1,a?1e9:1,1);return s}function $c(s){let i=s[tr];if(i!==void 0){if(typeof i!="number"){if(br(i)==="auto")return;throw new RangeError(va(tr,i))}i=Ds(tr,Math.floor(i),0,9,1)}return i}function Ms(s){return s===void 0?{}:Us(s)}function $r(s,i){return typeof s=="string"?{[i]:s}:Us(s)}function W(s){if(s!==void 0){if(G(s))return Object.assign(Object.create(null),s);throw new TypeError(Ef)}}function mt(s,i){return s&&Object.assign(Object.create(null),s,{overflow:ou[i]})}function Ir(s,i,a=9,t=0,r){let l=i[s];if(l===void 0)return r?t:void 0;if(l=br(l),l==="auto")return r?t:null;let o=dr[l];if(o===void 0&&(o=qp[l]),o===void 0)throw new RangeError(Hf(s,l,dr));return Ds(s,o,t,a,1,La),o}function Di(s,i,a,t=0){const r=a[s];if(r===void 0)return t;const l=br(r),o=i[l];if(o===void 0)throw new RangeError(Hf(s,l,i));return o}function Ic(s,i){if(i>s)throw new RangeError(Gp)}function Y(s){return{branding:Jt,epochNanoseconds:s}}function Q(s,i,a){return{branding:Ys,calendar:a,timeZone:i,epochNanoseconds:s}}function R(s,i=s.calendar){return{branding:Zi,calendar:i,...gs(fm,s)}}function E(s,i=s.calendar){return{branding:ji,calendar:i,...gs(Gl,s)}}function Ti(s,i=s.calendar){return{branding:Vi,calendar:i,...gs(Gl,s)}}function Ka(s,i=s.calendar){return{branding:ki,calendar:i,...gs(Gl,s)}}function Ls(s){return{branding:Et,...gs(dm,s)}}function n(s){return{branding:Ut,sign:ai(s),...gs(Ul,s)}}function zc(s){return Dc(s.epochNanoseconds)}function pt(s){return yr(s.epochNanoseconds,Is)[0]}function Cc(s){return bc(s.epochNanoseconds,Li)}function Nc(s){return bc(s.epochNanoseconds)}function Wc(s){return s.epochNanoseconds}function K(s){return typeof s=="string"?s:I(s.id)}function Bi(s,i){return s===i||K(s)===K(i)}function Rc(s,i,a,t,r){const l=Pi(t),[o,c]=((P,b)=>{const w=b((P=$r(P,pr))[pm]);let D=gu(P);return D=uc(pr,D),[D,w]})(r,s);if(ua(Math.max(o,l),c))return Bo(t,o);if(!c)throw new RangeError(It);const[d,f,m]=wt(i,a,c),p=al(m),u=bt(m),g=tl(m),h=u(f,d,t),T=g(f,d,h,o);return ua(o,c)?Bo(T,o):((P,b,w,D,N,x,Z)=>{const $=ai(P),[X,_]=zr(D,Hl(w,P),w,$,N,x,Z),ra=Cr(b,X,_);return P[S[w]]+ra*$})(T,p(h),o,f,d,p,u)}function Bo(s,i){return Ps(B(s),$s[i],1)}function zr(s,i,a,t,r,l,o){const c=S[a],d={...i,[c]:i[c]+t},f=o(s,r,i),m=o(s,r,d);return[l(f),l(m)]}function Cr(s,i,a){const t=Ps(Ts(i,a));if(!t)throw new RangeError(Ma);return Ps(Ts(i,s))/t}function Ec(s,i){const[a,t,r]=ft(i,5,1);return Y(gt(s.epochNanoseconds,a,t,r,1))}function Jc(s,i,a){let{epochNanoseconds:t,timeZone:r,calendar:l}=i;const[o,c,d]=ft(a);if(o===0&&c===1)return i;const f=s(r);if(o===6)t=((m,p,u,g)=>{const h=rs(u,p),[T,P]=m(h),b=u.epochNanoseconds,w=us(p,T),D=us(p,P);if(wc(b,w,D))throw new RangeError(Ma);return Ac(Cr(b,w,D),g)?D:w})(Xc,f,i,d);else{const m=f.getOffsetNanosecondsFor(t);t=Oi(f,Gc(ii(t,m),o,c,d),m,2,0,1)}return Q(t,r,l)}function Uc(s,i){return R(Gc(s,...ft(i)),s.calendar)}function _c(s,i){const[a,t,r]=ft(i,5);var l;return Ls((l=r,Nr(s,ya(a,t),l)[0]))}function Hc(s,i){const a=s(i.timeZone),t=rs(i,a),[r,l]=Xc(t),o=Ps(Ts(us(a,r),us(a,l)),Ct,1);if(o<=0)throw new RangeError(Ma);return o}function Bc(s,i){const{timeZone:a,calendar:t}=i,r=((l,o,c)=>us(o,l(rs(c,o))))(Kc,s(a),i);return Q(r,a,t)}function Gc(s,i,a,t){return Yc(s,ya(i,a),t)}function Yc(s,i,a){const[t,r]=Nr(s,i,a);return _s({...Fi(s,r),...t})}function Nr(s,i,a){return lt(si(es(s),i,a))}function Aa(s){return si(s,zt,7)}function ya(s,i){return $s[s]*i}function Xc(s){const i=Kc(s);return[i,Fi(i,1)]}function Kc(s){return ep(6,s)}function op(s,i,a){const t=Math.min(Pi(s),6);return Yi(ht(B(s,t),i,a),t)}function ut(s,i,a,t,r,l,o,c,d,f){if(t===0&&r===1)return s;const m=ua(t,c)?Dt(c)&&t<6&&a>=6?dp:cp:fp;let[p,u,g]=m(s,i,a,t,r,l,o,c,d,f);return g&&t!==7&&(p=((h,T,P,b,w,D,N,x)=>{const Z=ai(h);for(let $=b+1;$<=P;$++){if($===7&&P!==7)continue;const X=Hl($,h);X[S[$]]+=Z;const _=Ps(Ts(N(x(w,D,X)),T));if(_&&Math.sign(_)!==Z)break;h=X}return h})(p,u,a,Math.max(6,t),o,c,d,f)),p}function gt(s,i,a,t,r){if(i===6){const l=((o)=>o[0]+o[1]/v)(s);return[si(l,a,t),0]}return ht(s,ya(i,a),t,r)}function ht(s,i,a,t){let[r,l]=s;t&&l<0&&(l+=v,r-=1);const[o,c]=Es(si(l,i,a),v);return Dr(r+o,c)}function si(s,i,a){return Ac(s/i,a)*i}function Ac(s,i){return wu[i](s)}function cp(s,i,a,t,r,l){const o=ai(s),c=B(s),d=gt(c,t,r,l),f=Ts(c,d),m=Math.sign(d[0]-c[0])===o,p=Yi(d,Math.min(a,6));return[{...s,...p},Ni(i,f),m]}function dp(s,i,a,t,r,l,o,c,d,f){const m=ai(s),p=Ps(B(s,5)),u=ya(t,r);let g=si(p,u,l);const[h,T]=zr(o,{...s,..._l},6,m,c,d,f),P=g-Ps(Ts(h,T));let b=0;P&&Math.sign(P)!==m?i=Wi(h,g):(b+=m,g=si(P,u,l),i=Wi(T,g));const w=Ot(g);return[{...s,...w,days:s.days+b},i,Boolean(b)]}function fp(s,i,a,t,r,l,o,c,d,f){const m=ai(s),p=S[t],u=Hl(t,s);t===7&&(s={...s,weeks:s.weeks+Math.trunc(s.days/7)});const g=st(s[p],r)*r;u[p]=g;const[h,T]=zr(o,u,t,r*m,c,d,f),P=g+Cr(i,h,T)*m*r,b=si(P,r,l),w=Math.sign(b-P)===m;return u[p]=b,[u,w?T:h,w]}function Wr(s,i,a,t){const[r,l,o,c]=((f)=>{const m=Zr(f=Ms(f));return[f.timeZone,...m]})(t),d=r!==void 0;return((f,m,p,u,g,h)=>{p=ht(p,g,u,1);const T=m.getOffsetNanosecondsFor(p);return Br(ii(p,T),h)+(f?yi(Aa(T)):"Z")})(d,i(d?s(r):ni),a.epochNanoseconds,l,o,c)}function Rr(s,i,a){const[t,r,l,o,c,d]=((f)=>{f=Ms(f);const m=Kl(f),p=$c(f),u=Pu(f),g=na(f,4),h=Za(f,4);return[m,Tu(f),u,g,...xc(h,p)]})(a);return((f,m,p,u,g,h,T,P,b,w)=>{u=ht(u,b,P,1);const D=f(p).getOffsetNanosecondsFor(u);return Br(ii(u,D),w)+yi(Aa(D),T)+((N,x)=>x!==1?"["+(x===2?"!":"")+K(N)+"]":"")(p,h)+Gr(m,g)})(s,i.calendar,i.timeZone,i.epochNanoseconds,t,r,l,o,c,d)}function Er(s,i){const[a,t,r,l]=((f)=>(f=Ms(f),[Kl(f),...Zr(f)]))(i);return o=s.calendar,c=a,d=l,Br(Yc(s,r,t),d)+Gr(o,c);var o,c,d}function Jr(s,i){return a=s.calendar,t=s,r=jr(i),Qa(t)+Gr(a,r);var a,t,r}function Ur(s,i){return Qc(s.calendar,Vc,s,jr(i))}function _r(s,i){return Qc(s.calendar,mp,s,jr(i))}function Hr(s,i){const[a,t,r]=nc(i);return l=r,kc(Nr(s,t,a)[0],l);var l}function Tt(s,i){const[a,t,r]=nc(i,3);return t>1&&(s={...s,...op(s,t,a)}),((l,o)=>{const{sign:c}=l,d=c===-1?ls(l):l,{hours:f,minutes:m}=d,[p,u]=yr(B(d,3),Os,qs);ld(p);const g=Yr(u,o),h=o>=0||!c||g;return(c<0?"-":"")+"P"+Go({Y:hi(d.years),M:hi(d.months),W:hi(d.weeks),D:hi(d.days)})+(f||m||p||h?"T"+Go({H:hi(f),M:hi(m),S:hi(p,h)+g}):"")})(s,r)}function Qc(s,i,a,t){const r=K(s),l=t>1||t===0&&r!==O;return t===1?r===O?i(a):Qa(a):l?Qa(a)+qc(r,t===2):i(a)}function Go(s){const i=[];for(let a in s){const t=s[a];t&&i.push(t,a)}return i.join("")}function Br(s,i){return Qa(s)+"T"+kc(s,i)}function Qa(s){return Vc(s)+"-"+ys(s.isoDay)}function Vc(s){const{isoYear:i}=s;return(i<0||i>9999?ec(i)+Ga(6,Math.abs(i)):Ga(4,i))+"-"+ys(s.isoMonth)}function mp(s){return ys(s.isoMonth)+"-"+ys(s.isoDay)}function kc(s,i){const a=[ys(s.isoHour),ys(s.isoMinute)];return i!==-1&&a.push(ys(s.isoSecond)+((t,r,l,o)=>Yr(t*Is+r*Li+l,o))(s.isoMillisecond,s.isoMicrosecond,s.isoNanosecond,i)),a.join(":")}function yi(s,i=0){if(i===1)return"";const[a,t]=Es(Math.abs(s),Ct),[r,l]=Es(t,zt),[o,c]=Es(l,Os);return ec(s)+ys(a)+":"+ys(r)+(o||c?":"+ys(o)+Yr(c):"")}function Gr(s,i){if(i!==1){const a=K(s);if(i>1||i===0&&a!==O)return qc(a,i===2)}return""}function qc(s,i){return"["+(i?"!":"")+"u-ca="+s+"]"}function Yr(s,i){let a=Ga(9,s);return a=i===void 0?a.replace(yu,""):a.slice(0,i),a?"."+a:""}function ec(s){return s<0?"-":"+"}function hi(s,i){return s||i?s.toLocaleString("fullwide",{useGrouping:0}):""}function pp(s,i){const{epochNanoseconds:a}=s,t=(i.getOffsetNanosecondsFor?i:i(s.timeZone)).getOffsetNanosecondsFor(a),r=ii(a,t);return{calendar:s.calendar,...r,offsetNanoseconds:t}}function sd(s,i){const a=rs(i,s);return{calendar:i.calendar,...gs(fm,a),offset:yi(a.offsetNanoseconds),timeZone:i.timeZone}}function Oi(s,i,a,t=0,r=0,l,o){if(a!==void 0&&t===1&&(t===1||o))return Sr(i,a);const c=s.getPossibleInstantsFor(i);if(a!==void 0&&t!==3){const d=((f,m,p,u)=>{const g=is(m);u&&(p=Aa(p));for(let h of f){let T=Ps(Ts(h,g));if(u&&(T=Aa(T)),T===p)return h}})(c,i,a,l);if(d!==void 0)return d;if(t===0)throw new RangeError(Ep)}return o?is(i):us(s,i,r,c)}function us(s,i,a=0,t=s.getPossibleInstantsFor(i)){if(t.length===1)return t[0];if(a===1)throw new RangeError(Jp);if(t.length)return t[a===3?1:0];const r=is(i),l=((c,d)=>{const f=c.getOffsetNanosecondsFor(Wi(d,-v));return Kr(c.getOffsetNanosecondsFor(Wi(d,v))-f)})(s,r),o=l*(a===2?-1:1);return(t=s.getPossibleInstantsFor(ii(r,o)))[a===2?0:t.length-1]}function Xr(s){if(Math.abs(s)>=v)throw new RangeError(Wp);return s}function Kr(s){if(s>v)throw new RangeError(Rp);return s}function Ar(s,i,a){return Y(ws(Ni(i.epochNanoseconds,((t)=>{if(od(t))throw new RangeError(Hp);return B(t,5)})(s?ls(a):a))))}function Qr(s,i,a,t,r,l=Object.create(null)){const o=i(t.timeZone),c=s(t.calendar);return{...t,...sl(o,c,t,a?ls(r):r,l)}}function Vr(s,i,a,t,r=Object.create(null)){const{calendar:l}=a;return R(il(s(l),a,i?ls(t):t,r),l)}function kr(s,i,a,t,r){const{calendar:l}=a;return E(Pt(s(l),a,i?ls(t):t,r),l)}function qr(s,i,a,t,r=Object.create(null)){const l=a.calendar,o=s(l);let c=pa(o,a);i&&(t=yt(t)),t.sign<0&&(c=o.dateAdd(c,{...A,months:1}),c=Fi(c,-1));const d=o.dateAdd(c,t,r);return Ti(pa(o,d),l)}function er(s,i,a){return Ls(id(i,s?ls(a):a)[0])}function sl(s,i,a,t,r){const l=B(t,5);let o=a.epochNanoseconds;if(od(t)){const c=rs(a,s);o=Ni(us(s,{...Pt(i,c,{...t,..._l},r),...gs(Zs,c)}),l)}else o=Ni(o,l),F(r);return{epochNanoseconds:ws(o)}}function il(s,i,a,t){const[r,l]=id(i,a);return _s({...Pt(s,i,{...a,..._l,days:a.days+l},t),...r})}function Pt(s,i,a,t){if(a.years||a.months||a.weeks)return s.dateAdd(i,a,t);F(t);const r=a.days+B(a,5)[0];return r?Vs(Fi(i,r)):i}function pa(s,i,a=1){return Fi(i,a-s.day(i))}function id(s,i){const[a,t]=B(i,5),[r,l]=lt(es(s)+t);return[r,a+l]}function Fi(s,i){return i?{...s,...ot(ts(s)+i*ms)}:s}function wt(s,i,a){const t=s(a.calendar);return Dt(a)?[a,t,i(a.timeZone)]:[{...a,...Fs},t]}function al(s){return s?Wc:is}function bt(s){return s?y(sl,s):il}function tl(s){return s?y(gp,s):hp}function Dt(s){return s&&s.epochNanoseconds}function ua(s,i){return s<=6-(Dt(i)?1:0)}function rl(s,i,a,t,r,l,o){const c=s(Ms(o).relativeTo),d=Math.max(Pi(r),Pi(l));if(ua(d,c))return n(Gi(((T,P,b,w)=>{const D=Ni(B(T),B(P),w?-1:1);if(!Number.isFinite(D[0]))throw new RangeError($t);return{...A,...Yi(D,b)}})(r,l,d,t)));if(!c)throw new RangeError(It);t&&(l=ls(l));const[f,m,p]=wt(i,a,c),u=bt(p),g=tl(p),h=u(m,f,r);return n(g(m,f,u(m,h,l),d))}function ad(s,i,a,t,r){const l=Pi(t),[o,c,d,f,m]=((Z,$,X)=>{Z=$r(Z,qa);let _=Xl(Z);const ra=X(Z[pm]);let la=nr(Z);const em=na(Z,7);let ui=Za(Z);if(_===void 0&&ui===void 0)throw new RangeError(Bp);return ui==null&&(ui=0),_==null&&(_=Math.max(ui,$)),Ic(_,ui),la=xr(la,ui,1),[_,ui,la,em,ra]})(r,l,s),p=Math.max(l,o);if(!Dt(m)&&p<=6)return n(Gi(((Z,$,X,_,ra)=>{const la=gt(B(Z),X,_,ra);return{...A,...Yi(la,$)}})(t,o,c,d,f)));if(!m)throw new RangeError(It);const[u,g,h]=wt(i,a,m),T=al(h),P=bt(h),b=tl(h),w=P(g,u,t);let D=b(g,u,w,o);const N=t.sign,x=ai(D);if(N&&x&&N!==x)throw new RangeError(Ma);return x&&(D=ut(D,T(w),o,c,d,f,g,u,T,P)),n(D)}function td(s){return s.sign===-1?yt(s):s}function yt(s){return n(ls(s))}function ls(s){const i={};for(let a of S)i[a]=-1*s[a]||0;return i}function rd(s){return!s.sign}function ai(s,i=S){let a=0;for(let t of i){const r=Math.sign(s[t]);if(r){if(a&&a!==r)throw new RangeError(_p);a=r}}return a}function Gi(s){for(let i of kp)Ds(i,s[i],-ko,ko,1);return ld(Ps(B(s),Os)),s}function ld(s){if(!Number.isSafeInteger(s))throw new RangeError(Up)}function B(s,i=6){return oc(s,i,S)}function Yi(s,i=6){const[a,t]=s,r=it(t,i,S);if(r[S[i]]+=a*(v/$s[i]),!Number.isFinite(r[S[i]]))throw new RangeError($t);return r}function Ot(s,i=5){return it(s,i,S)}function od(s){return Boolean(ai(s,cm))}function Pi(s){let i=9;for(;i>0&&!s[S[i]];i--);return i}function up(s,i){return[s,i]}function Yo(s){const i=Math.floor(s/Ha)*Ha;return[i,i+Ha]}function cd(s){const i=ti(s=Ya(s));if(!i)throw new RangeError(fs(s));let a;if(i.m)a=0;else{if(!i.offset)throw new RangeError(fs(s));a=Xi(i.offset)}return i.timeZone&&dl(i.timeZone,1),Y(Sr(ct(i),a))}function dd(s){const i=ti(I(s));if(!i)throw new RangeError(fs(s));if(i.timeZone)return wd(i,i.offset?Xi(i.offset):void 0);if(i.m)throw new RangeError(fs(s));return Dd(i)}function fd(s,i){const a=ti(I(s));if(!a||!a.timeZone)throw new RangeError(fs(s));const{offset:t}=a,r=t?Xi(t):void 0,[,l,o]=Da(i);return wd(a,r,l,o)}function Xi(s){const i=dl(s);if(i===void 0)throw new RangeError(fs(s));return i}function md(s){const i=ti(I(s));if(!i||i.m)throw new RangeError(fs(s));return R(bd(i))}function Ft(s){const i=ti(I(s));if(!i||i.m)throw new RangeError(fs(s));return E(i.p?bd(i):Dd(i))}function pd(s,i){const a=ol(I(i));if(a)return ll(a),Ti(Fr(bi(a)));const t=Ft(i);return Ti(pa(s(t.calendar),t))}function ll(s){if(s.calendar!==O)throw new RangeError(Js(s.calendar))}function ud(s,i){const a=cl(I(i));if(a)return ll(a),Ka(bi(a));const t=Ft(i),{calendar:r}=t,l=s(r),[o,c,d]=l.h(t),[f,m]=l.I(o,c),[p,u]=l.N(f,m,d);return Ka(Vs(l.P(p,u,d)),r)}function gd(s){let i,a=((t)=>{const r=Mu.exec(t);return r?(St(r[10]),Fd(r)):void 0})(I(s));if(!a){if(a=ti(s),!a)throw new RangeError(fs(s));if(!a.p)throw new RangeError(fs(s));if(a.m)throw new RangeError(Js("Z"));ll(a)}if((i=ol(s))&&Ho(i))throw new RangeError(fs(s));if((i=cl(s))&&Ho(i))throw new RangeError(fs(s));return Ls(dt(a,1))}function hd(s){const i=((a)=>{const t=Zu.exec(a);return t?((r)=>{function l(m,p,u){let g=0,h=0;if(u&&([g,d]=Es(d,$s[u])),m!==void 0){if(c)throw new RangeError(Js(m));h=((T)=>{const P=parseInt(T);if(!Number.isFinite(P))throw new RangeError(Js(T));return P})(m),o=1,p&&(d=fl(p)*($s[u]/Os),c=1)}return g+h}let o=0,c=0,d=0,f={...Ui(S,[l(r[2]),l(r[3]),l(r[4]),l(r[5]),l(r[6],r[7],5),l(r[8],r[9],4),l(r[10],r[11],3)]),...it(d,2,S)};if(!o)throw new RangeError(Uf(S));return ml(r[1])<0&&(f=ls(f)),f})(t):void 0})(I(s));if(!i)throw new RangeError(fs(s));return n(Gi(i))}function Td(s){const i=ti(s)||ol(s)||cl(s);return i?i.calendar:s}function Pd(s){const i=ti(s);return i&&(i.timeZone||i.m&&ni||i.offset)||s}function wd(s,i,a=0,t=0){const r=vt(s.timeZone),l=_t(r);return Q(Oi(l,ct(s),i,a,t,!l.v,s.m),r,Oa(s.calendar))}function bd(s){return yd(_s(ct(s)))}function Dd(s){return yd(Vs(bi(s)))}function yd(s){return{...s,calendar:Oa(s.calendar)}}function ti(s){const i=vu.exec(s);return i?((a)=>{const t=a[10],r=(t||"").toUpperCase()==="Z";return{isoYear:Od(a),isoMonth:parseInt(a[4]),isoDay:parseInt(a[5]),...Fd(a.slice(5)),...St(a[16]),p:Boolean(a[6]),m:r,offset:r?void 0:t}})(i):void 0}function ol(s){const i=Fu.exec(s);return i?((a)=>({isoYear:Od(a),isoMonth:parseInt(a[4]),isoDay:1,...St(a[5])}))(i):void 0}function cl(s){const i=Su.exec(s);return i?((a)=>({isoYear:Ji,isoMonth:parseInt(a[1]),isoDay:parseInt(a[2]),...St(a[3])}))(i):void 0}function dl(s,i){const a=Lu.exec(s);return a?((t,r)=>{const l=t[4]||t[5];if(r&&l)throw new RangeError(Js(l));return Xr((Ci(t[2])*Ct+Ci(t[3])*zt+Ci(t[4])*Os+fl(t[5]||""))*ml(t[1]))})(a,i):void 0}function Od(s){const i=ml(s[1]),a=parseInt(s[2]||s[3]);if(i<0&&!a)throw new RangeError(Js(-0));return i*a}function Fd(s){const i=Ci(s[3]);return{...lt(fl(s[4]||""))[0],isoHour:Ci(s[1]),isoMinute:Ci(s[2]),isoSecond:i===60?59:i}}function St(s){let i,a;const t=[];if(s.replace(ju,(r,l,o)=>{const c=Boolean(l),[d,f]=o.split("=").reverse();if(f){if(f==="u-ca")t.push(d),i||(i=c);else if(c||/[A-Z]/.test(f))throw new RangeError(Js(r))}else{if(a)throw new RangeError(Js(r));a=d}return""}),t.length>1&&i)throw new RangeError(Js(s));return{timeZone:a,calendar:t[0]||O}}function fl(s){return parseInt(s.padEnd(9,"0"))}function Ki(s){return new RegExp(`^${s}\$`,"i")}function ml(s){return s&&s!=="+"?-1:1}function Ci(s){return s===void 0?0:parseInt(s)}function Sd(s){return vt(I(s))}function vt(s){const i=pl(s);return typeof i=="number"?yi(i):i?((a)=>{if(xu.test(a))throw new RangeError(Np);return a.toLowerCase().split("/").map((t,r)=>(t.length<=3||/\d/.test(t))&&!/etc|yap/.test(t)?t.toUpperCase():t.replace(/baja|dumont|[a-z]+/g,(l,o)=>l.length<=2&&!r||l==="in"||l==="chat"?l.toUpperCase():l.length>2||!o?Uo(l).replace(/island|noronha|murdo|rivadavia|urville/,Uo):l)).join("/")})(s):ni}function Xo(s){const i=pl(s);return typeof i=="number"?i:i?i.resolvedOptions().timeZone:ni}function pl(s){const i=dl(s=s.toUpperCase(),1);return i!==void 0?i:s!==ni?nu(s):void 0}function ul(s,i){return as(s.epochNanoseconds,i.epochNanoseconds)}function gl(s,i){return as(s.epochNanoseconds,i.epochNanoseconds)}function vd(s,i,a,t,r,l){const o=s(Ms(l).relativeTo),c=Math.max(Pi(t),Pi(r));if(rc(S,t,r))return 0;if(ua(c,o))return as(B(t),B(r));if(!o)throw new RangeError(It);const[d,f,m]=wt(i,a,o),p=al(m),u=bt(m);return as(p(u(f,d,t)),p(u(f,d,r)))}function hl(s,i){return Si(s,i)||Mt(s,i)}function Si(s,i){return Qs(ts(s),ts(i))}function Mt(s,i){return Qs(es(s),es(i))}function Md(s,i){return!ul(s,i)}function Ld(s,i){return!gl(s,i)&&!!Lt(s.timeZone,i.timeZone)&&Bi(s.calendar,i.calendar)}function jd(s,i){return!hl(s,i)&&Bi(s.calendar,i.calendar)}function Zd(s,i){return!Si(s,i)&&Bi(s.calendar,i.calendar)}function nd(s,i){return!Si(s,i)&&Bi(s.calendar,i.calendar)}function xd(s,i){return!Si(s,i)&&Bi(s.calendar,i.calendar)}function $d(s,i){return!Mt(s,i)}function Lt(s,i){if(s===i)return 1;const a=K(s),t=K(i);if(a===t)return 1;try{return Xo(a)===Xo(t)}catch(r){}}function Tl(s,i,a,t){const r=Hi(s,W(t),3,5),l=jt(i.epochNanoseconds,a.epochNanoseconds,...r);return n(s?ls(l):l)}function Pl(s,i,a,t,r,l){const o=nt(t.calendar,r.calendar),c=W(l),[d,f,m,p]=Hi(a,c,5),u=t.epochNanoseconds,g=r.epochNanoseconds,h=as(g,u);let T;if(h)if(d<6)T=jt(u,g,d,f,m,p);else{const P=i(((w,D)=>{if(!Lt(w,D))throw new RangeError(Xf);return w})(t.timeZone,r.timeZone)),b=s(o);T=zd(b,P,t,r,h,d,c),T=ut(T,g,d,f,m,p,b,t,Wc,y(sl,P))}else T=A;return n(a?ls(T):T)}function wl(s,i,a,t,r){const l=nt(a.calendar,t.calendar),o=W(r),[c,d,f,m]=Hi(i,o,6),p=is(a),u=is(t),g=as(u,p);let h;if(g)if(c<=6)h=jt(p,u,c,d,f,m);else{const T=s(l);h=Cd(T,a,t,g,c,o),h=ut(h,u,c,d,f,m,T,a,is,il)}else h=A;return n(i?ls(h):h)}function bl(s,i,a,t,r){const l=nt(a.calendar,t.calendar),o=W(r);return Id(i,()=>s(l),a,t,...Hi(i,o,6,9,6),o)}function Dl(s,i,a,t,r){const l=nt(a.calendar,t.calendar),o=W(r),c=Hi(i,o,9,9,8),d=s(l);return Id(i,()=>d,pa(d,a),pa(d,t),...c,o)}function Id(s,i,a,t,r,l,o,c,d){const f=is(a),m=is(t);let p;if(as(m,f))if(r===6)p=jt(f,m,r,l,o,c);else{const u=i();p=u.dateUntil(a,t,r,d),l===6&&o===1||(p=ut(p,m,r,l,o,c,u,a,is,Pt))}else p=A;return n(s?ls(p):p)}function yl(s,i,a,t){const r=W(t),[l,o,c,d]=Hi(s,r,5,5),f=si(Ol(i,a),ya(o,c),d),m={...A,...Ot(f,l)};return n(s?ls(m):m)}function gp(s,i,a,t,r,l){const o=as(t.epochNanoseconds,a.epochNanoseconds);return o?r<6?Nd(a.epochNanoseconds,t.epochNanoseconds,r):zd(i,s,a,t,o,r,l):A}function hp(s,i,a,t,r){const l=is(i),o=is(a),c=as(o,l);return c?t<=6?Nd(l,o,t):Cd(s,i,a,c,t,r):A}function zd(s,i,a,t,r,l,o){const[c,d,f]=((u,g,h,T)=>{function P(){return $={...Fi(D,x++*-T),...w},X=us(u,$),as(N,X)===-T}const b=rs(g,u),w=gs(Zs,b),D=rs(h,u),N=h.epochNanoseconds;let x=0;const Z=Ol(b,D);let $,X;if(Math.sign(Z)===-T&&x++,P()&&(T===-1||P()))throw new RangeError(Ma);const _=Ps(Ts(X,N));return[b,$,_]})(i,a,t,r);var m,p;return{...l===6?(m=c,p=d,{...A,days:Wd(m,p)}):s.dateUntil(c,d,l,o),...Ot(f)}}function Cd(s,i,a,t,r,l){const[o,c,d]=((f,m,p)=>{let u=m,g=Ol(f,m);return Math.sign(g)===-p&&(u=Fi(m,-p),g+=v*p),[f,u,g]})(i,a,t);return{...s.dateUntil(o,c,r,l),...Ot(d)}}function jt(s,i,a,t,r,l){return{...A,...Yi(gt(Ts(s,i),t,r,l),a)}}function Nd(s,i,a){return{...A,...Yi(Ts(s,i),a)}}function Wd(s,i){return Zt(ts(s),ts(i))}function Zt(s,i){return Math.trunc((i-s)/ms)}function Ol(s,i){return es(i)-es(s)}function nt(s,i){if(!Bi(s,i))throw new RangeError(Wl);return s}function Tp(s){function i(r){return((l,o)=>({...Rd(l,o),F:l.month,day:parseInt(l.day)}))(Or(a,r),t)}const a=kl(s),t=Va(s);return{id:s,O:Pp(i),B:wp(i)}}function Pp(s){return ps((i)=>{const a=ts(i);return s(a)},WeakMap)}function wp(s){const i=s(0).year-tu;return ps((a)=>{let t,r=_i(a-i);const l=[],o=[];do r+=400*ms;while((t=s(r)).year<=a);do r+=(1-t.day)*ms,t.year===a&&(l.push(r),o.push(t.F)),r-=ms;while((t=s(r)).year>=a);return{k:l.reverse(),C:Qf(o.reverse())}})}function Rd(s,i){let a,t,r=Ed(s);if(s.era){const l=rm[i];l!==void 0&&(a=i==="islamic"?"ah":s.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),a==="bc"||a==="b"?a="bce":a!=="ad"&&a!=="a"||(a="ce"),t=r,r=Bd(t,l[a]||0))}return{era:a,eraYear:t,year:r}}function Ed(s){return parseInt(s.relatedYear||s.year)}function lr(s){const{year:i,F:a,day:t}=this.O(s),{C:r}=this.B(i);return[i,r[a]+1,t]}function ga(s,i=1,a=1){return this.B(s).k[i-1]+(a-1)*ms}function Ja(s){const i=Ao(this,s),a=Ao(this,s-1),t=i.length;if(t>a.length){const r=Gd(this);if(r<0)return-r;for(let l=0;l<t;l++)if(i[l]!==a[l])return l+1}}function Ua(s){return Zt(ga.call(this,s),ga.call(this,s+1))}function Ko(s,i){const{k:a}=this.B(s);let t=i+1,r=a;return t>a.length&&(t=1,r=this.B(s+1).k),Zt(a[i-1],r[t-1])}function _a(s){return this.B(s).k.length}function Ao(s,i){return Object.keys(s.B(i).C)}function Jd(s){return Oa(I(s))}function Oa(s){if((s=s.toLowerCase())!==O&&s!==Wt&&Va(s)!==Va(kl(s).resolvedOptions().calendar))throw new RangeError(Cp(s));return s}function Va(s){return s==="islamicc"&&(s="islamic"),s.split("-")[0]}function Ud(s){return this.R(s)[0]}function _d(s){return this.R(s)[1]}function Fl(s){const[i]=this.h(s);return Zt(this.q(i),ts(s))+1}function Hd(s){const i=Iu.exec(s);if(!i)throw new RangeError(Ip(s));return[parseInt(i[1]),Boolean(i[2])]}function ka(s,i,a){return s+(i||a&&s>=a?1:0)}function or(s,i){return s-(i&&s>=i?1:0)}function Bd(s,i){return(i+s)*(Math.sign(i)||1)||0}function cr(s){return rm[Yd(s)]}function Gd(s){return Ap[Yd(s)]}function Yd(s){return Va(s.id||O)}function Xd(s,i,a,t){const r=ri(a,t,js,[],sm);if(r.timeZone!==void 0){const l=a.dateFromFields(r),o=vi(r),c=s(r.timeZone);return{epochNanoseconds:Oi(i(c),{...l,...o},r.offset!==void 0?Xi(r.offset):void 0),timeZone:c}}return{...a.dateFromFields(r),...Fs}}function Kd(s,i,a,t,r,l){const o=ri(a,r,js,qf,sm),c=s(o.timeZone),[d,f,m]=Da(l),p=a.dateFromFields(o,mt(l,d)),u=vi(o,d);return Q(Oi(i(c),{...p,...u},o.offset!==void 0?Xi(o.offset):void 0,f,m),c,t)}function Ad(s,i,a){const t=ri(s,i,js,[],Gs),r=F(a);return R(_s({...s.dateFromFields(t,mt(a,r)),...vi(t,r)}))}function Sl(s,i,a,t=[]){const r=ri(s,i,js,t);return s.dateFromFields(r,a)}function vl(s,i,a,t){const r=ri(s,i,Jl,t);return s.yearMonthFromFields(r,a)}function Ml(s,i,a,t,r=[]){const l=ri(s,a,js,r);return i&&l.month!==void 0&&l.monthCode===void 0&&l.year===void 0&&(l.year=Ji),s.monthDayFromFields(l,t)}function Qd(s,i){const a=F(i);return Ls(vi(xs(s,fr,[],1),a))}function Vd(s){const i=xs(s,Ul);return n(Gi({...A,...i}))}function ri(s,i,a,t=[],r=[]){return xs(i,[...s.fields(a),...r].sort(),t)}function xs(s,i,a,t=!a){const r={};let l,o=0;for(let c of i){if(c===l)throw new RangeError(Lp(c));if(c==="constructor"||c==="__proto__")throw new RangeError(Cl(c));let d=s[c];if(d!==void 0)o=1,qo[c]&&(d=qo[c](d,c)),r[c]=d;else if(a){if(a.includes(c))throw new TypeError(zl(c));r[c]=tm[c]}l=c}if(t&&!o)throw new TypeError(Uf(i));return r}function vi(s,i){return dt(Wu({...tm,...s}),i)}function kd(s,i,a,t,r,l){const o=W(l),{calendar:c,timeZone:d}=a;return Q(((f,m,p,u,g)=>{const h=Fa(f,p,u,js,ef,kf),[T,P,b]=Da(g,2);return Oi(m,{...f.dateFromFields(h,mt(g,T)),...vi(h,T)},Xi(h.offset),P,b)})(s(c),i(d),t,r,o),d,c)}function qd(s,i,a,t,r){const l=W(r);return R(((o,c,d,f)=>{const m=Fa(o,c,d,js,Gs),p=F(f);return _s({...o.dateFromFields(m,mt(f,p)),...vi(m,p)})})(s(i.calendar),a,t,l))}function ed(s,i,a,t,r){const l=W(r);return((o,c,d,f)=>{const m=Fa(o,c,d,js);return o.dateFromFields(m,f)})(s(i.calendar),a,t,l)}function sf(s,i,a,t,r){const l=W(r);return Ti(((o,c,d,f)=>{const m=Fa(o,c,d,Jl);return o.yearMonthFromFields(m,f)})(s(i.calendar),a,t,l))}function af(s,i,a,t,r){const l=W(r);return((o,c,d,f)=>{const m=Fa(o,c,d,js);return o.monthDayFromFields(m,f)})(s(i.calendar),a,t,l)}function tf(s,i,a){return Ls(((t,r,l)=>{const o=F(l);return vi({...gs(fr,t),...xs(r,fr)},o)})(s,i,a))}function rf(s,i){return n((a=s,t=i,Gi({...a,...xs(t,Ul)})));var a,t}function Fa(s,i,a,t,r=[],l=[]){const o=[...s.fields(t),...r].sort();let c=xs(i,o,l);const d=xs(a,o);return c=s.mergeFields(c,d),xs(c,o,[])}function Ll(s,i){const a=ri(s,i,am);return s.monthDayFromFields(a)}function jl(s,i,a){const t=ri(s,i,im);return s.yearMonthFromFields(t,a)}function lf(s,i,a,t,r){i=gs(a=s.fields(a),i),t=xs(t,r=s.fields(r),[]);let l=s.mergeFields(i,t);return l=xs(l,[...a,...r].sort(),[]),s.dateFromFields(l)}function sr(s,i){let{era:a,eraYear:t,year:r}=i;const l=cr(s);if(a!==void 0||t!==void 0){if(a===void 0||t===void 0)throw new TypeError(Zp);if(!l)throw new RangeError(jp);const o=l[a];if(o===void 0)throw new RangeError(xp(a));const c=Bd(t,o);if(r!==void 0&&r!==c)throw new RangeError(np);r=c}else if(r===void 0)throw new TypeError($p(l));return r}function ir(s,i,a,t){let{month:r,monthCode:l}=i;if(l!==void 0){const o=((c,d,f,m)=>{const p=c.U(f),[u,g]=Hd(d);let h=ka(u,g,p);if(g){const T=Gd(c);if(T===void 0)throw new RangeError(da);if(T>0){if(h>T)throw new RangeError(da);if(p===void 0){if(m===1)throw new RangeError(da);h--}}else{if(h!==-T)throw new RangeError(da);if(p===void 0&&m===1)throw new RangeError(da)}}return h})(s,l,a,t);if(r!==void 0&&r!==o)throw new RangeError(Gf);r=o,t=1}else if(r===void 0)throw new TypeError(zp);return Ds("month",r,1,s.L(a),t)}function Qo(s,i,a,t,r){return ds(i,"day",1,s.j(t,a),r)}function ar(s,i,a,t){let r=0;const l=[];for(let o of a)i[o]!==void 0?r=1:l.push(o);if(Object.assign(s,i),r)for(let o of t||l)delete s[o]}function of(s){return Y(ws(rt(tt(s))))}function cf(s,i,a,t,r=O){return Q(ws(rt(tt(a))),i(t),s(r))}function df(s,i,a,t,r=0,l=0,o=0,c=0,d=0,f=0,m=O){return R(_s(ct(Ss(ss,Ui(Rt,[i,a,t,r,l,o,c,d,f])))),s(m))}function ff(s,i,a,t,r=O){return E(Vs(bi(Ss(ss,{isoYear:i,isoMonth:a,isoDay:t}))),s(r))}function mf(s,i,a,t=O,r=1){const l=ss(i),o=ss(a),c=s(t);return Ti(Fr(bi({isoYear:l,isoMonth:o,isoDay:ss(r)})),c)}function pf(s,i,a,t=O,r=Ji){const l=ss(i),o=ss(a),c=s(t);return Ka(Vs(bi({isoYear:ss(r),isoMonth:l,isoDay:o})),c)}function uf(s=0,i=0,a=0,t=0,r=0,l=0){return Ls(dt(Ss(ss,Ui(Zs,[s,i,a,t,r,l])),1))}function gf(s=0,i=0,a=0,t=0,r=0,l=0,o=0,c=0,d=0,f=0){return n(Gi(Ss(Pc,Ui(S,[s,i,a,t,r,l,o,c,d,f]))))}function Zl(s,i,a=O){return Q(s.epochNanoseconds,i,a)}function hf(s){return Y(s.epochNanoseconds)}function nl(s,i){return R(rs(i,s))}function xl(s,i){return E(rs(i,s))}function Tf(s,i,a){return jl(s(i.calendar),a)}function Pf(s,i,a){return Ll(s(i.calendar),a)}function $l(s,i){return Ls(rs(i,s))}function wf(s,i,a,t){const r=((l,o,c,d)=>{const f=Lr(d);return us(l(o),c,f)})(s,a,i,t);return Q(ws(r),a,i.calendar)}function bf(s,i,a){const t=s(i.calendar);return Ti({...i,...jl(t,a)})}function Df(s,i,a){return Ll(s(i.calendar),a)}function yf(s,i,a,t,r){const l=s(r.timeZone),o=r.plainTime,c=o!==void 0?i(o):Fs;return Q(us(a(l),{...t,...c}),l,t.calendar)}function Of(s,i=Fs){return R(_s({...s,...i}))}function Ff(s,i,a){return jl(s(i.calendar),a)}function Sf(s,i,a){return Ll(s(i.calendar),a)}function vf(s,i,a,t){return((r,l,o)=>lf(r,l,im,Us(o),ja))(s(i.calendar),a,t)}function Mf(s,i,a,t){return((r,l,o)=>lf(r,l,am,Us(o),Nt))(s(i.calendar),a,t)}function Lf(s,i,a,t,r){const l=Us(r),o=i(l.plainDate),c=s(l.timeZone);return Q(us(a(c),{...o,...t}),c,o.calendar)}function jf(s,i){return R(_s({...s,...i}))}function Zf(s){return Y(ws(Ri(s,Os)))}function nf(s){return Y(ws(Ri(s,Is)))}function xf(s){return Y(ws(rt(tt(s),Li)))}function $f(s){return Y(ws(rt(tt(s))))}function If(s,i,a=Fs){const t=i.timeZone,r=s(t),l={...rs(i,r),...a};return Q(Oi(r,l,l.offsetNanoseconds,2),t,i.calendar)}function zf(s,i,a){const t=i.timeZone,r=s(t),l={...rs(i,r),...a},o=Rf(i.calendar,a.calendar);return Q(Oi(r,l,l.offsetNanoseconds,2),t,o)}function Cf(s,i=Fs){return R({...s,...i})}function Nf(s,i){return R({...s,...i},Rf(s.calendar,i.calendar))}function xt(s,i){return{...s,calendar:i}}function Wf(s,i){return{...s,timeZone:i}}function Rf(s,i){if(s===i)return s;const a=K(s),t=K(i);if(a===t||a===O)return i;if(t===O)return s;throw new RangeError(Wl)}function bp(s,i){return(a)=>a===O?s:a===Wt||a===Ei?Object.assign(Object.create(s),{id:a}):Object.assign(Object.create(i),$u(a))}function Mi(s,i,a){const t=new Set(a);return(r)=>(((l,o)=>{for(let c of o)if(c in l)return 1;return 0})(r=gr(t,r),s)||Object.assign(r,i),a&&(r.timeZone=ni,["full","long"].includes(r.timeStyle)&&(r.timeStyle="medium")),r)}function Hs(s,i=Il){const[a,,,t]=s;return(r,l=qu,...o)=>{const c=i(t&&t(...o),r,l,a),d=c.resolvedOptions();return[c,...Dp(s,d,o)]}}function Il(s,i,a,t){if(a=t(a),s){if(a.timeZone!==void 0)throw new TypeError(Yp);a.timeZone=s}return new li(i,a)}function Dp(s,i,a){const[,t,r]=s;return a.map((l)=>(l.calendar&&((o,c,d)=>{if((d||o!==O)&&o!==c)throw new RangeError(Wl)})(K(l.calendar),i.calendar,r),t(l,i)))}function Ai(s){const i=Sa();return ii(i,s.getOffsetNanosecondsFor(i))}function Sa(){return Ri(Date.now(),Is)}function Bs(){return sc||(sc=new li().resolvedOptions().timeZone)}var yp=(s,i)=>`Non-integer ${s}: ${i}`,Op=(s,i)=>`Non-positive ${s}: ${i}`,Fp=(s,i)=>`Non-finite ${s}: ${i}`,Sp=(s)=>`Cannot convert bigint to ${s}`,vp=(s)=>`Invalid bigint: ${s}`,Mp="Cannot convert Symbol to string",Ef="Invalid object",Jf=(s,i,a,t,r)=>r?Jf(s,r[i],r[a],r[t]):va(s,i)+`; must be between ${a}-${t}`,va=(s,i)=>`Invalid ${s}: ${i}`,zl=(s)=>`Missing ${s}`,Cl=(s)=>`Invalid field ${s}`,Lp=(s)=>`Duplicate field ${s}`,Uf=(s)=>"No valid fields: "+s.join(),_f="Invalid bag",Hf=(s,i,a)=>va(s,i)+"; must be "+Object.keys(a).join(),Bf="Cannot use valueOf",Nl="Invalid calling context",jp="Forbidden era/eraYear",Zp="Mismatching era/eraYear",np="Mismatching year/eraYear",xp=(s)=>`Invalid era: ${s}`,$p=(s)=>"Missing year"+(s?"/era/eraYear":""),Ip=(s)=>`Invalid monthCode: ${s}`,Gf="Mismatching month/monthCode",zp="Missing month/monthCode",Vo="Cannot guess year",da="Invalid leap month",Yf="Invalid protocol",Ma="Invalid protocol results",Wl="Mismatching Calendars",Cp=(s)=>`Invalid Calendar: ${s}`,Xf="Mismatching TimeZones",Np="Forbidden ICU TimeZone",Wp="Out-of-bounds offset",Rp="Out-of-bounds TimeZone gap",Ep="Invalid TimeZone offset",Jp="Ambiguous offset",$t="Out-of-bounds date",Up="Out-of-bounds duration",_p="Cannot mix duration signs",It="Missing relativeTo",Hp="Cannot use large units",Bp="Required smallestUnit or largestUnit",Gp="smallestUnit > largestUnit",fs=(s)=>`Cannot parse: ${s}`,Js=(s)=>`Invalid substring: ${s}`,Kf=(s)=>`Cannot format ${s}`,Af="Mismatching types for formatting",Yp="Cannot specify TimeZone",Qf=y(Pa,(s,i)=>i),Qi=y(Pa,(s,i,a)=>a),ys=y(Ga,2),dr={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},La=Object.keys(dr),ms=86400000,Vf=1000,Li=1000,Is=1e6,Os=1e9,zt=60000000000,Ct=3600000000000,v=86400000000000,$s=[1,Li,Is,Os,zt,Ct,v],Gs=La.slice(0,6),fr=wa(Gs),kf=["offset"],qf=["timeZone"],ef=Gs.concat(kf),sm=ef.concat(qf),mr=["era","eraYear"],Xp=mr.concat(["year"]),Nt=["year"],Rl=["monthCode"],El=["month"].concat(Rl),ja=["day"],Jl=El.concat(Nt),im=Rl.concat(Nt),js=ja.concat(Jl),Kp=ja.concat(El),am=ja.concat(Rl),tm=Qi(Gs,0),O="iso8601",Wt="gregory",Ei="japanese",rm={[Wt]:{bce:-1,ce:0},[Ei]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},Ap={chinese:13,dangi:13,hebrew:-6},I=y(at,"string"),lm=y(at,"boolean"),Qp=y(at,"number"),om=y(at,"function"),S=La.map((s)=>s+"s"),Ul=wa(S),Vp=S.slice(0,6),cm=S.slice(6),kp=cm.slice(1),qp=Qf(S),A=Qi(S,0),_l=Qi(Vp,0),Hl=y(lc,S),Zs=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Bl=["isoDay","isoMonth","isoYear"],Rt=Zs.concat(Bl),Gl=wa(Bl),dm=wa(Zs),fm=wa(Rt),Fs=Qi(dm,0),ep=y(lc,Rt),li=Intl.DateTimeFormat,mm="en-GB",Yl=1e8,su=Yl*ms,iu=[Yl,0],au=[-Yl,0],ha=275760,Ta=-271821,tu=1970,Ji=1972,Rs=12,ru=_i(1868,9,8),lu=ps(lp,WeakMap),qa="smallestUnit",pr="unit",ma="roundingIncrement",tr="fractionalSecondDigits",pm="relativeTo",um={constrain:0,reject:1},ou=Object.keys(um),cu={compatible:0,reject:1,earlier:2,later:3},du={reject:0,use:1,prefer:2,ignore:3},fu={auto:0,never:1,critical:2,always:3},mu={auto:0,never:1,critical:2},pu={auto:0,never:1},uu={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Za=y(Ir,qa),Xl=y(Ir,"largestUnit"),gu=y(Ir,pr),gm=y(Di,"overflow",um),hm=y(Di,"disambiguation",cu),hu=y(Di,"offset",du),Kl=y(Di,"calendarName",fu),Tu=y(Di,"timeZoneName",mu),Pu=y(Di,"offset",pu),na=y(Di,"roundingMode",uu),Vi="PlainYearMonth",ki="PlainMonthDay",ji="PlainDate",Zi="PlainDateTime",Et="PlainTime",Ys="ZonedDateTime",Jt="Instant",Ut="Duration",wu=[Math.floor,(s)=>Ea(s)?Math.floor(s):Math.round(s),Math.ceil,(s)=>Ea(s)?Math.ceil(s):Math.round(s),Math.trunc,(s)=>Ea(s)?Math.trunc(s)||0:Math.round(s),(s)=>s<0?Math.floor(s):Math.ceil(s),(s)=>Math.sign(s)*Math.round(Math.abs(s))||0,(s)=>Ea(s)?(s=Math.trunc(s)||0)+s%2:Math.round(s)],ni="UTC",Ha=5184000,bu=Xa(1847),Du=Xa(new Date().getUTCFullYear()+10),yu=/0+$/,rs=ps(pp,WeakMap),ko=4294967295,_t=ps((s)=>{const i=pl(s);return typeof i=="object"?new Pm(i):new Tm(i||0)});class Tm{constructor(s){this.v=s}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(s){return[Sr(s,this.v)]}l(){}}class Pm{constructor(s){this.$=((i)=>{function a(d){const f=rr(d,o,c),[m,p]=Yo(f),u=r(m),g=r(p);return u===g?u:t(l(m,p),u,g,d)}function t(d,f,m,p){let u,g;for(;(p===void 0||(u=p<d[0]?f:p>=d[1]?m:void 0)===void 0)&&(g=d[1]-d[0]);){const h=d[0]+Math.floor(g/2);i(h)===m?d[1]=h:d[0]=h+1}return u}const r=ps(i),l=ps(up);let o=bu,c=Du;return{G(d){const f=a(d-86400),m=a(d+86400),p=d-f,u=d-m;if(f===m)return[p];const g=a(p);return g===a(u)?[d-g]:f>m?[p,u]:[]},V:a,l(d,f){const m=rr(d,o,c);let[p,u]=Yo(m);const g=Ha*f,h=f<0?()=>u>o||(o=m,0):()=>p<c||(c=m,0);for(;h();){const T=r(p),P=r(u);if(T!==P){const b=l(p,u);t(b,T,P);const w=b[0];if((Qs(w,d)||1)===f)return w}p+=g,u+=g}}}})(((i)=>(a)=>{const t=Or(i,a*Vf);return Xa(Ed(t),parseInt(t.month),parseInt(t.day),parseInt(t.hour),parseInt(t.minute),parseInt(t.second))-a})(s))}getOffsetNanosecondsFor(s){return this.$.V(Dc(s))*Os}getPossibleInstantsFor(s){const[i,a]=[Xa((t=s).isoYear,t.isoMonth,t.isoDay,t.isoHour,t.isoMinute,t.isoSecond),t.isoMillisecond*Is+t.isoMicrosecond*Li+t.isoNanosecond];var t;return this.$.G(i).map((r)=>ws(Wi(Ri(r,Os),a)))}l(s,i){const[a,t]=yc(s),r=this.$.l(a+(i>0||t?1:0),i);if(r!==void 0)return Ri(r,Os)}}var Al="([+\u2212-])",Ba="(?:[.,](\\d{1,9}))?",wm=`(?:(?:${Al}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Ql="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+Ba+")?)?",Vl=Al+Ql,Ou=wm+"-?(\\d{2})(?:[T ]"+Ql+"(Z|"+Vl+")?)?",bm="\\[(!?)([^\\]]*)\\]",Ht=`((?:${bm}){0,9})`,Fu=Ki(wm+Ht),Su=Ki("(?:--)?(\\d{2})-?(\\d{2})"+Ht),vu=Ki(Ou+Ht),Mu=Ki("T?"+Ql+"(?:"+Vl+")?"+Ht),Lu=Ki(Vl),ju=new RegExp(bm,"g"),Zu=Ki(`${Al}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${Ba}H)?(?:(\\d+)${Ba}M)?(?:(\\d+)${Ba}S)?)?`),nu=ps((s)=>new li(mm,{timeZone:s,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),xu=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,$u=ps(Tp),kl=ps((s)=>new li(mm,{calendar:s,timeZone:ni,era:"short",year:"numeric",month:"short",day:"numeric"})),Iu=/^M(\d{2})(L?)$/,zu={era:Ya,eraYear:ss,year:ss,month:_o,monthCode:Ya,day:_o},Cu=Qi(Gs,ss),Nu=Qi(S,Pc),qo=Object.assign({},zu,Cu,Nu,{offset:Ya}),Wu=y(rp,Gs,Zs),eo={dateAdd(s,i,a){const t=F(a);let r,{years:l,months:o,weeks:c,days:d}=i;if(d+=B(i,5)[0],l||o)r=((f,m,p,u,g)=>{let[h,T,P]=f.h(m);if(p){const[b,w]=f.I(h,T);h+=p,T=ka(b,w,f.U(h)),T=Ds("month",T,1,f.L(h),g)}return u&&([h,T]=f._(h,T,u)),P=Ds("day",P,1,f.j(h,T),g),f.q(h,T,P)})(this,s,l,o,t);else{if(!c&&!d)return s;r=ts(s)}return r+=(7*c+d)*ms,Vs(ot(r))},dateUntil(s,i,a){if(a<=7){let d=0,f=Wd({...s,...Fs},{...i,...Fs});return a===7&&([d,f]=qs(f,7)),{...A,weeks:d,days:f}}const t=this.h(s),r=this.h(i);let[l,o,c]=((d,f,m,p,u,g,h)=>{let T=u-f,P=g-m,b=h-p;if(T||P){const w=Math.sign(T||P);let D=d.j(u,g),N=0;if(Math.sign(b)===-w){const x=D;[u,g]=d._(u,g,-w),T=u-f,P=g-m,D=d.j(u,g),N=w<0?-x:D}if(b=h-Math.min(p,D)+N,T){const[x,Z]=d.I(f,m),[$,X]=d.I(u,g);if(P=$-x||Number(X)-Number(Z),Math.sign(P)===-w){const _=w<0&&-d.L(u);T=(u-=w)-f,P=g-ka(x,Z,d.U(u))+(_||d.L(u))}}}return[T,P,b]})(this,...t,...r);return a===8&&(o+=this.J(l,t[0]),l=0),{...A,years:l,months:o,days:c}},dateFromFields(s,i){const a=F(i),t=sr(this,s),r=ir(this,s,t,a),l=Qo(this,s,r,t,a);return E(Vs(this.P(t,r,l)),this.id||O)},yearMonthFromFields(s,i){const a=F(i),t=sr(this,s),r=ir(this,s,t,a);return Ti(Fr(this.P(t,r,1)),this.id||O)},monthDayFromFields(s,i){const a=F(i),t=!this.id,{monthCode:r,year:l,month:o}=s;let c,d,f,m,p;if(r!==void 0){[c,d]=Hd(r),p=ic(s,"day");const u=this.N(c,d,p);if(!u)throw new RangeError(Vo);if([f,m]=u,o!==void 0&&o!==m)throw new RangeError(Gf);t&&(m=Ds("month",m,1,Rs,1),p=Ds("day",p,1,vr(l!==void 0?l:f,m),a))}else{f=l===void 0&&t?Ji:sr(this,s),m=ir(this,s,f,a),p=Qo(this,s,m,f,a);const u=this.U(f);d=m===u,c=or(m,u);const g=this.N(c,d,p);if(!g)throw new RangeError(Vo);[f,m]=g}return Ka(Vs(this.P(f,m,p)),this.id||O)},fields(s){return cr(this)&&s.includes("year")?[...s,...mr]:s},mergeFields(s,i){const a=Object.assign(Object.create(null),s);return ar(a,i,El),cr(this)&&(ar(a,i,Xp),this.id===Ei&&ar(a,i,Kp,mr)),a},inLeapYear(s){const[i]=this.h(s);return this.K(i)},monthsInYear(s){const[i]=this.h(s);return this.L(i)},daysInMonth(s){const[i,a]=this.h(s);return this.j(i,a)},daysInYear(s){const[i]=this.h(s);return this.X(i)},dayOfYear:Fl,era(s){return this.ee(s)[0]},eraYear(s){return this.ee(s)[1]},monthCode(s){const[i,a]=this.h(s),[t,r]=this.I(i,a);return((l,o)=>"M"+ys(l)+(o?"L":""))(t,r)},dayOfWeek:Mc,daysInWeek(){return 7}},Ru={dayOfYear:Fl,h:Fc,q:_i},Eu=Object.assign({},Ru,{weekOfYear:Ud,yearOfWeek:_d,R(s){function i(g){return(7-g<t?7:0)-g}function a(g){const h=vc(u+g),T=g||1,P=i(fa(d+h*T,7));return m=(h+(P-f)*T)/7}const t=this.id?1:4,r=Mc(s),l=this.dayOfYear(s),o=fa(r-1,7),c=l-1,d=fa(o-c,7),f=i(d);let m,p=Math.floor((c-f)/7)+1,u=s.isoYear;return p?p>a(0)&&(p=1,u++):(p=a(-1),u--),[p,u,m]}}),Ju={dayOfYear:Fl,h:lr,q:ga,weekOfYear:Ud,yearOfWeek:_d,R(){return[]}},qi=bp(Object.assign({},eo,Eu,{h:Fc,ee(s){return this.id===Wt?Lc(s):this.id===Ei?lu(s):[]},I:(s,i)=>[i,0],N(s,i){if(!i)return[Ji,s]},K:Mr,U(){},L:Sc,J:(s)=>s*Rs,j:vr,X:vc,P:(s,i,a)=>({isoYear:s,isoMonth:i,isoDay:a}),q:_i,_:(s,i,a)=>(s+=st(a,Rs),(i+=Tr(a,Rs))<1?(s--,i+=Rs):i>Rs&&(s++,i-=Rs),[s,i]),year(s){return s.isoYear},month(s){return s.isoMonth},day:(s)=>s.isoDay}),Object.assign({},eo,Ju,{h:lr,ee(s){const i=this.O(s);return[i.era,i.eraYear]},I(s,i){const a=Ja.call(this,s);return[or(i,a),a===i]},N(s,i,a){let[t,r,l]=lr.call(this,{isoYear:Ji,isoMonth:Rs,isoDay:31});const o=Ja.call(this,t),c=r===o;(Qs(s,or(r,o))||Qs(Number(i),Number(c))||Qs(a,l))===1&&t--;for(let d=0;d<100;d++){const f=t-d,m=Ja.call(this,f),p=ka(s,i,m);if(i===(p===m)&&a<=Ko.call(this,f,p))return[f,p]}},K(s){const i=Ua.call(this,s);return i>Ua.call(this,s-1)&&i>Ua.call(this,s+1)},U:Ja,L:_a,J(s,i){const a=i+s,t=Math.sign(s),r=t<0?-1:0;let l=0;for(let o=i;o!==a;o+=t)l+=_a.call(this,o+r);return l},j:Ko,X:Ua,P(s,i,a){return ot(ga.call(this,s,i,a))},q:ga,_(s,i,a){if(a){if(i+=a,!Number.isSafeInteger(i))throw new RangeError($t);if(a<0)for(;i<1;)i+=_a.call(this,--s);else{let t;for(;i>(t=_a.call(this,s));)i-=t,s++}}return[s,i]},year(s){return this.O(s).year},month(s){const{year:i,F:a}=this.O(s),{C:t}=this.B(i);return t[a]+1},day(s){return this.O(s).day}})),ks="numeric",ei=["timeZoneName"],Dm={month:ks,day:ks},ql={year:ks,month:ks},el=Object.assign({},ql,{day:ks}),so={hour:ks,minute:ks,second:ks},io=Object.assign({},el,so),Uu=Object.assign({},io,{timeZoneName:"short"}),_u=Object.keys(ql),Hu=Object.keys(Dm),Bu=Object.keys(el),Gu=Object.keys(so),ao=["dateStyle"],Yu=_u.concat(ao),Xu=Hu.concat(ao),to=Bu.concat(ao,["weekday"]),xa=Gu.concat(["dayPeriod","timeStyle"]),ro=to.concat(xa),Ku=ro.concat(ei),Au=ei.concat(xa),Qu=ei.concat(to),Vu=ei.concat(["day","weekday"],xa),ku=ei.concat(["year","weekday"],xa),qu={},lo=[Mi(ro,io),pt],ym=[Mi(Ku,Uu),pt,0,(s,i)=>{const a=K(s.timeZone);if(i&&K(i.timeZone)!==a)throw new RangeError(Xf);return a}],oo=[Mi(ro,io,ei),ts],co=[Mi(to,el,Au),ts],fo=[Mi(xa,so,Qu),(s)=>es(s)/Is],mo=[Mi(Yu,ql,Vu),ts,1],po=[Mi(Xu,Dm,ku),ts,1],sc;var tg={Instant:lo,PlainDateTime:oo,PlainDate:co,PlainTime:fo,PlainYearMonth:mo,PlainMonthDay:po},rg=Hs(lo),lg=Hs(ym),og=Hs(oo),cg=Hs(co),dg=Hs(fo),fg=Hs(mo),mg=Hs(po),Po={era:mc,eraYear:Pr,year:ba,month:vs,daysInMonth:vs,daysInYear:vs,inLeapYear:lm,monthsInYear:vs},Xt={monthCode:I},wo={day:vs},$m={dayOfWeek:vs,dayOfYear:vs,weekOfYear:pc,yearOfWeek:Pr,daysInWeek:vs},Im=Object.assign({},Po,Xt,wo,$m),Yt=new WeakMap,q=Yt.get.bind(Yt),vm=Yt.set.bind(Yt),pg={...Bt(Po,[Vi]),...Bt($m,[]),...Bt(Xt,[Vi,ki]),...Bt(wo,[ki])},bo=ho(Im),ug=ho({...Po,...Xt}),gg=ho({...Xt,...wo}),Ca={calendarId:(s)=>K(s.calendar)},hg=Ss((s,i)=>function(a){const{i:t}=this;return s(t[i](C(E(a,t))))},Im),Tg=Pa((s)=>(i)=>i[s],S.concat("sign")),Do=Pa((s,i)=>(a)=>a[Zs[i]],Gs),zm={epochSeconds:zc,epochMilliseconds:pt,epochMicroseconds:Cc,epochNanoseconds:Nc},Na=y(gr,new Set(["branding"])),[Pg,aa,wg]=Ns(ki,y(pf,k),{...Ca,...gg},{getISOFields:Na,getCalendar:Ia,with(s,i,a){return aa(af(Ig,s,this,ta(i),a))},equals:(s,i)=>xd(s,Om(i)),toPlainDate(s,i){return C(Mf(Wa,s,this,i))},toLocaleString(s,i,a){const[t,r]=mg(i,a,s);return t.format(r)},toString:_r,toJSON:(s)=>_r(s),valueOf:mi},{from:(s,i)=>aa(Om(s,i))}),Cm={getOffsetNanosecondsFor:Zm,getPossibleInstantsFor(s,i,a){const t=[...i.call(s,V(R(a,O)))].map((l)=>Dg(l).epochNanoseconds),r=t.length;return r>1&&(t.sort(as),Kr(Ps(Ts(t[0],t[r-1])))),t}},go={getOffsetNanosecondsFor:Zm},[bg,os,Dg]=Ns(Jt,of,zm,{add:(s,i)=>os(Ar(0,s,z(i))),subtract:(s,i)=>os(Ar(1,s,z(i))),until:(s,i,a)=>L(Tl(0,s,zs(i),a)),since:(s,i,a)=>L(Tl(1,s,zs(i),a)),round:(s,i)=>os(Ec(s,i)),equals:(s,i)=>Md(s,zs(i)),toZonedDateTime(s,i){const a=Us(i);return J(Zl(s,j(a.timeZone),k(a.calendar)))},toZonedDateTimeISO:(s,i)=>J(Zl(s,j(i))),toLocaleString(s,i,a){const[t,r]=rg(i,a,s);return t.format(r)},toString:(s,i)=>Wr(j,U,s,i),toJSON:(s)=>Wr(j,U,s),valueOf:mi},{from:(s)=>os(zs(s)),fromEpochSeconds:(s)=>os(Zf(s)),fromEpochMilliseconds:(s)=>os(nf(s)),fromEpochMicroseconds:(s)=>os(xf(s)),fromEpochNanoseconds:(s)=>os($f(s)),compare:(s,i)=>ul(zs(s),zs(i))}),[Kt,Fh]=Ns("TimeZone",(s)=>{const i=Sd(s);return{branding:"TimeZone",id:i,o:_t(i)}},{id:(s)=>s.id},{getPossibleInstantsFor:({o:s},i)=>s.getPossibleInstantsFor(ci(i)).map((a)=>os(Y(a))),getOffsetNanosecondsFor:({o:s},i)=>s.getOffsetNanosecondsFor(zs(i).epochNanoseconds),getOffsetStringFor(s,i){const a=zs(i).epochNanoseconds,t=Gt(this,go).getOffsetNanosecondsFor(a);return yi(t)},getPlainDateTimeFor(s,i,a=O){const t=zs(i).epochNanoseconds,r=Gt(this,go).getOffsetNanosecondsFor(t);return V(R(ii(t,r),k(a)))},getInstantFor(s,i,a){const t=ci(i),r=Lr(a),l=Gt(this);return os(Y(us(l,t,r)))},getNextTransition:({o:s},i)=>Fm(1,s,i),getPreviousTransition:({o:s},i)=>Fm(-1,s,i),equals(s,i){return!!Lt(this,j(i))},toString:(s)=>s.id,toJSON:(s)=>s.id},{from(s){const i=j(s);return typeof i=="string"?new Kt(i):i}}),yg=jm(Object.keys(Cm)),[Og,di]=Ns(Et,uf,Do,{getISOFields:Na,with(s,i,a){return di(tf(this,ta(i),a))},add:(s,i)=>di(er(0,s,z(i))),subtract:(s,i)=>di(er(1,s,z(i))),until:(s,i,a)=>L(yl(0,s,oi(i),a)),since:(s,i,a)=>L(yl(1,s,oi(i),a)),round:(s,i)=>di(_c(s,i)),equals:(s,i)=>$d(s,oi(i)),toZonedDateTime:(s,i)=>J(Lf(j,cs,M,s,i)),toPlainDateTime:(s,i)=>V(jf(s,cs(i))),toLocaleString(s,i,a){const[t,r]=dg(i,a,s);return t.format(r)},toString:Hr,toJSON:(s)=>Hr(s),valueOf:mi},{from:(s,i)=>di(oi(s,i)),compare:(s,i)=>Mt(oi(s),oi(i))}),[Fg,fi,Sg]=Ns(Vi,y(mf,k),{...Ca,...ug},{getISOFields:Na,getCalendar:Ia,with(s,i,a){return fi(sf($g,s,this,ta(i),a))},add:(s,i,a)=>fi(qr(Mm,0,s,z(i),a)),subtract:(s,i,a)=>fi(qr(Mm,1,s,z(i),a)),until:(s,i,a)=>L(Dl(Lm,0,s,sa(i),a)),since:(s,i,a)=>L(Dl(Lm,1,s,sa(i),a)),equals:(s,i)=>nd(s,sa(i)),toPlainDate(s,i){return C(vf(Wa,s,this,i))},toLocaleString(s,i,a){const[t,r]=fg(i,a,s);return t.format(r)},toString:Ur,toJSON:(s)=>Ur(s),valueOf:mi},{from:(s,i)=>fi(sa(s,i)),compare:(s,i)=>Si(sa(s),sa(i))}),[vg,V]=Ns(Zi,y(df,k),{...Ca,...bo,...Do},{getISOFields:Na,getCalendar:Ia,with(s,i,a){return V(qd(Wa,s,this,ta(i),a))},withCalendar:(s,i)=>V(xt(s,k(i))),withPlainDate:(s,i)=>V(Nf(s,cs(i))),withPlainTime:(s,i)=>V(Cf(s,To(i))),add:(s,i,a)=>V(Vr(xi,0,s,z(i),a)),subtract:(s,i,a)=>V(Vr(xi,1,s,z(i),a)),until:(s,i,a)=>L(wl(Cs,0,s,ci(i),a)),since:(s,i,a)=>L(wl(Cs,1,s,ci(i),a)),round:(s,i)=>V(Uc(s,i)),equals:(s,i)=>jd(s,ci(i)),toZonedDateTime:(s,i,a)=>J(wf(M,s,j(i),a)),toPlainDate:(s)=>C(E(s)),toPlainTime:(s)=>di(Ls(s)),toPlainYearMonth(s){return fi(bf(At,s,this))},toPlainMonthDay(s){return aa(Df(Vt,s,this))},toLocaleString(s,i,a){const[t,r]=og(i,a,s);return t.format(r)},toString:Er,toJSON:(s)=>Er(s),valueOf:mi},{from:(s,i)=>V(ci(s,i)),compare:(s,i)=>hl(ci(s),ci(i))}),[Mg,C,Nm]=Ns(ji,y(ff,k),{...Ca,...bo},{getISOFields:Na,getCalendar:Ia,with(s,i,a){return C(ed(Wa,s,this,ta(i),a))},withCalendar:(s,i)=>C(xt(s,k(i))),add:(s,i,a)=>C(kr(xi,0,s,z(i),a)),subtract:(s,i,a)=>C(kr(xi,1,s,z(i),a)),until:(s,i,a)=>L(bl(Cs,0,s,cs(i),a)),since:(s,i,a)=>L(bl(Cs,1,s,cs(i),a)),equals:(s,i)=>Zd(s,cs(i)),toZonedDateTime(s,i){const a=!G(i)||i instanceof Kt?{timeZone:i}:i;return J(yf(j,oi,M,s,a))},toPlainDateTime:(s,i)=>V(Of(s,To(i))),toPlainYearMonth(s){return fi(Ff(At,s,this))},toPlainMonthDay(s){return aa(Sf(Vt,s,this))},toLocaleString(s,i,a){const[t,r]=cg(i,a,s);return t.format(r)},toString:Jr,toJSON:(s)=>Jr(s),valueOf:mi},{from:(s,i)=>C(cs(s,i)),compare:(s,i)=>Si(cs(s),cs(i))}),yo={fields(s,i,a){return[...i.call(s,a)]}},Wm=Object.assign({dateFromFields(s,i,a,t){return Nm(i.call(s,Object.assign(Object.create(null),a),t))}},yo),Rm=Object.assign({yearMonthFromFields(s,i,a,t){return Sg(i.call(s,Object.assign(Object.create(null),a),t))}},yo),Em=Object.assign({monthDayFromFields(s,i,a,t){return wg(i.call(s,Object.assign(Object.create(null),a),t))}},yo),Oo={mergeFields(s,i,a,t){return Us(i.call(s,Object.assign(Object.create(null),a),Object.assign(Object.create(null),t)))}},Lg=Object.assign({},Wm,Oo),jg=Object.assign({},Rm,Oo),Zg=Object.assign({},Em,Oo),Fo={dateAdd(s,i,a,t,r){return Nm(i.call(s,C(E(a,s)),L(n(t)),r))}},Jm=Object.assign({},Fo,{dateUntil(s,i,a,t,r,l){return Cg(i.call(s,C(E(a,s)),C(E(t,s)),Object.assign(Object.create(null),l,{largestUnit:La[r]})))}}),ng=Object.assign({},Fo,{day:nm}),xg=Object.assign({},Jm,{day:nm}),At=Ws(Rm),Qt=Ws(Wm),Vt=Ws(Em),$g=Ws(jg),Wa=Ws(Lg),Ig=Ws(Zg),xi=Ws(Fo),Cs=Ws(Jm),Mm=Ws(ng),Lm=Ws(xg),[zg,L,Cg]=Ns(Ut,gf,{...Tg,blank:rd},{with:(s,i)=>L(rf(s,i)),negated:(s)=>L(yt(s)),abs:(s)=>L(td(s)),add:(s,i,a)=>L(rl($a,Cs,M,0,s,z(i),a)),subtract:(s,i,a)=>L(rl($a,Cs,M,1,s,z(i),a)),round:(s,i)=>L(ad($a,Cs,M,s,i)),total:(s,i)=>Rc($a,Cs,M,s,i),toLocaleString(s,i,a){return Intl.DurationFormat?new Intl.DurationFormat(i,a).format(this):Tt(s)},toString:Tt,toJSON:(s)=>Tt(s),valueOf:mi},{from:(s)=>L(z(s)),compare:(s,i,a)=>vd($a,xi,M,z(s),z(i),a)}),Um={toString:(s)=>s.id,toJSON:(s)=>s.id,...pg,dateAdd:({id:s,o:i},a,t,r)=>C(E(i.dateAdd(cs(a),z(t),r),s)),dateUntil:({o:s},i,a,t)=>L(n(s.dateUntil(cs(i),cs(a),Zc(t)))),dateFromFields:({id:s,o:i},a,t)=>C(Sl(i,a,t,fc(s))),yearMonthFromFields:({id:s,o:i},a,t)=>fi(vl(i,a,t,cc(s))),monthDayFromFields:({id:s,o:i},a,t)=>aa(Ml(i,0,a,t,dc(s))),fields({o:s},i){const a=new Set(js),t=[];for(let r of i){if(I(r),!a.has(r))throw new RangeError(Cl(r));a.delete(r),t.push(r)}return s.fields(t)},mergeFields:({o:s},i,a)=>s.mergeFields(hr(wr(i)),hr(wr(a)))},[So]=Ns("Calendar",(s)=>{const i=Jd(s);return{branding:"Calendar",id:i,o:qi(i)}},{id:(s)=>s.id},Um,{from(s){const i=k(s);return typeof i=="string"?new So(i):i}}),Ng=jm(Object.keys(Um).slice(4)),[Wg,J]=Ns(Ys,y(cf,k,j),{...zm,...Ca,...Sm(bo),...Sm(Do),offset:(s)=>yi(uo(s).offsetNanoseconds),offsetNanoseconds:(s)=>uo(s).offsetNanoseconds,timeZoneId:(s)=>K(s.timeZone),hoursInDay:(s)=>Hc(M,s)},{getISOFields:(s)=>sd(U,s),getCalendar:Ia,getTimeZone:({timeZone:s})=>typeof s=="string"?new Kt(s):s,with(s,i,a){return J(kd(Wa,M,s,this,ta(i),a))},withCalendar:(s,i)=>J(xt(s,k(i))),withTimeZone:(s,i)=>J(Wf(s,j(i))),withPlainDate:(s,i)=>J(zf(M,s,cs(i))),withPlainTime:(s,i)=>J(If(M,s,To(i))),add:(s,i,a)=>J(Qr(xi,M,0,s,z(i),a)),subtract:(s,i,a)=>J(Qr(xi,M,1,s,z(i),a)),until:(s,i,a)=>L(n(Pl(Cs,M,0,s,ia(i),a))),since:(s,i,a)=>L(n(Pl(Cs,M,1,s,ia(i),a))),round:(s,i)=>J(Jc(M,s,i)),startOfDay:(s)=>J(Bc(M,s)),equals:(s,i)=>Ld(s,ia(i)),toInstant:(s)=>os(hf(s)),toPlainDateTime:(s)=>V(nl(U,s)),toPlainDate:(s)=>C(xl(U,s)),toPlainTime:(s)=>di($l(U,s)),toPlainYearMonth(s){return fi(Tf(At,s,this))},toPlainMonthDay(s){return aa(Pf(Vt,s,this))},toLocaleString(s,i,a={}){const[t,r]=lg(i,a,s);return t.format(r)},toString:(s,i)=>Rr(U,s,i),toJSON:(s)=>Rr(U,s),valueOf:mi},{from:(s,i)=>J(ia(s,i)),compare:(s,i)=>gl(ia(s),ia(i))}),Rg=Object.defineProperties({},{...ea("Temporal.Now"),...wi({timeZoneId:()=>Bs(),instant:()=>os(Y(Sa())),zonedDateTime:(s,i=Bs())=>J(Q(Sa(),j(i),k(s))),zonedDateTimeISO:(s=Bs())=>J(Q(Sa(),j(s),O)),plainDateTime:(s,i=Bs())=>V(R(Ai(U(j(i))),k(s))),plainDateTimeISO:(s=Bs())=>V(R(Ai(U(j(s))),O)),plainDate:(s,i=Bs())=>C(E(Ai(U(j(i))),k(s))),plainDateISO:(s=Bs())=>C(E(Ai(U(j(s))),O)),plainTimeISO:(s=Bs())=>di(Ls(Ai(U(j(s)))))})}),Xs=Object.defineProperties({},{...ea("Temporal"),...wi({PlainYearMonth:Fg,PlainMonthDay:Pg,PlainDate:Mg,PlainTime:Og,PlainDateTime:vg,ZonedDateTime:Wg,Instant:bg,Calendar:So,TimeZone:Kt,Duration:zg,Now:Rg})}),Eg=eu(),vo=new WeakMap,Jg=Object.defineProperties(Object.create(Intl),wi({DateTimeFormat:Eg}));class $i extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class Mo{createSession(){throw new $i}deleteSession(){throw new $i}findSession(){throw new $i}findUserByEmailAddress(){throw new $i}updateSession(){throw new $i}createUser(){throw new $i}}class Ym extends e{schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class Xm extends e{schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Km extends e{schema={email:{required:"Email is required",email:"Invalid email"}}}class Am extends e{schema={password:{required:"Password is required",password:"Invalid password"}}}class Ks extends _m{provider=oa.use().provider;async me(){const s=await As.user();if(!s)throw new Gm;return s}async verifyEmail(s=new e){const i=await s.input(),a=await this.provider.adapter.findUserByVerificationToken(i.get("token"));if(!a)return{email:null};if(await this.provider.adapter.verifyUser(a.id),a)return{email:a.email};return{email:null}}async signIn(s=new Ym){const i=await s.input.call(s),{email:a,password:t}=i.toJSON(),r=await this.provider.adapter.findUserByEmailAddress(a,this.provider.verifyEmail);if(!r)throw new pi({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(t,r.password))throw new pi({invalid_credentials:["Invalid credentials"]});const o=s.headers.get("User-Agent"),c=new Bun.CryptoHasher("sha256");c.update(`${r.email}${o}`);const d=c.digest("hex");let f=await this.provider.adapter.findSession({token:d,userAgent:s.headers.get("User-Agent")});if(!f)f=await this.provider.adapter.createSession({token:d,userId:r.id,userAgent:s.headers.get("User-Agent"),expiresAt:new Date(Xs.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(Xs.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else f=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(Xs.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return s.ctx.setCookie("access_token",f.token,{expires:f.expiresAt}),await this.provider.onSignIn(r),r}async signUp(s=new Xm){const i=await s.input(),{email:a,password:t,name:r,invitationId:l}=i.toJSON();if(await this.provider.adapter.findUserByEmailAddress(a,!1))throw new pi({email:["Email address already exists"]});const c=await this.provider.hashPassword(t),d=gi.use().detectLocale(s);let f;if(l){if(f=await this.provider.adapter.findInvitation(l,a),f)await this.provider.adapter.deleteInvitationById(l)}let m,p;if(f)m=await this.provider.adapter.createUser({email:a,name:r,password:c,emailVerifiedAt:new Date,locale:d}),await this.provider.adapter.createAccount({organizationId:f.organizationId,userId:m.id,organizationRole:f.role});else p=await this.provider.generateEmailVerificationToken(a),m=await this.provider.adapter.createUser({email:a,name:r,password:c,verificationToken:p,locale:d});return await this.provider.onSignUp(m,p),m}async signOut(s=new e){const i=s.cookies.get("access_token"),a=await As.user();return await this.provider.adapter.deleteSession({token:i}),s.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(a),{}}async forgotPassword(s=new Km){const i=await s.input(),{email:a}=i.toJSON(),t=await this.provider.adapter.findUserByEmailAddress(a,this.provider.verifyEmail);if(!t)return{};const r=await this.provider.generateForgotPasswordToken(t);return await this.provider.adapter.createPasswordResetToken({user:t,token:r}),await this.provider.onForgotPassword(t,r),{}}async resetPassword(s=new Am){const i=await s.input(),{password:a,token:t}=i.toJSON(),r=await this.provider.adapter.findPasswordResetToken({token:t});if(!r)throw new pi({token:["Invalid token"]});if(Xs.Instant.from(r.createdAt.toISOString()).add({hours:24}).until(Xs.Now.instant()).sign>=0)throw new pi({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:t});const o=await this.provider.adapter.findUserByEmailAddress(r.user.email,this.provider.verifyEmail);if(!o)throw new pi({email:["User not found"]});const c=await this.provider.hashPassword(a);return await this.provider.adapter.updateUserPassword({id:o.id,password:c}),await this.provider.adapter.deleteAllUserSessions(o.id),await this.provider.onResetPassword(o),{}}async changePassword(s=new e){const i=await As.user(),a=await s.input(),{oldPassword:t,newPassword:r}=a.toJSON(),{password:l}=await this.provider.adapter.findUserByEmailAddress(i.email,this.provider.verifyEmail);if(!await this.provider.verifyPassword(t,l))throw new pi({oldPassword:["Incorrect password"]});const c=await this.provider.hashPassword(r);return await this.provider.adapter.updateUserPassword({id:i.id,password:c}),await this.provider.adapter.deleteAllUserSessions(i.id),{}}}class Lo extends zi{routes={"/sign-in":this.post(Ks,"signIn"),"/sign-up":this.post(Ks,"signUp"),"/sign-out":this.post(Ks,"signOut"),"/forgot-password":this.post(Ks,"forgotPassword"),"/reset-password":this.post(Ks,"resetPassword"),"/change-password":this.post(Ks,"changePassword"),"/verify-email":this.post(Ks,"verifyEmail"),"/me":this.get(Ks,"me")}}class Ug extends Hm{routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class _g extends Bm{basePath="/auth";verifyEmail=!0;sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new Mo;boot(){}async verifyPassword(s,i){return await Bun.password.verify(s,i)}async hashPassword(s){return await Bun.password.hash(s)}async generateForgotPasswordToken(s){const i=new Bun.CryptoHasher("sha256");return i.update(`${s.email}${Date.now()}`),i.digest("hex")}generateEmailVerificationToken(s){if(!this.verifyEmail)return"";const i=new Bun.CryptoHasher("sha256");return i.update(`${s}${Date.now()}`),i.digest("hex")}extendSession(s){return{}}onSignUp(s,i){}onSignIn(s){}onSignOut(s){}onForgotPassword(s,i){}onResetPassword(s){}}import{mkdir as Hg,exists as Bg,readdir as Gg}from"fs/promises";class bs extends hs{s;_name="LoggingServiceContainer";writer;isReady=!1;logsDirPath=`${process.env.ROOT_DIR}/storage/logs`;flushTimeout;fileSize=0;writerSize=0;isCreatingFile=!1;currentLogFilePath;constructor(s){super();this.service=s;this.boot().then(()=>{this.isReady=!0})}async boot(){if(!process.env.ROOT_DIR)return;if(!await Bg(this.logsDirPath))await Hg(this.logsDirPath);this.newLogFile()}async newLogFile(){if(this.isCreatingFile=!0,this.currentLogFilePath){this.writer.flush(),this.writer.end(),this.writer=null;const a=new File([await Bun.file(this.currentLogFilePath).arrayBuffer()],this.currentLogFilePath.split("/").pop(),{type:"text/plain"});this.service.onLogFileClosed(a),this.fileSize=0,this.writerSize=0}const i=(await Gg(this.logsDirPath)).sort().reverse()[0];if(i){const a=Bun.file(`${this.logsDirPath}/${i}`);if(a.size<this.service.maxFileSize)this.currentLogFilePath=`${this.logsDirPath}/${i}`,this.writer=a.writer(),this.writer.write(await a.text()),this.writer.write("\n"),this.writer.flush(),this.fileSize=a.size}if(!this.writer){const a=`${new Date(Date.now()).toISOString()}.log`.replaceAll(":","-");this.currentLogFilePath=`${this.logsDirPath}/${a}`;const t=Bun.file(`${this.logsDirPath}/${a}`);this.writer=t.writer(),this.fileSize=0,this.writerSize=0}this.isCreatingFile=!1}async log(s,i,a={}){if(!this.isReady)await new Promise((c)=>{const d=setInterval(()=>{if(this.isReady)c({}),clearInterval(d)},100)});const t=H.getStore();let r={};if(t)r={url:t.req.rawRequest.url,method:t.req.rawRequest.method,headers:t.req.rawRequest.headers,body:t.req.rawRequest.body};const l={timestamp:new Date(Date.now()).toISOString(),env:"production",level:s,message:i,metadata:{...r,...a}};let o="";try{o=JSON.stringify(l)}catch(c){throw new Error("Metadata must be a valid JSON object")}this.writerSize+=o.length,this.fileSize+=o.length,this.writer.write(o),this.writer.write("\n"),kt.channel("/logs/live",{}).publish(JSON.stringify(l)),this.service.onLogCreated(l),this.tryFlush()}async tryFlush(){if(this.fileSize>this.service.maxFileSize){if(!this.isCreatingFile)await this.newLogFile()}if(this.writerSize>this.service.maxFileSize/2)await this.writer.flush(),this.writerSize=0,await this.newLogFile();else clearTimeout(this.flushTimeout),this.flushTimeout=setTimeout(async()=>{await this.writer.flush(),this.writerSize=0},100)}}class jo extends zi{routes={"/live":this.get(async()=>{const s=Bun.file(bs.use().currentLogFilePath);return new Response(await s.text(),{headers:{"Content-Type":"text/plain"}})})}}function Yg(s){const i=new Map;for(let a of s)if(typeof a==="string"){const[t,r=""]=a.split(":");if(t.startsWith("-")){if(i.has(t.replace("-","")))i.delete(t.replace("-",""))}else i.set(t,r.split(","))}else i.set(a,[]);return i}class Zo extends hs{s;static _name="MiddlewareServiceContainer";constructor(s){super();this.service=s}runMiddleware(s,i){const a=H.getStore().req;return Array.from(Yg(s).entries()).map(([t,r])=>{if(typeof t==="string"){const l=this.service.aliases[t];if(l){const o=new l(i);return(c)=>o.run.call(o,c,...r)}}else{if(Qm(t)){const l=new t(i);return l.run.bind(l)}return t}}).filter(Boolean).reduce((t,r)=>{return async(l,o)=>{return{...await t(l,o),...await r(l,o)}}},(t)=>Promise.resolve({}))(a)}}function Vm(s){return s.replace(/-([a-z])/g,(i)=>i[1].toUpperCase())}function Xg(s){if("__brand"in s)return s.__brand==="ApiRouter";return!1}function no(s,i=""){const a={};for(let[t,r]of Object.entries(s))if("run"in r){const l=r;if(!a[t])a[t]={};const{method:o,middlewares:c}=l,d=l.run.bind(l);a[t][o]={exec:d,middleware:c}}else if(typeof r==="function"){let l={},o=[];if(Xg(r)){const d=new r;l=d.routes,o=[d.middleware,...d.middlewares]}else{const[d]=(t==="/"?i:t).split("/").reverse();if(d==="")throw new Error(`"${t}" is not valid for a resource route`);if(d.includes(":"))throw new Error(`Last segment of a resource route has to be static. See "${t}"`);l=r(`${Vm(d)}Id`)}const c=no(l,t);for(let[d,f]of Object.entries(c)){const m=d==="/"?"":d,p=t==="/"?"":t,u=`${p}${m}`===""?"/":`${p}${m}`;if(!a[u])a[u]={};for(let[g,h]of Object.entries(f))a[u][g]={exec:h.exec,middleware:[...o,...h.middleware]}}}else for(let l of Object.values(r)){if(!a[t])a[t]={};const{method:o,middlewares:c}=l,d=l.run.bind(l);a[t][o]={exec:d,middleware:c}}return Object.fromEntries(Object.entries(a).sort(([t],[r])=>{const l=t.split("/").length+t.split(":").length,o=r.split("/").length+r.split(":").length;return l-o}))}class $o extends hs{s;static _name="ApiRouterServiceContainer";flatRoutes={};constructor(s){super();this.service=s;this.flatRoutes=no({"/":this.service.rootRouter.bind(this.service),"/auth":Lo,"/__gemi__/services/i18n":et,"/__gemi__/services/logs":jo})}getRouteHandlerAndParams(s){const a=new URL(s.url).pathname.replace("/api","");let t={},r;for(let[l]of Object.entries(this.flatRoutes))try{const o=new URLPattern({pathname:l});if(o.test({pathname:a})){r=l,t=o.exec({pathname:a})?.pathname.groups;break}}catch(o){console.error(o)}return{params:t,path:r}}async runRouteMiddleware(s){const i=H.getStore(),t=this.flatRoutes[s][i.req.rawRequest.method].middleware;try{await Zo.use().runMiddleware(t,s)}catch(r){if(r.kind===xo){if(i.req.rawRequest.url.includes("/api")){const{status:l=400,data:o,headers:c}=r.payload.api;return new Response(JSON.stringify(o),{status:l,headers:{"Content-Type":"application/json",...c}})}}else throw this.service.onRequestFail(i.req,r),console.error(r),r}}async getRouteData(s){const i=this.flatRoutes[s],a=H.getStore(),t=i[a.req.rawRequest.method].exec??(()=>Promise.resolve({}));let r={};try{r=await t()}catch(l){if(l.kind===xo){const{status:o=400,data:c,headers:d}=l.payload.api;return new Response(JSON.stringify(c),{status:o,headers:{"Content-Type":"application/json",...d}})}else throw this.service.onRequestFail(a.req,l),console.error(l),l}return r}async handleApiRequest(s){const{params:i,path:a}=this.getRouteHandlerAndParams(s),t=this.flatRoutes[a];if(!t||!t[s.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});const r=new e(s,i,"api");if(!s.url.includes("/__gemi__"))this.service.onRequestStart(r);return await H.run(r,async()=>{const l=await this.runRouteMiddleware(a);if(l instanceof Response)return l;const o=await this.getRouteData(a);if(o instanceof Response)return o;const c=H.getStore(),d=c.headers;if(d.append("Content-Type","application/json"),!d.get("Cache-Control"))if(c.user)d.set("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else d.set("Cache-Control","public, no-cache, no-store, max-age=0, must-revalidate");if(c.cookies.forEach((f)=>d.append("Set-Cookie",f.toString())),c.destroy(),!s.url.includes("/__gemi__"))this.service.onRequestEnd(r);return new Response(JSON.stringify(o),{headers:d})})}}class qt{static prepare(s,...i){const a={params:{},search:{}},[t={}]=i,{search:r,params:l}={...a,...t},o=H.getStore();if(o.req.kind==="api")throw new Error("Query.prefetch() cannot be called from an API request");const c=o.req.rawRequest,d=new URL(c.url),f=new URLSearchParams(Jo(r));f.delete("json"),f.sort();const m=[`${ns(s,l)}`,f.toString()].filter((P)=>P.length>0).join("?"),p=`${d.origin}/${m}`,u=new Request(p,{headers:c.headers}),g=new e(u,l),h=(P)=>{o.prefetchedResources.set(ns(s,l),{[f.toString()]:P})},T=()=>{return H.run(g,async()=>{const P=await $o.use().getRouteData(s);return h(P),P})};return{instant:T,prefetch:()=>{o.prefetchPromiseQueue.add(T)}}}static instant(s,...i){return qt.prepare(s,...i).instant()}static prefetch(s,...i){return qt.prepare(s,...i).prefetch()}}class kt{static channel(s,i){const a=Ii.use().service.channels[s];if(!a)throw new Error(`Channel ${s} not found`);const t=new a;return{publish:(r,l=!1)=>{const o=ns(s,i);Ii.use().publish(o,JSON.stringify({topic:o,data:t.publish(r)}),l)}}}}class km{static absolute(s,...i){return`${process.env.HOST_NAME}${ns(String(s),i[0]??{})}`}static relative(s,...i){return ns(String(s),i[0]??{})}}class qm{static debug(s,i){bs.use().log("debug",s,i)}static info(s,i){bs.use().log("info",s,i)}static notice(s,i){bs.use().log("notice",s,i)}static warning(s,i){bs.use().log("warning",s,i)}static error(s,i){bs.use().log("error",s,i)}static critical(s,i){bs.use().log("critical",s,i)}static alert(s,i){bs.use().log("alert",s,i)}static emergency(s,i){bs.use().log("emergency",s,i)}}export{km as Url,Co as Redirect,qt as Query,qm as Log,Wo as I18n,Eo as FileStorage,kt as Broadcast,As as Auth};export{Ii as p,gi as q,ca as r,bs as s,Ug as t,_g as u,Zo as v,$o as w};
2
+ import{m as Bm,n as Qm,o as zs,p as Rm,q as $o,r as Io,s as ps,t as ci,u as R,w as Gm,x as Ea,y as oa}from"../http/index.js";import{D as ap}from"../chunk-jtv3vbyw.js";import{Ib as Hm}from"../chunk-sdejryyp.js";import{Kb as hi}from"../chunk-tmp6k3re.js";import{Mb as sp}from"../chunk-2srb036m.js";import{AsyncLocalStorage as ip}from"async_hooks";class Is extends hi{i;static _name="BroadcastingServiceContainer";publishCb;context=new ip;constructor(i){super();this.service=i}onPublish(i){this.publishCb=i}publish(...i){let[s,a,t]=i;this.publishCb(s,a,t)}async handleMessage(i,s){let a=JSON.parse(s);if(a.type==="subscribe"){let t=Object.entries(this.service.channels).sort(([r],[l])=>r.length-l.length);for(let[r,l]of t){let o=new URLPattern({pathname:r});if(o.test({pathname:a.topic})){let c=o.exec({pathname:a.topic})?.pathname.groups,d=new l;if(await d.subscribe.call(d,c))i.subscribe(a.topic);break}}}if(a.type==="broadcast")i.publish(a.topic,JSON.stringify({topic:a.topic,data:a.payload}));if(a.type==="unsubscribe")i.unsubscribe(a.topic)}run(i,s){let a=i.get("Cookie"),t=new Map;if(a){let r=a.split(";");for(let l of r){let[o,c]=l.split("=");t.set(o.trim(),c.trim())}}this.context.run({headers:i,cookies:t},s)}}class Ai{static async user(){let i=ci.getStore(),s=Is.use().context.getStore(),a="",t="";if(i?.req)a=i.req.cookies.get("access_token"),t=i.req.headers.get("User-Agent");if(s?.cookies)t=s.headers.get("User-Agent"),a=s.cookies.get("access_token");let r=i?.user;if(!r)r=(await oa.use().getSession(a,t))?.user,i?.setUser(r);if(r)return r;return null}static async guard(i){let s=await Ai.user();if(!s)throw new Ea;try{if(!await i(s))throw new Ea}catch(a){throw new Ea}}static async guardSafe(i){let s=await Ai.user();if(!s)return!1;try{return await i(s)}catch(a){return!1}}}function xi(i,s){return i.replace(/:([^/]+)/g,(a,t)=>{let r=t.endsWith("?"),l=r?t.slice(0,-1):t,o=s[l];if(o===void 0){if(r)return"";throw new Error(`Missing parameter: ${l}`)}return String(o)}).replace(/\/\//g,"/")}class zo extends Io{constructor(i){super("Redirect error");this.name="RedirectError",this.payload={api:{status:200,data:{},directive:{kind:"Redirect",path:i}},view:{status:302,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:i}}}}}class Co{static to(i,...s){let[a={}]=s;throw new zo(xi(i,a))}}class et extends zs{middlewares=["cache:private"];routes={"/translations":this.get(async()=>{let i=new R,{scope:s,locale:a}=i.search.toJSON(),t=a??gs.use().detectLocale(i),r=gs.use().getPageTranslations(t,s);return i.ctx.setCookie("i18n-locale",t,{expires:new Date(Date.now()+31536000000)}),{[t]:r}})}}class gs extends hi{i;static _name="I18nServiceContainer";isEnabled=!1;translations=new Map;supportedLocales=[];constructor(i){super();this.service=i;let s=new Map;for(let[t,r]of Object.entries(this.service.dictionary))for(let[l,o]of Object.entries(r))for(let[c,d]of Object.entries(o)){let f=c==="default"?this.service.defaultLocale:c;if(!s.has(`${f}.${t}`))s.set(`${f}.${t}`,new Map);s.get(`${f}.${t}`)?.set(l,d),this.isEnabled=!0}let a=new Set(i.supportedLocales);for(let[t,r]of s.entries()){this.translations.set(t,Object.fromEntries(r.entries()));let[l]=t.split(".");if(!a.has(l))a.add(l)}this.supportedLocales=Array.from(a)}detectLocale(i){let s=this.service.detectLocale(i);if(this.supportedLocales.includes(s))return s;let t=i.cookies.get("i18n-locale")??(i.headers.get("accept-language")||"en-US"),[r]=t.split(","),l=r.length===2?`${r}-${r.toUpperCase()}`:r;if(this.supportedLocales.includes(l))return l;let o=this.service.defaultLocale??this.supportedLocales[0];if(o)return o;return"en-US"}getPageTranslations(i,s){if(!s)return{};let a=this.translations.get(`${i}.view:${s}`)??{},t={[`view:${s}`]:a};for(let[r]of this.translations.entries()){let l=r.split(".")[1];if(!l.startsWith("layout:"))continue;let o=l.split(":")[1];if(s?.startsWith(o))t[l]=this.translations.get(`${i}.${l}`)??{}}return t}}function No(i,s){return i.replace(/{{([^}]+)}}/g,(a,t)=>{let r=s[t];if(r===void 0)throw new Error(`Missing parameter: ${t}`);return r})}class Wo{static scope(i){return i}static translate(i,...s){let a=gs.use(),t=a.detectLocale(ci.getStore().req),r=a.translations.get(`${t}.server`)?.[i];if(!r)return i;return No(r,s[0])}}var Eo=sp(ap(),1);import{Buffer as tp}from"buffer";class ca extends hi{i;static _name="FileStorageServiceContainer";constructor(i){super();this.service=i}}class Jo{static async put(i){return ca.use().service.driver.put(i)}static async metadata(i){let s=tp.from(await i.arrayBuffer());try{return await Eo.default(s).metadata()}catch{return{}}}static async fetch(i){return ca.use().service.driver.fetch(i)}static list(i){return ca.use().service.driver.list(i)}static delete(){}}function Uo(i){return Object.fromEntries(Object.entries(i).filter(([,s])=>{return s!==null&&s!==void 0}))}function di(i,s,a,t,r){return Di(s,sc(i,s),a,t,r)}function Di(i,s,a,t,r,l){let o=rr(s,a,t);if(r&&s!==o)throw new RangeError(Uf(i,s,a,t,l));return o}function sc(i,s){let a=i[s];if(a===void 0)throw new TypeError(zl(s));return a}function G(i){return i!==null&&/object|function/.test(typeof i)}function pi(i,s=Map){let a=new s;return(t,...r)=>{if(a.has(t))return a.get(t);let l=i(t,...r);return a.set(t,l),l}}function ur(i){return ws({name:i},1)}function ws(i,s){return Si((a)=>({value:a,configurable:1,writable:!s}),i)}function ac(i){return Si((s)=>({get:s,configurable:1}),i)}function ea(i){return{[Symbol.toStringTag]:{value:i,configurable:1}}}function _s(i,s){let a={},t=i.length;for(let r of s)a[i[--t]]=r;return a}function Si(i,s,a){let t={};for(let r in s)t[r]=i(s[r],r,a);return t}function Pa(i,s,a){let t={};for(let r=0;r<s.length;r++){let l=s[r];t[l]=i(l,r,a)}return t}function rp(i,s,a){let t={};for(let r=0;r<i.length;r++)t[s[r]]=a[i[r]];return t}function gi(i,s){let a={};for(let t of i)a[t]=s[t];return a}function gr(i,s){let a={};for(let t in s)i.has(t)||(a[t]=s[t]);return a}function hr(i){i={...i};let s=Object.keys(i);for(let a of s)i[a]===void 0&&delete i[a];return i}function tc(i,s){for(let a of s)if(!(a in i))return 0;return 1}function rc(i,s,a){for(let t of i)if(s[t]!==a[t])return 0;return 1}function lc(i,s,a){let t={...a};for(let r=0;r<s;r++)t[i[r]]=0;return t}function O(i,...s){return(...a)=>i(...s,...a)}function _o(i){return i[0].toUpperCase()+i.substring(1)}function wa(i){return i.slice().sort()}function Ga(i,s){return String(s).padStart(i,"0")}function Qi(i,s){return Math.sign(i-s)}function rr(i,s,a){return Math.min(Math.max(i,s),a)}function Ji(i,s){return[Math.floor(i/s),fa(i,s)]}function fa(i,s){return(i%s+s)%s}function qi(i,s){return[it(i,s),Tr(i,s)]}function it(i,s){return Math.trunc(i/s)||0}function Tr(i,s){return i%s||0}function Ja(i){return Math.abs(i%1)===0.5}function oc(i,s,a){let t=0,r=0;for(let c=0;c<=s;c++){let d=i[a[c]],f=ni[c],m=v/f,[p,u]=qi(d,m);t+=u*f,r+=p}let[l,o]=qi(t,v);return[r+l,o]}function st(i,s,a){let t={};for(let r=s;r>=0;r--){let l=ni[r];t[a[r]]=it(i,l),i=Tr(i,l)}return t}function cc(i){return i===y?Nt:[]}function dc(i){return i===y?ja:[]}function fc(i){return i===y?["year","day"]:[]}function mc(i){if(i!==void 0)return I(i)}function pc(i){if(i!==void 0)return vi(i)}function Pr(i){if(i!==void 0)return ba(i)}function vi(i){return hc(ba(i))}function ba(i){return gc(Qp(i))}function wr(i){if(i==null)throw new TypeError("Cannot be null or undefined");return i}function uc(i,s){if(s==null)throw new RangeError(zl(i));return s}function _i(i){if(!G(i))throw new TypeError(Jf);return i}function at(i,s,a=i){if(typeof s!==i)throw new TypeError(va(a,s));return s}function gc(i,s="number"){if(!Number.isInteger(i))throw new RangeError(Op(s,i));return i||0}function hc(i,s="number"){if(i<=0)throw new RangeError(yp(s,i));return i}function br(i){if(typeof i=="symbol")throw new TypeError(Mp);return String(i)}function Ya(i,s){return G(i)?String(i):I(i,s)}function tt(i){if(typeof i=="string")return BigInt(i);if(typeof i!="bigint")throw new TypeError(vp(i));return i}function Tc(i,s="number"){if(typeof i=="bigint")throw new TypeError(Sp(s));if(i=Number(i),!Number.isFinite(i))throw new RangeError(Fp(s,i));return i}function e(i,s){return Math.trunc(Tc(i,s))||0}function Pc(i,s){return gc(Tc(i,s),s)}function Bo(i,s){return hc(e(i,s),s)}function Dr(i,s){let[a,t]=qi(s,v),r=i+a,l=Math.sign(r);return l&&l===-Math.sign(t)&&(r-=l,t+=l*v),[r,t]}function Ns(i,s,a=1){return Dr(i[0]+s[0]*a,i[1]+s[1]*a)}function Ws(i,s){return Dr(i[0],i[1]+s)}function Ti(i,s){return Ns(s,i,-1)}function si(i,s){return Qi(i[0],s[0])||Qi(i[1],s[1])}function wc(i,s,a){return si(i,s)===-1||si(i,a)===1}function rt(i,s=1){let a=BigInt(v/s);return[Number(i/a),Number(i%a)*s]}function Es(i,s=1){let a=v/s,[t,r]=qi(i,a);return[t,r*s]}function bc(i,s=1){let[a,t]=i,r=Math.floor(t/s),l=v/s;return BigInt(a)*BigInt(l)+BigInt(r)}function Pi(i,s=1,a){let[t,r]=i,[l,o]=qi(r,s);return t*(v/s)+(l+(a?o/s:0))}function Or(i,s,a=Ji){let[t,r]=i,[l,o]=a(r,s);return[t*(v/s)+l,o]}function yr(i,s){let a=i.formatToParts(s),t={};for(let r of a)t[r.type]=r.value;return t}function Fr(i){return di(i,"isoYear",Ta,ha,1),i.isoYear===Ta?di(i,"isoMonth",4,12,1):i.isoYear===ha&&di(i,"isoMonth",1,9,1),i}function Vi(i){return Bi({...i,...Fi,isoHour:12}),i}function Bi(i){let s=di(i,"isoYear",Ta,ha,1),a=s===Ta?1:s===ha?-1:0;return a&&wi(ii({...i,isoDay:i.isoDay+a,isoNanosecond:i.isoNanosecond-a})),i}function wi(i){if(!i||wc(i,au,su))throw new RangeError(nt);return i}function ei(i){return oc(i,5,Zi)[1]}function lt(i){let[s,a]=Ji(i,v);return[st(a,5,Zi),s]}function Dc(i){return Oc(i)[0]}function Oc(i){return Or(i,yi)}function ai(i){return Bs(i.isoYear,i.isoMonth,i.isoDay,i.isoHour,i.isoMinute,i.isoSecond,i.isoMillisecond)}function ii(i){let s=ai(i);if(s!==void 0){let[a,t]=qi(s,mi);return[a,t*Ii+(i.isoMicrosecond||0)*Ls+(i.isoNanosecond||0)]}}function Sr(i,s){let[a,t]=lt(ei(i)-s);return wi(ii({...i,isoDay:i.isoDay+t,...a}))}function Xa(...i){return Bs(...i)/Vf}function Bs(...i){let[s,a]=yc(...i),t=s.valueOf();if(!isNaN(t))return t-a*mi}function yc(i,s=1,a=1,t=0,r=0,l=0,o=0){let c=i===Ta?1:i===ha?-1:0,d=new Date;return d.setUTCHours(t,r,l,o),d.setUTCFullYear(i,s-1,a+c),[d,c]}function ss(i,s){let[a,t]=Ws(i,s);t<0&&(t+=v,a-=1);let[r,l]=Ji(t,Ii),[o,c]=Ji(l,Ls);return ot(a*mi+r,o,c)}function ot(i,s=0,a=0){let t=Math.ceil(Math.max(0,Math.abs(i)-iu)/mi)*Math.sign(i),r=new Date(i-t*mi);return _s(Et,[r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate()+t,r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds(),s,a])}function Fc(i){return[i.isoYear,i.isoMonth,i.isoDay]}function Sc(){return Ei}function vr(i,s){switch(s){case 2:return Mr(i)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function vc(i){return Mr(i)?366:365}function Mr(i){return i%4==0&&(i%100!=0||i%400==0)}function Mc(i){let[s,a]=yc(i.isoYear,i.isoMonth,i.isoDay);return fa(s.getUTCDay()-a,7)||7}function Lc({isoYear:i}){return i<1?["bce",1-i]:["ce",i]}function lp(i){let s=ai(i);if(s<ru)return Lc(i);let a=yr(kl(Js),s),{era:t,eraYear:r}=Ed(a,Js);return[t,r]}function ct(i){return bs(i),dt(i,1),i}function bs(i){return jc(i,1),i}function Ro(i){return rc(Hl,i,jc(i))}function jc(i,s){let{isoYear:a}=i,t=di(i,"isoMonth",1,Sc(),s);return{isoYear:a,isoMonth:t,isoDay:di(i,"isoDay",1,vr(a,t),s)}}function dt(i,s){return _s(Zi,[di(i,"isoHour",0,23,s),di(i,"isoMinute",0,59,s),di(i,"isoSecond",0,59,s),di(i,"isoMillisecond",0,999,s),di(i,"isoMicrosecond",0,999,s),di(i,"isoNanosecond",0,999,s)])}function F(i){return i===void 0?0:gm(_i(i))}function Da(i,s=0){i=Mi(i);let a=hm(i),t=hu(i,s);return[gm(i),t,a]}function Lr(i){return hm(Mi(i))}function Zc(i){return i=Mi(i),Xl(i,9,6,1)}function Rs(i,s,a,t=9,r=0,l=4){s=Mi(s);let o=Xl(s,t,r),c=xr(s),d=xa(s,l),f=Za(s,t,r,1);return o==null?o=Math.max(a,f):Ic(o,f),c=$r(c,f,1),i&&(d=((m)=>m<4?(m+2)%4:m)(d)),[o,f,c,d]}function ft(i,s=6,a){let t=xr(i=nr(i,qa)),r=xa(i,7),l=Za(i,s);return l=uc(qa,l),t=$r(t,l,void 0,a),[l,t,r]}function jr(i){return Kl(Mi(i))}function xc(i,s){return Zr(Mi(i),s)}function Zr(i,s=4){let a=nc(i);return[xa(i,4),...$c(Za(i,s),a)]}function $c(i,s){return i!=null?[ni[i],i<4?9-3*i:-1]:[s===void 0?1:10**(9-s),s]}function xr(i){let s=i[ma];return s===void 0?1:e(s,ma)}function $r(i,s,a,t){let r=t?v:ni[s+1];if(r){let l=ni[s];if(r%((i=Di(ma,i,1,r/l-(t?0:1),1))*l))throw new RangeError(va(ma,i))}else i=Di(ma,i,1,a?1e9:1,1);return i}function nc(i){let s=i[tr];if(s!==void 0){if(typeof s!="number"){if(br(s)==="auto")return;throw new RangeError(va(tr,s))}s=Di(tr,Math.floor(s),0,9,1)}return s}function Mi(i){return i===void 0?{}:_i(i)}function nr(i,s){return typeof i=="string"?{[s]:i}:_i(i)}function W(i){if(i!==void 0){if(G(i))return Object.assign(Object.create(null),i);throw new TypeError(Jf)}}function mt(i,s){return i&&Object.assign(Object.create(null),i,{overflow:ou[s]})}function Ir(i,s,a=9,t=0,r){let l=s[i];if(l===void 0)return r?t:void 0;if(l=br(l),l==="auto")return r?t:null;let o=dr[l];if(o===void 0&&(o=qp[l]),o===void 0)throw new RangeError(Rf(i,l,dr));return Di(i,o,t,a,1,La),o}function Ds(i,s,a,t=0){let r=a[i];if(r===void 0)return t;let l=br(r),o=s[l];if(o===void 0)throw new RangeError(Rf(i,l,s));return o}function Ic(i,s){if(s>i)throw new RangeError(Gp)}function Y(i){return{branding:Ut,epochNanoseconds:i}}function Q(i,s,a){return{branding:Yi,calendar:a,timeZone:s,epochNanoseconds:i}}function E(i,s=i.calendar){return{branding:Zs,calendar:s,...gi(fm,i)}}function J(i,s=i.calendar){return{branding:js,calendar:s,...gi(Gl,i)}}function Ts(i,s=i.calendar){return{branding:Vs,calendar:s,...gi(Gl,i)}}function Ka(i,s=i.calendar){return{branding:ks,calendar:s,...gi(Gl,i)}}function Li(i){return{branding:Jt,...gi(dm,i)}}function x(i){return{branding:_t,sign:as(i),...gi(_l,i)}}function zc(i){return Dc(i.epochNanoseconds)}function pt(i){return Or(i.epochNanoseconds,Ii)[0]}function Cc(i){return bc(i.epochNanoseconds,Ls)}function Nc(i){return bc(i.epochNanoseconds)}function Wc(i){return i.epochNanoseconds}function K(i){return typeof i=="string"?i:I(i.id)}function Hs(i,s){return i===s||K(i)===K(s)}function Ec(i,s,a,t,r){let l=Ps(t),[o,c]=((P,b)=>{let w=b((P=nr(P,pr))[pm]),D=gu(P);return D=uc(pr,D),[D,w]})(r,i);if(ua(Math.max(o,l),c))return Ho(t,o);if(!c)throw new RangeError(It);let[d,f,m]=wt(s,a,c),p=al(m),u=bt(m),g=tl(m),h=u(f,d,t),T=g(f,d,h,o);return ua(o,c)?Ho(T,o):((P,b,w,D,N,$,Z)=>{let n=as(P),[X,B]=zr(D,Rl(w,P),w,n,N,$,Z),ra=Cr(b,X,B);return P[S[w]]+ra*n})(T,p(h),o,f,d,p,u)}function Ho(i,s){return Pi(H(i),ni[s],1)}function zr(i,s,a,t,r,l,o){let c=S[a],d={...s,[c]:s[c]+t},f=o(i,r,s),m=o(i,r,d);return[l(f),l(m)]}function Cr(i,s,a){let t=Pi(Ti(s,a));if(!t)throw new RangeError(Ma);return Pi(Ti(s,i))/t}function Jc(i,s){let[a,t,r]=ft(s,5,1);return Y(gt(i.epochNanoseconds,a,t,r,1))}function Uc(i,s,a){let{epochNanoseconds:t,timeZone:r,calendar:l}=s,[o,c,d]=ft(a);if(o===0&&c===1)return s;let f=i(r);if(o===6)t=((m,p,u,g)=>{let h=ti(u,p),[T,P]=m(h),b=u.epochNanoseconds,w=ui(p,T),D=ui(p,P);if(wc(b,w,D))throw new RangeError(Ma);return Ac(Cr(b,w,D),g)?D:w})(Xc,f,s,d);else{let m=f.getOffsetNanosecondsFor(t);t=ys(f,Gc(ss(t,m),o,c,d),m,2,0,1)}return Q(t,r,l)}function _c(i,s){return E(Gc(i,...ft(s)),i.calendar)}function Bc(i,s){let[a,t,r]=ft(s,5);var l;return Li((l=r,Nr(i,Oa(a,t),l)[0]))}function Rc(i,s){let a=i(s.timeZone),t=ti(s,a),[r,l]=Xc(t),o=Pi(Ti(ui(a,r),ui(a,l)),Ct,1);if(o<=0)throw new RangeError(Ma);return o}function Hc(i,s){let{timeZone:a,calendar:t}=s,r=((l,o,c)=>ui(o,l(ti(c,o))))(Kc,i(a),s);return Q(r,a,t)}function Gc(i,s,a,t){return Yc(i,Oa(s,a),t)}function Yc(i,s,a){let[t,r]=Nr(i,s,a);return Bi({...Fs(i,r),...t})}function Nr(i,s,a){return lt(is(ei(i),s,a))}function Aa(i){return is(i,zt,7)}function Oa(i,s){return ni[i]*s}function Xc(i){let s=Kc(i);return[s,Fs(s,1)]}function Kc(i){return ep(6,i)}function op(i,s,a){let t=Math.min(Ps(i),6);return Ys(ht(H(i,t),s,a),t)}function ut(i,s,a,t,r,l,o,c,d,f){if(t===0&&r===1)return i;let m=ua(t,c)?Dt(c)&&t<6&&a>=6?dp:cp:fp,[p,u,g]=m(i,s,a,t,r,l,o,c,d,f);return g&&t!==7&&(p=((h,T,P,b,w,D,N,$)=>{let Z=as(h);for(let n=b+1;n<=P;n++){if(n===7&&P!==7)continue;let X=Rl(n,h);X[S[n]]+=Z;let B=Pi(Ti(N($(w,D,X)),T));if(B&&Math.sign(B)!==Z)break;h=X}return h})(p,u,a,Math.max(6,t),o,c,d,f)),p}function gt(i,s,a,t,r){if(s===6){let l=((o)=>o[0]+o[1]/v)(i);return[is(l,a,t),0]}return ht(i,Oa(s,a),t,r)}function ht(i,s,a,t){let[r,l]=i;t&&l<0&&(l+=v,r-=1);let[o,c]=Ji(is(l,s,a),v);return Dr(r+o,c)}function is(i,s,a){return Ac(i/s,a)*s}function Ac(i,s){return wu[s](i)}function cp(i,s,a,t,r,l){let o=as(i),c=H(i),d=gt(c,t,r,l),f=Ti(c,d),m=Math.sign(d[0]-c[0])===o,p=Ys(d,Math.min(a,6));return[{...i,...p},Ns(s,f),m]}function dp(i,s,a,t,r,l,o,c,d,f){let m=as(i),p=Pi(H(i,5)),u=Oa(t,r),g=is(p,u,l),[h,T]=zr(o,{...i,...Bl},6,m,c,d,f),P=g-Pi(Ti(h,T)),b=0;P&&Math.sign(P)!==m?s=Ws(h,g):(b+=m,g=is(P,u,l),s=Ws(T,g));let w=yt(g);return[{...i,...w,days:i.days+b},s,Boolean(b)]}function fp(i,s,a,t,r,l,o,c,d,f){let m=as(i),p=S[t],u=Rl(t,i);t===7&&(i={...i,weeks:i.weeks+Math.trunc(i.days/7)});let g=it(i[p],r)*r;u[p]=g;let[h,T]=zr(o,u,t,r*m,c,d,f),P=g+Cr(s,h,T)*m*r,b=is(P,r,l),w=Math.sign(b-P)===m;return u[p]=b,[u,w?T:h,w]}function Wr(i,s,a,t){let[r,l,o,c]=((f)=>{let m=Zr(f=Mi(f));return[f.timeZone,...m]})(t),d=r!==void 0;return((f,m,p,u,g,h)=>{p=ht(p,g,u,1);let T=m.getOffsetNanosecondsFor(p);return Hr(ss(p,T),h)+(f?Os(Aa(T)):"Z")})(d,s(d?i(r):xs),a.epochNanoseconds,l,o,c)}function Er(i,s,a){let[t,r,l,o,c,d]=((f)=>{f=Mi(f);let m=Kl(f),p=nc(f),u=Pu(f),g=xa(f,4),h=Za(f,4);return[m,Tu(f),u,g,...$c(h,p)]})(a);return((f,m,p,u,g,h,T,P,b,w)=>{u=ht(u,b,P,1);let D=f(p).getOffsetNanosecondsFor(u);return Hr(ss(u,D),w)+Os(Aa(D),T)+((N,$)=>$!==1?"["+($===2?"!":"")+K(N)+"]":"")(p,h)+Gr(m,g)})(i,s.calendar,s.timeZone,s.epochNanoseconds,t,r,l,o,c,d)}function Jr(i,s){let[a,t,r,l]=((f)=>(f=Mi(f),[Kl(f),...Zr(f)]))(s);return o=i.calendar,c=a,d=l,Hr(Yc(i,r,t),d)+Gr(o,c);var o,c,d}function Ur(i,s){return a=i.calendar,t=i,r=jr(s),Qa(t)+Gr(a,r);var a,t,r}function _r(i,s){return Qc(i.calendar,Vc,i,jr(s))}function Br(i,s){return Qc(i.calendar,mp,i,jr(s))}function Rr(i,s){let[a,t,r]=xc(s);return l=r,kc(Nr(i,t,a)[0],l);var l}function Tt(i,s){let[a,t,r]=xc(s,3);return t>1&&(i={...i,...op(i,t,a)}),((l,o)=>{let{sign:c}=l,d=c===-1?ri(l):l,{hours:f,minutes:m}=d,[p,u]=Or(H(d,3),yi,qi);ld(p);let g=Yr(u,o),h=o>=0||!c||g;return(c<0?"-":"")+"P"+Go({Y:hs(d.years),M:hs(d.months),W:hs(d.weeks),D:hs(d.days)})+(f||m||p||h?"T"+Go({H:hs(f),M:hs(m),S:hs(p,h)+g}):"")})(i,r)}function Qc(i,s,a,t){let r=K(i),l=t>1||t===0&&r!==y;return t===1?r===y?s(a):Qa(a):l?Qa(a)+qc(r,t===2):s(a)}function Go(i){let s=[];for(let a in i){let t=i[a];t&&s.push(t,a)}return s.join("")}function Hr(i,s){return Qa(i)+"T"+kc(i,s)}function Qa(i){return Vc(i)+"-"+Oi(i.isoDay)}function Vc(i){let{isoYear:s}=i;return(s<0||s>9999?ec(s)+Ga(6,Math.abs(s)):Ga(4,s))+"-"+Oi(i.isoMonth)}function mp(i){return Oi(i.isoMonth)+"-"+Oi(i.isoDay)}function kc(i,s){let a=[Oi(i.isoHour),Oi(i.isoMinute)];return s!==-1&&a.push(Oi(i.isoSecond)+((t,r,l,o)=>Yr(t*Ii+r*Ls+l,o))(i.isoMillisecond,i.isoMicrosecond,i.isoNanosecond,s)),a.join(":")}function Os(i,s=0){if(s===1)return"";let[a,t]=Ji(Math.abs(i),Ct),[r,l]=Ji(t,zt),[o,c]=Ji(l,yi);return ec(i)+Oi(a)+":"+Oi(r)+(o||c?":"+Oi(o)+Yr(c):"")}function Gr(i,s){if(s!==1){let a=K(i);if(s>1||s===0&&a!==y)return qc(a,s===2)}return""}function qc(i,s){return"["+(s?"!":"")+"u-ca="+i+"]"}function Yr(i,s){let a=Ga(9,i);return a=s===void 0?a.replace(Ou,""):a.slice(0,s),a?"."+a:""}function ec(i){return i<0?"-":"+"}function hs(i,s){return i||s?i.toLocaleString("fullwide",{useGrouping:0}):""}function pp(i,s){let{epochNanoseconds:a}=i,t=(s.getOffsetNanosecondsFor?s:s(i.timeZone)).getOffsetNanosecondsFor(a),r=ss(a,t);return{calendar:i.calendar,...r,offsetNanoseconds:t}}function id(i,s){let a=ti(s,i);return{calendar:s.calendar,...gi(fm,a),offset:Os(a.offsetNanoseconds),timeZone:s.timeZone}}function ys(i,s,a,t=0,r=0,l,o){if(a!==void 0&&t===1&&(t===1||o))return Sr(s,a);let c=i.getPossibleInstantsFor(s);if(a!==void 0&&t!==3){let d=((f,m,p,u)=>{let g=ii(m);u&&(p=Aa(p));for(let h of f){let T=Pi(Ti(h,g));if(u&&(T=Aa(T)),T===p)return h}})(c,s,a,l);if(d!==void 0)return d;if(t===0)throw new RangeError(Jp)}return o?ii(s):ui(i,s,r,c)}function ui(i,s,a=0,t=i.getPossibleInstantsFor(s)){if(t.length===1)return t[0];if(a===1)throw new RangeError(Up);if(t.length)return t[a===3?1:0];let r=ii(s),l=((c,d)=>{let f=c.getOffsetNanosecondsFor(Ws(d,-v));return Kr(c.getOffsetNanosecondsFor(Ws(d,v))-f)})(i,r),o=l*(a===2?-1:1);return(t=i.getPossibleInstantsFor(ss(r,o)))[a===2?0:t.length-1]}function Xr(i){if(Math.abs(i)>=v)throw new RangeError(Wp);return i}function Kr(i){if(i>v)throw new RangeError(Ep);return i}function Ar(i,s,a){return Y(wi(Ns(s.epochNanoseconds,((t)=>{if(od(t))throw new RangeError(Rp);return H(t,5)})(i?ri(a):a))))}function Qr(i,s,a,t,r,l=Object.create(null)){let o=s(t.timeZone),c=i(t.calendar);return{...t,...il(o,c,t,a?ri(r):r,l)}}function Vr(i,s,a,t,r=Object.create(null)){let{calendar:l}=a;return E(sl(i(l),a,s?ri(t):t,r),l)}function kr(i,s,a,t,r){let{calendar:l}=a;return J(Pt(i(l),a,s?ri(t):t,r),l)}function qr(i,s,a,t,r=Object.create(null)){let l=a.calendar,o=i(l),c=pa(o,a);s&&(t=Ot(t)),t.sign<0&&(c=o.dateAdd(c,{...A,months:1}),c=Fs(c,-1));let d=o.dateAdd(c,t,r);return Ts(pa(o,d),l)}function er(i,s,a){return Li(sd(s,i?ri(a):a)[0])}function il(i,s,a,t,r){let l=H(t,5),o=a.epochNanoseconds;if(od(t)){let c=ti(a,i);o=Ns(ui(i,{...Pt(s,c,{...t,...Bl},r),...gi(Zi,c)}),l)}else o=Ns(o,l),F(r);return{epochNanoseconds:wi(o)}}function sl(i,s,a,t){let[r,l]=sd(s,a);return Bi({...Pt(i,s,{...a,...Bl,days:a.days+l},t),...r})}function Pt(i,s,a,t){if(a.years||a.months||a.weeks)return i.dateAdd(s,a,t);F(t);let r=a.days+H(a,5)[0];return r?Vi(Fs(s,r)):s}function pa(i,s,a=1){return Fs(s,a-i.day(s))}function sd(i,s){let[a,t]=H(s,5),[r,l]=lt(ei(i)+t);return[r,a+l]}function Fs(i,s){return s?{...i,...ot(ai(i)+s*mi)}:i}function wt(i,s,a){let t=i(a.calendar);return Dt(a)?[a,t,s(a.timeZone)]:[{...a,...Fi},t]}function al(i){return i?Wc:ii}function bt(i){return i?O(il,i):sl}function tl(i){return i?O(gp,i):hp}function Dt(i){return i&&i.epochNanoseconds}function ua(i,s){return i<=6-(Dt(s)?1:0)}function rl(i,s,a,t,r,l,o){let c=i(Mi(o).relativeTo),d=Math.max(Ps(r),Ps(l));if(ua(d,c))return x(Gs(((T,P,b,w)=>{let D=Ns(H(T),H(P),w?-1:1);if(!Number.isFinite(D[0]))throw new RangeError(nt);return{...A,...Ys(D,b)}})(r,l,d,t)));if(!c)throw new RangeError(It);t&&(l=ri(l));let[f,m,p]=wt(s,a,c),u=bt(p),g=tl(p),h=u(m,f,r);return x(g(m,f,u(m,h,l),d))}function ad(i,s,a,t,r){let l=Ps(t),[o,c,d,f,m]=((Z,n,X)=>{Z=nr(Z,qa);let B=Xl(Z),ra=X(Z[pm]),la=xr(Z),em=xa(Z,7),us=Za(Z);if(B===void 0&&us===void 0)throw new RangeError(Hp);return us==null&&(us=0),B==null&&(B=Math.max(us,n)),Ic(B,us),la=$r(la,us,1),[B,us,la,em,ra]})(r,l,i),p=Math.max(l,o);if(!Dt(m)&&p<=6)return x(Gs(((Z,n,X,B,ra)=>{let la=gt(H(Z),X,B,ra);return{...A,...Ys(la,n)}})(t,o,c,d,f)));if(!m)throw new RangeError(It);let[u,g,h]=wt(s,a,m),T=al(h),P=bt(h),b=tl(h),w=P(g,u,t),D=b(g,u,w,o),N=t.sign,$=as(D);if(N&&$&&N!==$)throw new RangeError(Ma);return $&&(D=ut(D,T(w),o,c,d,f,g,u,T,P)),x(D)}function td(i){return i.sign===-1?Ot(i):i}function Ot(i){return x(ri(i))}function ri(i){let s={};for(let a of S)s[a]=-1*i[a]||0;return s}function rd(i){return!i.sign}function as(i,s=S){let a=0;for(let t of s){let r=Math.sign(i[t]);if(r){if(a&&a!==r)throw new RangeError(Bp);a=r}}return a}function Gs(i){for(let s of kp)Di(s,i[s],-ko,ko,1);return ld(Pi(H(i),yi)),i}function ld(i){if(!Number.isSafeInteger(i))throw new RangeError(_p)}function H(i,s=6){return oc(i,s,S)}function Ys(i,s=6){let[a,t]=i,r=st(t,s,S);if(r[S[s]]+=a*(v/ni[s]),!Number.isFinite(r[S[s]]))throw new RangeError(nt);return r}function yt(i,s=5){return st(i,s,S)}function od(i){return Boolean(as(i,cm))}function Ps(i){let s=9;for(;s>0&&!i[S[s]];s--);return s}function up(i,s){return[i,s]}function Yo(i){let s=Math.floor(i/Ra)*Ra;return[s,s+Ra]}function cd(i){let s=ts(i=Ya(i));if(!s)throw new RangeError(fi(i));let a;if(s.m)a=0;else{if(!s.offset)throw new RangeError(fi(i));a=Xs(s.offset)}return s.timeZone&&dl(s.timeZone,1),Y(Sr(ct(s),a))}function dd(i){let s=ts(I(i));if(!s)throw new RangeError(fi(i));if(s.timeZone)return wd(s,s.offset?Xs(s.offset):void 0);if(s.m)throw new RangeError(fi(i));return Dd(s)}function fd(i,s){let a=ts(I(i));if(!a||!a.timeZone)throw new RangeError(fi(i));let{offset:t}=a,r=t?Xs(t):void 0,[,l,o]=Da(s);return wd(a,r,l,o)}function Xs(i){let s=dl(i);if(s===void 0)throw new RangeError(fi(i));return s}function md(i){let s=ts(I(i));if(!s||s.m)throw new RangeError(fi(i));return E(bd(s))}function Ft(i){let s=ts(I(i));if(!s||s.m)throw new RangeError(fi(i));return J(s.p?bd(s):Dd(s))}function pd(i,s){let a=ol(I(s));if(a)return ll(a),Ts(Fr(bs(a)));let t=Ft(s);return Ts(pa(i(t.calendar),t))}function ll(i){if(i.calendar!==y)throw new RangeError(Ui(i.calendar))}function ud(i,s){let a=cl(I(s));if(a)return ll(a),Ka(bs(a));let t=Ft(s),{calendar:r}=t,l=i(r),[o,c,d]=l.h(t),[f,m]=l.I(o,c),[p,u]=l.N(f,m,d);return Ka(Vi(l.P(p,u,d)),r)}function gd(i){let s,a=((t)=>{let r=Mu.exec(t);return r?(St(r[10]),Fd(r)):void 0})(I(i));if(!a){if(a=ts(i),!a)throw new RangeError(fi(i));if(!a.p)throw new RangeError(fi(i));if(a.m)throw new RangeError(Ui("Z"));ll(a)}if((s=ol(i))&&Ro(s))throw new RangeError(fi(i));if((s=cl(i))&&Ro(s))throw new RangeError(fi(i));return Li(dt(a,1))}function hd(i){let s=((a)=>{let t=Zu.exec(a);return t?((r)=>{function l(m,p,u){let g=0,h=0;if(u&&([g,d]=Ji(d,ni[u])),m!==void 0){if(c)throw new RangeError(Ui(m));h=((T)=>{let P=parseInt(T);if(!Number.isFinite(P))throw new RangeError(Ui(T));return P})(m),o=1,p&&(d=fl(p)*(ni[u]/yi),c=1)}return g+h}let o=0,c=0,d=0,f={..._s(S,[l(r[2]),l(r[3]),l(r[4]),l(r[5]),l(r[6],r[7],5),l(r[8],r[9],4),l(r[10],r[11],3)]),...st(d,2,S)};if(!o)throw new RangeError(_f(S));return ml(r[1])<0&&(f=ri(f)),f})(t):void 0})(I(i));if(!s)throw new RangeError(fi(i));return x(Gs(s))}function Td(i){let s=ts(i)||ol(i)||cl(i);return s?s.calendar:i}function Pd(i){let s=ts(i);return s&&(s.timeZone||s.m&&xs||s.offset)||i}function wd(i,s,a=0,t=0){let r=vt(i.timeZone),l=Bt(r);return Q(ys(l,ct(i),s,a,t,!l.v,i.m),r,ya(i.calendar))}function bd(i){return Od(Bi(ct(i)))}function Dd(i){return Od(Vi(bs(i)))}function Od(i){return{...i,calendar:ya(i.calendar)}}function ts(i){let s=vu.exec(i);return s?((a)=>{let t=a[10],r=(t||"").toUpperCase()==="Z";return{isoYear:yd(a),isoMonth:parseInt(a[4]),isoDay:parseInt(a[5]),...Fd(a.slice(5)),...St(a[16]),p:Boolean(a[6]),m:r,offset:r?void 0:t}})(s):void 0}function ol(i){let s=Fu.exec(i);return s?((a)=>({isoYear:yd(a),isoMonth:parseInt(a[4]),isoDay:1,...St(a[5])}))(s):void 0}function cl(i){let s=Su.exec(i);return s?((a)=>({isoYear:Us,isoMonth:parseInt(a[1]),isoDay:parseInt(a[2]),...St(a[3])}))(s):void 0}function dl(i,s){let a=Lu.exec(i);return a?((t,r)=>{let l=t[4]||t[5];if(r&&l)throw new RangeError(Ui(l));return Xr((Cs(t[2])*Ct+Cs(t[3])*zt+Cs(t[4])*yi+fl(t[5]||""))*ml(t[1]))})(a,s):void 0}function yd(i){let s=ml(i[1]),a=parseInt(i[2]||i[3]);if(s<0&&!a)throw new RangeError(Ui(-0));return s*a}function Fd(i){let s=Cs(i[3]);return{...lt(fl(i[4]||""))[0],isoHour:Cs(i[1]),isoMinute:Cs(i[2]),isoSecond:s===60?59:s}}function St(i){let s,a,t=[];if(i.replace(ju,(r,l,o)=>{let c=Boolean(l),[d,f]=o.split("=").reverse();if(f){if(f==="u-ca")t.push(d),s||(s=c);else if(c||/[A-Z]/.test(f))throw new RangeError(Ui(r))}else{if(a)throw new RangeError(Ui(r));a=d}return""}),t.length>1&&s)throw new RangeError(Ui(i));return{timeZone:a,calendar:t[0]||y}}function fl(i){return parseInt(i.padEnd(9,"0"))}function Ks(i){return new RegExp(`^${i}\$`,"i")}function ml(i){return i&&i!=="+"?-1:1}function Cs(i){return i===void 0?0:parseInt(i)}function Sd(i){return vt(I(i))}function vt(i){let s=pl(i);return typeof s=="number"?Os(s):s?((a)=>{if($u.test(a))throw new RangeError(Np);return a.toLowerCase().split("/").map((t,r)=>(t.length<=3||/\d/.test(t))&&!/etc|yap/.test(t)?t.toUpperCase():t.replace(/baja|dumont|[a-z]+/g,(l,o)=>l.length<=2&&!r||l==="in"||l==="chat"?l.toUpperCase():l.length>2||!o?_o(l).replace(/island|noronha|murdo|rivadavia|urville/,_o):l)).join("/")})(i):xs}function Xo(i){let s=pl(i);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:xs}function pl(i){let s=dl(i=i.toUpperCase(),1);return s!==void 0?s:i!==xs?xu(i):void 0}function ul(i,s){return si(i.epochNanoseconds,s.epochNanoseconds)}function gl(i,s){return si(i.epochNanoseconds,s.epochNanoseconds)}function vd(i,s,a,t,r,l){let o=i(Mi(l).relativeTo),c=Math.max(Ps(t),Ps(r));if(rc(S,t,r))return 0;if(ua(c,o))return si(H(t),H(r));if(!o)throw new RangeError(It);let[d,f,m]=wt(s,a,o),p=al(m),u=bt(m);return si(p(u(f,d,t)),p(u(f,d,r)))}function hl(i,s){return Ss(i,s)||Mt(i,s)}function Ss(i,s){return Qi(ai(i),ai(s))}function Mt(i,s){return Qi(ei(i),ei(s))}function Md(i,s){return!ul(i,s)}function Ld(i,s){return!gl(i,s)&&!!Lt(i.timeZone,s.timeZone)&&Hs(i.calendar,s.calendar)}function jd(i,s){return!hl(i,s)&&Hs(i.calendar,s.calendar)}function Zd(i,s){return!Ss(i,s)&&Hs(i.calendar,s.calendar)}function xd(i,s){return!Ss(i,s)&&Hs(i.calendar,s.calendar)}function $d(i,s){return!Ss(i,s)&&Hs(i.calendar,s.calendar)}function nd(i,s){return!Mt(i,s)}function Lt(i,s){if(i===s)return 1;let a=K(i),t=K(s);if(a===t)return 1;try{return Xo(a)===Xo(t)}catch(r){}}function Tl(i,s,a,t){let r=Rs(i,W(t),3,5),l=jt(s.epochNanoseconds,a.epochNanoseconds,...r);return x(i?ri(l):l)}function Pl(i,s,a,t,r,l){let o=xt(t.calendar,r.calendar),c=W(l),[d,f,m,p]=Rs(a,c,5),u=t.epochNanoseconds,g=r.epochNanoseconds,h=si(g,u),T;if(h)if(d<6)T=jt(u,g,d,f,m,p);else{let P=s(((w,D)=>{if(!Lt(w,D))throw new RangeError(Xf);return w})(t.timeZone,r.timeZone)),b=i(o);T=zd(b,P,t,r,h,d,c),T=ut(T,g,d,f,m,p,b,t,Wc,O(il,P))}else T=A;return x(a?ri(T):T)}function wl(i,s,a,t,r){let l=xt(a.calendar,t.calendar),o=W(r),[c,d,f,m]=Rs(s,o,6),p=ii(a),u=ii(t),g=si(u,p),h;if(g)if(c<=6)h=jt(p,u,c,d,f,m);else{let T=i(l);h=Cd(T,a,t,g,c,o),h=ut(h,u,c,d,f,m,T,a,ii,sl)}else h=A;return x(s?ri(h):h)}function bl(i,s,a,t,r){let l=xt(a.calendar,t.calendar),o=W(r);return Id(s,()=>i(l),a,t,...Rs(s,o,6,9,6),o)}function Dl(i,s,a,t,r){let l=xt(a.calendar,t.calendar),o=W(r),c=Rs(s,o,9,9,8),d=i(l);return Id(s,()=>d,pa(d,a),pa(d,t),...c,o)}function Id(i,s,a,t,r,l,o,c,d){let f=ii(a),m=ii(t),p;if(si(m,f))if(r===6)p=jt(f,m,r,l,o,c);else{let u=s();p=u.dateUntil(a,t,r,d),l===6&&o===1||(p=ut(p,m,r,l,o,c,u,a,ii,Pt))}else p=A;return x(i?ri(p):p)}function Ol(i,s,a,t){let r=W(t),[l,o,c,d]=Rs(i,r,5,5),f=is(yl(s,a),Oa(o,c),d),m={...A,...yt(f,l)};return x(i?ri(m):m)}function gp(i,s,a,t,r,l){let o=si(t.epochNanoseconds,a.epochNanoseconds);return o?r<6?Nd(a.epochNanoseconds,t.epochNanoseconds,r):zd(s,i,a,t,o,r,l):A}function hp(i,s,a,t,r){let l=ii(s),o=ii(a),c=si(o,l);return c?t<=6?Nd(l,o,t):Cd(i,s,a,c,t,r):A}function zd(i,s,a,t,r,l,o){let[c,d,f]=((u,g,h,T)=>{function P(){return n={...Fs(D,$++*-T),...w},X=ui(u,n),si(N,X)===-T}let b=ti(g,u),w=gi(Zi,b),D=ti(h,u),N=h.epochNanoseconds,$=0,Z=yl(b,D),n,X;if(Math.sign(Z)===-T&&$++,P()&&(T===-1||P()))throw new RangeError(Ma);let B=Pi(Ti(X,N));return[b,n,B]})(s,a,t,r);var m,p;return{...l===6?(m=c,p=d,{...A,days:Wd(m,p)}):i.dateUntil(c,d,l,o),...yt(f)}}function Cd(i,s,a,t,r,l){let[o,c,d]=((f,m,p)=>{let u=m,g=yl(f,m);return Math.sign(g)===-p&&(u=Fs(m,-p),g+=v*p),[f,u,g]})(s,a,t);return{...i.dateUntil(o,c,r,l),...yt(d)}}function jt(i,s,a,t,r,l){return{...A,...Ys(gt(Ti(i,s),t,r,l),a)}}function Nd(i,s,a){return{...A,...Ys(Ti(i,s),a)}}function Wd(i,s){return Zt(ai(i),ai(s))}function Zt(i,s){return Math.trunc((s-i)/mi)}function yl(i,s){return ei(s)-ei(i)}function xt(i,s){if(!Hs(i,s))throw new RangeError(Wl);return i}function Tp(i){function s(r){return((l,o)=>({...Ed(l,o),F:l.month,day:parseInt(l.day)}))(yr(a,r),t)}let a=kl(i),t=Va(i);return{id:i,O:Pp(s),B:wp(s)}}function Pp(i){return pi((s)=>{let a=ai(s);return i(a)},WeakMap)}function wp(i){let s=i(0).year-tu;return pi((a)=>{let t,r=Bs(a-s),l=[],o=[];do r+=400*mi;while((t=i(r)).year<=a);do r+=(1-t.day)*mi,t.year===a&&(l.push(r),o.push(t.F)),r-=mi;while((t=i(r)).year>=a);return{k:l.reverse(),C:Qf(o.reverse())}})}function Ed(i,s){let a,t,r=Jd(i);if(i.era){let l=rm[s];l!==void 0&&(a=s==="islamic"?"ah":i.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),a==="bc"||a==="b"?a="bce":a!=="ad"&&a!=="a"||(a="ce"),t=r,r=Hd(t,l[a]||0))}return{era:a,eraYear:t,year:r}}function Jd(i){return parseInt(i.relatedYear||i.year)}function lr(i){let{year:s,F:a,day:t}=this.O(i),{C:r}=this.B(s);return[s,r[a]+1,t]}function ga(i,s=1,a=1){return this.B(i).k[s-1]+(a-1)*mi}function Ua(i){let s=Ao(this,i),a=Ao(this,i-1),t=s.length;if(t>a.length){let r=Gd(this);if(r<0)return-r;for(let l=0;l<t;l++)if(s[l]!==a[l])return l+1}}function _a(i){return Zt(ga.call(this,i),ga.call(this,i+1))}function Ko(i,s){let{k:a}=this.B(i),t=s+1,r=a;return t>a.length&&(t=1,r=this.B(i+1).k),Zt(a[s-1],r[t-1])}function Ba(i){return this.B(i).k.length}function Ao(i,s){return Object.keys(i.B(s).C)}function Ud(i){return ya(I(i))}function ya(i){if((i=i.toLowerCase())!==y&&i!==Wt&&Va(i)!==Va(kl(i).resolvedOptions().calendar))throw new RangeError(Cp(i));return i}function Va(i){return i==="islamicc"&&(i="islamic"),i.split("-")[0]}function _d(i){return this.R(i)[0]}function Bd(i){return this.R(i)[1]}function Fl(i){let[s]=this.h(i);return Zt(this.q(s),ai(i))+1}function Rd(i){let s=Iu.exec(i);if(!s)throw new RangeError(Ip(i));return[parseInt(s[1]),Boolean(s[2])]}function ka(i,s,a){return i+(s||a&&i>=a?1:0)}function or(i,s){return i-(s&&i>=s?1:0)}function Hd(i,s){return(s+i)*(Math.sign(s)||1)||0}function cr(i){return rm[Yd(i)]}function Gd(i){return Ap[Yd(i)]}function Yd(i){return Va(i.id||y)}function Xd(i,s,a,t){let r=rs(a,t,ji,[],im);if(r.timeZone!==void 0){let l=a.dateFromFields(r),o=vs(r),c=i(r.timeZone);return{epochNanoseconds:ys(s(c),{...l,...o},r.offset!==void 0?Xs(r.offset):void 0),timeZone:c}}return{...a.dateFromFields(r),...Fi}}function Kd(i,s,a,t,r,l){let o=rs(a,r,ji,qf,im),c=i(o.timeZone),[d,f,m]=Da(l),p=a.dateFromFields(o,mt(l,d)),u=vs(o,d);return Q(ys(s(c),{...p,...u},o.offset!==void 0?Xs(o.offset):void 0,f,m),c,t)}function Ad(i,s,a){let t=rs(i,s,ji,[],Gi),r=F(a);return E(Bi({...i.dateFromFields(t,mt(a,r)),...vs(t,r)}))}function Sl(i,s,a,t=[]){let r=rs(i,s,ji,t);return i.dateFromFields(r,a)}function vl(i,s,a,t){let r=rs(i,s,Ul,t);return i.yearMonthFromFields(r,a)}function Ml(i,s,a,t,r=[]){let l=rs(i,a,ji,r);return s&&l.month!==void 0&&l.monthCode===void 0&&l.year===void 0&&(l.year=Us),i.monthDayFromFields(l,t)}function Qd(i,s){let a=F(s);return Li(vs($i(i,fr,[],1),a))}function Vd(i){let s=$i(i,_l);return x(Gs({...A,...s}))}function rs(i,s,a,t=[],r=[]){return $i(s,[...i.fields(a),...r].sort(),t)}function $i(i,s,a,t=!a){let r={},l,o=0;for(let c of s){if(c===l)throw new RangeError(Lp(c));if(c==="constructor"||c==="__proto__")throw new RangeError(Cl(c));let d=i[c];if(d!==void 0)o=1,qo[c]&&(d=qo[c](d,c)),r[c]=d;else if(a){if(a.includes(c))throw new TypeError(zl(c));r[c]=tm[c]}l=c}if(t&&!o)throw new TypeError(_f(s));return r}function vs(i,s){return dt(Wu({...tm,...i}),s)}function kd(i,s,a,t,r,l){let o=W(l),{calendar:c,timeZone:d}=a;return Q(((f,m,p,u,g)=>{let h=Fa(f,p,u,ji,ef,kf),[T,P,b]=Da(g,2);return ys(m,{...f.dateFromFields(h,mt(g,T)),...vs(h,T)},Xs(h.offset),P,b)})(i(c),s(d),t,r,o),d,c)}function qd(i,s,a,t,r){let l=W(r);return E(((o,c,d,f)=>{let m=Fa(o,c,d,ji,Gi),p=F(f);return Bi({...o.dateFromFields(m,mt(f,p)),...vs(m,p)})})(i(s.calendar),a,t,l))}function ed(i,s,a,t,r){let l=W(r);return((o,c,d,f)=>{let m=Fa(o,c,d,ji);return o.dateFromFields(m,f)})(i(s.calendar),a,t,l)}function sf(i,s,a,t,r){let l=W(r);return Ts(((o,c,d,f)=>{let m=Fa(o,c,d,Ul);return o.yearMonthFromFields(m,f)})(i(s.calendar),a,t,l))}function af(i,s,a,t,r){let l=W(r);return((o,c,d,f)=>{let m=Fa(o,c,d,ji);return o.monthDayFromFields(m,f)})(i(s.calendar),a,t,l)}function tf(i,s,a){return Li(((t,r,l)=>{let o=F(l);return vs({...gi(fr,t),...$i(r,fr)},o)})(i,s,a))}function rf(i,s){return x((a=i,t=s,Gs({...a,...$i(t,_l)})));var a,t}function Fa(i,s,a,t,r=[],l=[]){let o=[...i.fields(t),...r].sort(),c=$i(s,o,l),d=$i(a,o);return c=i.mergeFields(c,d),$i(c,o,[])}function Ll(i,s){let a=rs(i,s,am);return i.monthDayFromFields(a)}function jl(i,s,a){let t=rs(i,s,sm);return i.yearMonthFromFields(t,a)}function lf(i,s,a,t,r){s=gi(a=i.fields(a),s),t=$i(t,r=i.fields(r),[]);let l=i.mergeFields(s,t);return l=$i(l,[...a,...r].sort(),[]),i.dateFromFields(l)}function ir(i,s){let{era:a,eraYear:t,year:r}=s,l=cr(i);if(a!==void 0||t!==void 0){if(a===void 0||t===void 0)throw new TypeError(Zp);if(!l)throw new RangeError(jp);let o=l[a];if(o===void 0)throw new RangeError($p(a));let c=Hd(t,o);if(r!==void 0&&r!==c)throw new RangeError(xp);r=c}else if(r===void 0)throw new TypeError(np(l));return r}function sr(i,s,a,t){let{month:r,monthCode:l}=s;if(l!==void 0){let o=((c,d,f,m)=>{let p=c.U(f),[u,g]=Rd(d),h=ka(u,g,p);if(g){let T=Gd(c);if(T===void 0)throw new RangeError(da);if(T>0){if(h>T)throw new RangeError(da);if(p===void 0){if(m===1)throw new RangeError(da);h--}}else{if(h!==-T)throw new RangeError(da);if(p===void 0&&m===1)throw new RangeError(da)}}return h})(i,l,a,t);if(r!==void 0&&r!==o)throw new RangeError(Gf);r=o,t=1}else if(r===void 0)throw new TypeError(zp);return Di("month",r,1,i.L(a),t)}function Qo(i,s,a,t,r){return di(s,"day",1,i.j(t,a),r)}function ar(i,s,a,t){let r=0,l=[];for(let o of a)s[o]!==void 0?r=1:l.push(o);if(Object.assign(i,s),r)for(let o of t||l)delete i[o]}function of(i){return Y(wi(rt(tt(i))))}function cf(i,s,a,t,r=y){return Q(wi(rt(tt(a))),s(t),i(r))}function df(i,s,a,t,r=0,l=0,o=0,c=0,d=0,f=0,m=y){return E(Bi(ct(Si(e,_s(Et,[s,a,t,r,l,o,c,d,f])))),i(m))}function ff(i,s,a,t,r=y){return J(Vi(bs(Si(e,{isoYear:s,isoMonth:a,isoDay:t}))),i(r))}function mf(i,s,a,t=y,r=1){let l=e(s),o=e(a),c=i(t);return Ts(Fr(bs({isoYear:l,isoMonth:o,isoDay:e(r)})),c)}function pf(i,s,a,t=y,r=Us){let l=e(s),o=e(a),c=i(t);return Ka(Vi(bs({isoYear:e(r),isoMonth:l,isoDay:o})),c)}function uf(i=0,s=0,a=0,t=0,r=0,l=0){return Li(dt(Si(e,_s(Zi,[i,s,a,t,r,l])),1))}function gf(i=0,s=0,a=0,t=0,r=0,l=0,o=0,c=0,d=0,f=0){return x(Gs(Si(Pc,_s(S,[i,s,a,t,r,l,o,c,d,f]))))}function Zl(i,s,a=y){return Q(i.epochNanoseconds,s,a)}function hf(i){return Y(i.epochNanoseconds)}function xl(i,s){return E(ti(s,i))}function $l(i,s){return J(ti(s,i))}function Tf(i,s,a){return jl(i(s.calendar),a)}function Pf(i,s,a){return Ll(i(s.calendar),a)}function nl(i,s){return Li(ti(s,i))}function wf(i,s,a,t){let r=((l,o,c,d)=>{let f=Lr(d);return ui(l(o),c,f)})(i,a,s,t);return Q(wi(r),a,s.calendar)}function bf(i,s,a){let t=i(s.calendar);return Ts({...s,...jl(t,a)})}function Df(i,s,a){return Ll(i(s.calendar),a)}function Of(i,s,a,t,r){let l=i(r.timeZone),o=r.plainTime,c=o!==void 0?s(o):Fi;return Q(ui(a(l),{...t,...c}),l,t.calendar)}function yf(i,s=Fi){return E(Bi({...i,...s}))}function Ff(i,s,a){return jl(i(s.calendar),a)}function Sf(i,s,a){return Ll(i(s.calendar),a)}function vf(i,s,a,t){return((r,l,o)=>lf(r,l,sm,_i(o),ja))(i(s.calendar),a,t)}function Mf(i,s,a,t){return((r,l,o)=>lf(r,l,am,_i(o),Nt))(i(s.calendar),a,t)}function Lf(i,s,a,t,r){let l=_i(r),o=s(l.plainDate),c=i(l.timeZone);return Q(ui(a(c),{...o,...t}),c,o.calendar)}function jf(i,s){return E(Bi({...i,...s}))}function Zf(i){return Y(wi(Es(i,yi)))}function xf(i){return Y(wi(Es(i,Ii)))}function $f(i){return Y(wi(rt(tt(i),Ls)))}function nf(i){return Y(wi(rt(tt(i))))}function If(i,s,a=Fi){let t=s.timeZone,r=i(t),l={...ti(s,r),...a};return Q(ys(r,l,l.offsetNanoseconds,2),t,s.calendar)}function zf(i,s,a){let t=s.timeZone,r=i(t),l={...ti(s,r),...a},o=Ef(s.calendar,a.calendar);return Q(ys(r,l,l.offsetNanoseconds,2),t,o)}function Cf(i,s=Fi){return E({...i,...s})}function Nf(i,s){return E({...i,...s},Ef(i.calendar,s.calendar))}function $t(i,s){return{...i,calendar:s}}function Wf(i,s){return{...i,timeZone:s}}function Ef(i,s){if(i===s)return i;let a=K(i),t=K(s);if(a===t||a===y)return s;if(t===y)return i;throw new RangeError(Wl)}function bp(i,s){return(a)=>a===y?i:a===Wt||a===Js?Object.assign(Object.create(i),{id:a}):Object.assign(Object.create(s),nu(a))}function Ms(i,s,a){let t=new Set(a);return(r)=>(((l,o)=>{for(let c of o)if(c in l)return 1;return 0})(r=gr(t,r),i)||Object.assign(r,s),a&&(r.timeZone=xs,["full","long"].includes(r.timeStyle)&&(r.timeStyle="medium")),r)}function Ri(i,s=Il){let[a,,,t]=i;return(r,l=qu,...o)=>{let c=s(t&&t(...o),r,l,a),d=c.resolvedOptions();return[c,...Dp(i,d,o)]}}function Il(i,s,a,t){if(a=t(a),i){if(a.timeZone!==void 0)throw new TypeError(Yp);a.timeZone=i}return new ls(s,a)}function Dp(i,s,a){let[,t,r]=i;return a.map((l)=>(l.calendar&&((o,c,d)=>{if((d||o!==y)&&o!==c)throw new RangeError(Wl)})(K(l.calendar),s.calendar,r),t(l,s)))}function As(i){let s=Sa();return ss(s,i.getOffsetNanosecondsFor(s))}function Sa(){return Es(Date.now(),Ii)}function Hi(){return ic||(ic=new ls().resolvedOptions().timeZone)}var Op=(i,s)=>`Non-integer ${i}: ${s}`,yp=(i,s)=>`Non-positive ${i}: ${s}`,Fp=(i,s)=>`Non-finite ${i}: ${s}`,Sp=(i)=>`Cannot convert bigint to ${i}`,vp=(i)=>`Invalid bigint: ${i}`,Mp="Cannot convert Symbol to string",Jf="Invalid object",Uf=(i,s,a,t,r)=>r?Uf(i,r[s],r[a],r[t]):va(i,s)+`; must be between ${a}-${t}`,va=(i,s)=>`Invalid ${i}: ${s}`,zl=(i)=>`Missing ${i}`,Cl=(i)=>`Invalid field ${i}`,Lp=(i)=>`Duplicate field ${i}`,_f=(i)=>"No valid fields: "+i.join(),Bf="Invalid bag",Rf=(i,s,a)=>va(i,s)+"; must be "+Object.keys(a).join(),Hf="Cannot use valueOf",Nl="Invalid calling context",jp="Forbidden era/eraYear",Zp="Mismatching era/eraYear",xp="Mismatching year/eraYear",$p=(i)=>`Invalid era: ${i}`,np=(i)=>"Missing year"+(i?"/era/eraYear":""),Ip=(i)=>`Invalid monthCode: ${i}`,Gf="Mismatching month/monthCode",zp="Missing month/monthCode",Vo="Cannot guess year",da="Invalid leap month",Yf="Invalid protocol",Ma="Invalid protocol results",Wl="Mismatching Calendars",Cp=(i)=>`Invalid Calendar: ${i}`,Xf="Mismatching TimeZones",Np="Forbidden ICU TimeZone",Wp="Out-of-bounds offset",Ep="Out-of-bounds TimeZone gap",Jp="Invalid TimeZone offset",Up="Ambiguous offset",nt="Out-of-bounds date",_p="Out-of-bounds duration",Bp="Cannot mix duration signs",It="Missing relativeTo",Rp="Cannot use large units",Hp="Required smallestUnit or largestUnit",Gp="smallestUnit > largestUnit",fi=(i)=>`Cannot parse: ${i}`,Ui=(i)=>`Invalid substring: ${i}`,Kf=(i)=>`Cannot format ${i}`,Af="Mismatching types for formatting",Yp="Cannot specify TimeZone",Qf=O(Pa,(i,s)=>s),Qs=O(Pa,(i,s,a)=>a),Oi=O(Ga,2),dr={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},La=Object.keys(dr),mi=86400000,Vf=1000,Ls=1000,Ii=1e6,yi=1e9,zt=60000000000,Ct=3600000000000,v=86400000000000,ni=[1,Ls,Ii,yi,zt,Ct,v],Gi=La.slice(0,6),fr=wa(Gi),kf=["offset"],qf=["timeZone"],ef=Gi.concat(kf),im=ef.concat(qf),mr=["era","eraYear"],Xp=mr.concat(["year"]),Nt=["year"],El=["monthCode"],Jl=["month"].concat(El),ja=["day"],Ul=Jl.concat(Nt),sm=El.concat(Nt),ji=ja.concat(Ul),Kp=ja.concat(Jl),am=ja.concat(El),tm=Qs(Gi,0),y="iso8601",Wt="gregory",Js="japanese",rm={[Wt]:{bce:-1,ce:0},[Js]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},Ap={chinese:13,dangi:13,hebrew:-6},I=O(at,"string"),lm=O(at,"boolean"),Qp=O(at,"number"),om=O(at,"function"),S=La.map((i)=>i+"s"),_l=wa(S),Vp=S.slice(0,6),cm=S.slice(6),kp=cm.slice(1),qp=Qf(S),A=Qs(S,0),Bl=Qs(Vp,0),Rl=O(lc,S),Zi=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Hl=["isoDay","isoMonth","isoYear"],Et=Zi.concat(Hl),Gl=wa(Hl),dm=wa(Zi),fm=wa(Et),Fi=Qs(dm,0),ep=O(lc,Et),ls=Intl.DateTimeFormat,mm="en-GB",Yl=1e8,iu=Yl*mi,su=[Yl,0],au=[-Yl,0],ha=275760,Ta=-271821,tu=1970,Us=1972,Ei=12,ru=Bs(1868,9,8),lu=pi(lp,WeakMap),qa="smallestUnit",pr="unit",ma="roundingIncrement",tr="fractionalSecondDigits",pm="relativeTo",um={constrain:0,reject:1},ou=Object.keys(um),cu={compatible:0,reject:1,earlier:2,later:3},du={reject:0,use:1,prefer:2,ignore:3},fu={auto:0,never:1,critical:2,always:3},mu={auto:0,never:1,critical:2},pu={auto:0,never:1},uu={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Za=O(Ir,qa),Xl=O(Ir,"largestUnit"),gu=O(Ir,pr),gm=O(Ds,"overflow",um),hm=O(Ds,"disambiguation",cu),hu=O(Ds,"offset",du),Kl=O(Ds,"calendarName",fu),Tu=O(Ds,"timeZoneName",mu),Pu=O(Ds,"offset",pu),xa=O(Ds,"roundingMode",uu),Vs="PlainYearMonth",ks="PlainMonthDay",js="PlainDate",Zs="PlainDateTime",Jt="PlainTime",Yi="ZonedDateTime",Ut="Instant",_t="Duration",wu=[Math.floor,(i)=>Ja(i)?Math.floor(i):Math.round(i),Math.ceil,(i)=>Ja(i)?Math.ceil(i):Math.round(i),Math.trunc,(i)=>Ja(i)?Math.trunc(i)||0:Math.round(i),(i)=>i<0?Math.floor(i):Math.ceil(i),(i)=>Math.sign(i)*Math.round(Math.abs(i))||0,(i)=>Ja(i)?(i=Math.trunc(i)||0)+i%2:Math.round(i)],xs="UTC",Ra=5184000,bu=Xa(1847),Du=Xa(new Date().getUTCFullYear()+10),Ou=/0+$/,ti=pi(pp,WeakMap),ko=4294967295,Bt=pi((i)=>{let s=pl(i);return typeof s=="object"?new Pm(s):new Tm(s||0)});class Tm{constructor(i){this.v=i}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(i){return[Sr(i,this.v)]}l(){}}class Pm{constructor(i){this.$=((s)=>{function a(d){let f=rr(d,o,c),[m,p]=Yo(f),u=r(m),g=r(p);return u===g?u:t(l(m,p),u,g,d)}function t(d,f,m,p){let u,g;for(;(p===void 0||(u=p<d[0]?f:p>=d[1]?m:void 0)===void 0)&&(g=d[1]-d[0]);){let h=d[0]+Math.floor(g/2);s(h)===m?d[1]=h:d[0]=h+1}return u}let r=pi(s),l=pi(up),o=bu,c=Du;return{G(d){let f=a(d-86400),m=a(d+86400),p=d-f,u=d-m;if(f===m)return[p];let g=a(p);return g===a(u)?[d-g]:f>m?[p,u]:[]},V:a,l(d,f){let m=rr(d,o,c),[p,u]=Yo(m),g=Ra*f,h=f<0?()=>u>o||(o=m,0):()=>p<c||(c=m,0);for(;h();){let T=r(p),P=r(u);if(T!==P){let b=l(p,u);t(b,T,P);let w=b[0];if((Qi(w,d)||1)===f)return w}p+=g,u+=g}}}})(((s)=>(a)=>{let t=yr(s,a*Vf);return Xa(Jd(t),parseInt(t.month),parseInt(t.day),parseInt(t.hour),parseInt(t.minute),parseInt(t.second))-a})(i))}getOffsetNanosecondsFor(i){return this.$.V(Dc(i))*yi}getPossibleInstantsFor(i){let[s,a]=[Xa((t=i).isoYear,t.isoMonth,t.isoDay,t.isoHour,t.isoMinute,t.isoSecond),t.isoMillisecond*Ii+t.isoMicrosecond*Ls+t.isoNanosecond];var t;return this.$.G(s).map((r)=>wi(Ws(Es(r,yi),a)))}l(i,s){let[a,t]=Oc(i),r=this.$.l(a+(s>0||t?1:0),s);if(r!==void 0)return Es(r,yi)}}var Al="([+\u2212-])",Ha="(?:[.,](\\d{1,9}))?",wm=`(?:(?:${Al}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Ql="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+Ha+")?)?",Vl=Al+Ql,yu=wm+"-?(\\d{2})(?:[T ]"+Ql+"(Z|"+Vl+")?)?",bm="\\[(!?)([^\\]]*)\\]",Rt=`((?:${bm}){0,9})`,Fu=Ks(wm+Rt),Su=Ks("(?:--)?(\\d{2})-?(\\d{2})"+Rt),vu=Ks(yu+Rt),Mu=Ks("T?"+Ql+"(?:"+Vl+")?"+Rt),Lu=Ks(Vl),ju=new RegExp(bm,"g"),Zu=Ks(`${Al}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${Ha}H)?(?:(\\d+)${Ha}M)?(?:(\\d+)${Ha}S)?)?`),xu=pi((i)=>new ls(mm,{timeZone:i,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),$u=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,nu=pi(Tp),kl=pi((i)=>new ls(mm,{calendar:i,timeZone:xs,era:"short",year:"numeric",month:"short",day:"numeric"})),Iu=/^M(\d{2})(L?)$/,zu={era:Ya,eraYear:e,year:e,month:Bo,monthCode:Ya,day:Bo},Cu=Qs(Gi,e),Nu=Qs(S,Pc),qo=Object.assign({},zu,Cu,Nu,{offset:Ya}),Wu=O(rp,Gi,Zi),eo={dateAdd(i,s,a){let t=F(a),r,{years:l,months:o,weeks:c,days:d}=s;if(d+=H(s,5)[0],l||o)r=((f,m,p,u,g)=>{let[h,T,P]=f.h(m);if(p){let[b,w]=f.I(h,T);h+=p,T=ka(b,w,f.U(h)),T=Di("month",T,1,f.L(h),g)}return u&&([h,T]=f._(h,T,u)),P=Di("day",P,1,f.j(h,T),g),f.q(h,T,P)})(this,i,l,o,t);else{if(!c&&!d)return i;r=ai(i)}return r+=(7*c+d)*mi,Vi(ot(r))},dateUntil(i,s,a){if(a<=7){let d=0,f=Wd({...i,...Fi},{...s,...Fi});return a===7&&([d,f]=qi(f,7)),{...A,weeks:d,days:f}}let t=this.h(i),r=this.h(s),[l,o,c]=((d,f,m,p,u,g,h)=>{let T=u-f,P=g-m,b=h-p;if(T||P){let w=Math.sign(T||P),D=d.j(u,g),N=0;if(Math.sign(b)===-w){let $=D;[u,g]=d._(u,g,-w),T=u-f,P=g-m,D=d.j(u,g),N=w<0?-$:D}if(b=h-Math.min(p,D)+N,T){let[$,Z]=d.I(f,m),[n,X]=d.I(u,g);if(P=n-$||Number(X)-Number(Z),Math.sign(P)===-w){let B=w<0&&-d.L(u);T=(u-=w)-f,P=g-ka($,Z,d.U(u))+(B||d.L(u))}}}return[T,P,b]})(this,...t,...r);return a===8&&(o+=this.J(l,t[0]),l=0),{...A,years:l,months:o,days:c}},dateFromFields(i,s){let a=F(s),t=ir(this,i),r=sr(this,i,t,a),l=Qo(this,i,r,t,a);return J(Vi(this.P(t,r,l)),this.id||y)},yearMonthFromFields(i,s){let a=F(s),t=ir(this,i),r=sr(this,i,t,a);return Ts(Fr(this.P(t,r,1)),this.id||y)},monthDayFromFields(i,s){let a=F(s),t=!this.id,{monthCode:r,year:l,month:o}=i,c,d,f,m,p;if(r!==void 0){[c,d]=Rd(r),p=sc(i,"day");let u=this.N(c,d,p);if(!u)throw new RangeError(Vo);if([f,m]=u,o!==void 0&&o!==m)throw new RangeError(Gf);t&&(m=Di("month",m,1,Ei,1),p=Di("day",p,1,vr(l!==void 0?l:f,m),a))}else{f=l===void 0&&t?Us:ir(this,i),m=sr(this,i,f,a),p=Qo(this,i,m,f,a);let u=this.U(f);d=m===u,c=or(m,u);let g=this.N(c,d,p);if(!g)throw new RangeError(Vo);[f,m]=g}return Ka(Vi(this.P(f,m,p)),this.id||y)},fields(i){return cr(this)&&i.includes("year")?[...i,...mr]:i},mergeFields(i,s){let a=Object.assign(Object.create(null),i);return ar(a,s,Jl),cr(this)&&(ar(a,s,Xp),this.id===Js&&ar(a,s,Kp,mr)),a},inLeapYear(i){let[s]=this.h(i);return this.K(s)},monthsInYear(i){let[s]=this.h(i);return this.L(s)},daysInMonth(i){let[s,a]=this.h(i);return this.j(s,a)},daysInYear(i){let[s]=this.h(i);return this.X(s)},dayOfYear:Fl,era(i){return this.ee(i)[0]},eraYear(i){return this.ee(i)[1]},monthCode(i){let[s,a]=this.h(i),[t,r]=this.I(s,a);return((l,o)=>"M"+Oi(l)+(o?"L":""))(t,r)},dayOfWeek:Mc,daysInWeek(){return 7}},Eu={dayOfYear:Fl,h:Fc,q:Bs},Ju=Object.assign({},Eu,{weekOfYear:_d,yearOfWeek:Bd,R(i){function s(g){return(7-g<t?7:0)-g}function a(g){let h=vc(u+g),T=g||1,P=s(fa(d+h*T,7));return m=(h+(P-f)*T)/7}let t=this.id?1:4,r=Mc(i),l=this.dayOfYear(i),o=fa(r-1,7),c=l-1,d=fa(o-c,7),f=s(d),m,p=Math.floor((c-f)/7)+1,u=i.isoYear;return p?p>a(0)&&(p=1,u++):(p=a(-1),u--),[p,u,m]}}),Uu={dayOfYear:Fl,h:lr,q:ga,weekOfYear:_d,yearOfWeek:Bd,R(){return[]}},qs=bp(Object.assign({},eo,Ju,{h:Fc,ee(i){return this.id===Wt?Lc(i):this.id===Js?lu(i):[]},I:(i,s)=>[s,0],N(i,s){if(!s)return[Us,i]},K:Mr,U(){},L:Sc,J:(i)=>i*Ei,j:vr,X:vc,P:(i,s,a)=>({isoYear:i,isoMonth:s,isoDay:a}),q:Bs,_:(i,s,a)=>(i+=it(a,Ei),(s+=Tr(a,Ei))<1?(i--,s+=Ei):s>Ei&&(i++,s-=Ei),[i,s]),year(i){return i.isoYear},month(i){return i.isoMonth},day:(i)=>i.isoDay}),Object.assign({},eo,Uu,{h:lr,ee(i){let s=this.O(i);return[s.era,s.eraYear]},I(i,s){let a=Ua.call(this,i);return[or(s,a),a===s]},N(i,s,a){let[t,r,l]=lr.call(this,{isoYear:Us,isoMonth:Ei,isoDay:31}),o=Ua.call(this,t),c=r===o;(Qi(i,or(r,o))||Qi(Number(s),Number(c))||Qi(a,l))===1&&t--;for(let d=0;d<100;d++){let f=t-d,m=Ua.call(this,f),p=ka(i,s,m);if(s===(p===m)&&a<=Ko.call(this,f,p))return[f,p]}},K(i){let s=_a.call(this,i);return s>_a.call(this,i-1)&&s>_a.call(this,i+1)},U:Ua,L:Ba,J(i,s){let a=s+i,t=Math.sign(i),r=t<0?-1:0,l=0;for(let o=s;o!==a;o+=t)l+=Ba.call(this,o+r);return l},j:Ko,X:_a,P(i,s,a){return ot(ga.call(this,i,s,a))},q:ga,_(i,s,a){if(a){if(s+=a,!Number.isSafeInteger(s))throw new RangeError(nt);if(a<0)for(;s<1;)s+=Ba.call(this,--i);else{let t;for(;s>(t=Ba.call(this,i));)s-=t,i++}}return[i,s]},year(i){return this.O(i).year},month(i){let{year:s,F:a}=this.O(i),{C:t}=this.B(s);return t[a]+1},day(i){return this.O(i).day}})),ki="numeric",es=["timeZoneName"],Dm={month:ki,day:ki},ql={year:ki,month:ki},el=Object.assign({},ql,{day:ki}),io={hour:ki,minute:ki,second:ki},so=Object.assign({},el,io),_u=Object.assign({},so,{timeZoneName:"short"}),Bu=Object.keys(ql),Ru=Object.keys(Dm),Hu=Object.keys(el),Gu=Object.keys(io),ao=["dateStyle"],Yu=Bu.concat(ao),Xu=Ru.concat(ao),to=Hu.concat(ao,["weekday"]),$a=Gu.concat(["dayPeriod","timeStyle"]),ro=to.concat($a),Ku=ro.concat(es),Au=es.concat($a),Qu=es.concat(to),Vu=es.concat(["day","weekday"],$a),ku=es.concat(["year","weekday"],$a),qu={},lo=[Ms(ro,so),pt],Om=[Ms(Ku,_u),pt,0,(i,s)=>{let a=K(i.timeZone);if(s&&K(s.timeZone)!==a)throw new RangeError(Xf);return a}],oo=[Ms(ro,so,es),ai],co=[Ms(to,el,Au),ai],fo=[Ms($a,io,Qu),(i)=>ei(i)/Ii],mo=[Ms(Yu,ql,Vu),ai,1],po=[Ms(Xu,Dm,ku),ai,1],ic;function Ni(i,s,a,t,r){function l(...d){if(!(this instanceof l))throw new TypeError(Nl);vm(this,s(...d))}function o(d,f){return Object.defineProperties(function(...m){return d.call(this,c(this),...m)},ur(f))}function c(d){let f=q(d);if(!f||f.branding!==i)throw new TypeError(Nl);return f}return Object.defineProperties(l.prototype,{...ac(Si(o,a)),...ws(Si(o,t)),...ea("Temporal."+i)}),Object.defineProperties(l,{...ws(r),...ur(i)}),[l,(d)=>{let f=Object.create(l.prototype);return vm(f,d),f},c]}function jm(i){return i=i.concat("id").sort(),(s)=>{if(!tc(s,i))throw new TypeError(Yf);return s}}function ta(i){if(q(i)||i.calendar!==void 0||i.timeZone!==void 0)throw new TypeError(Bf);return i}function Ht(i,s){let a={};for(let t in i)a[t]=({o:r},l)=>{let o=q(l)||{},{branding:c}=o,d=c===js||s.includes(c)?o:oi(l);return r[t](d)};return a}function ho(i){let s={};for(let a in i)s[a]=(t)=>{let{calendar:r}=t;return(l=r,typeof l=="string"?qs(l):(o=l,Object.assign(Object.create(hg),{i:o})))[a](t);var l,o};return s}function ms(){throw new TypeError(Hf)}function Ia({calendar:i}){return typeof i=="string"?new So(i):i}function ym(i,s){if(s=W(s),G(i)){let t=q(i);if(t&&t.branding===ks)return F(s),t;let r=$m(i);return Ml(Vt(r||y),!r,i,s)}let a=ud(qs,i);return F(s),a}function Zm(i,s,a){return t=s.call(i,li(Y(a))),Xr(ba(t));var t}function Gt(i,s=Cm){let a=Object.keys(s).sort(),t={};for(let r of a)t[r]=O(s[r],i,om(i[r]));return t}function M(i,s){return typeof i=="string"?Bt(i):Gt(i,s)}function _(i){return M(i,go)}function zi(i){if(G(i)){let s=q(i);if(s)switch(s.branding){case Ut:return s;case Yi:return Y(s.epochNanoseconds)}}return cd(i)}function Fm(i,s,a){let t=s.l(zi(a).epochNanoseconds,i);return t?li(Y(t)):null}function j(i){return G(i)?(q(i)||{}).timeZone||Og(i):((s)=>vt(Pd(I(s))))(i)}function os(i,s){if(G(i)){let a=q(i)||{};switch(a.branding){case Jt:return F(s),a;case Zs:return F(s),Li(a);case Yi:return F(s),nl(_,a)}return Qd(i,s)}return F(s),gd(i)}function To(i){return i===void 0?void 0:os(i)}function ia(i,s){if(s=W(s),G(i)){let t=q(i);return t&&t.branding===Vs?(F(s),t):vl(At(za(i)),i,s)}let a=pd(qs,i);return F(s),a}function cs(i,s){if(s=W(s),G(i)){let t=q(i)||{};switch(t.branding){case Zs:return F(s),t;case js:return F(s),E({...t,...Fi});case Yi:return F(s),xl(_,t)}return Ad(Qt(za(i)),i,s)}let a=md(i);return F(s),a}function oi(i,s){if(s=W(s),G(i)){let t=q(i)||{};switch(t.branding){case js:return F(s),t;case Zs:return F(s),J(t);case Yi:return F(s),$l(_,t)}return Sl(Qt(za(i)),i,s)}let a=Ft(i);return F(s),a}function xm(i,s,a){return vi(s.call(i,C(J(a,i))))}function Wi(i){return(s)=>typeof s=="string"?qs(s):((a,t)=>{let r=Object.keys(t).sort(),l={};for(let o of r)l[o]=O(t[o],a,a[o]);return l})(s,i)}function z(i){if(G(i)){let s=q(i);return s&&s.branding===_t?s:Vd(i)}return hd(i)}function na(i){if(i!==void 0){if(G(i)){let s=q(i)||{};switch(s.branding){case Yi:case js:return s;case Zs:return J(s)}let a=za(i);return{...Xd(j,M,Qt(a),i),calendar:a}}return dd(i)}}function za(i){return $m(i)||y}function $m(i){let{calendar:s}=i;if(s!==void 0)return k(s)}function k(i){return G(i)?(q(i)||{}).calendar||Ng(i):((s)=>ya(Td(I(s))))(i)}function sa(i,s){if(s=W(s),G(i)){let a=q(i);if(a&&a.branding===Yi)return Da(s),a;let t=za(i);return Kd(j,M,Qt(t),t,i,s)}return fd(i,s)}function Sm(i){return Si((s)=>(a)=>s(uo(a)),i)}function uo(i){return ti(i,_)}function eu(){let i=ls.prototype,s=Object.getOwnPropertyDescriptors(i),a=Object.getOwnPropertyDescriptors(ls),t=function(r,l={}){if(!(this instanceof t))return new t(r,l);vo.set(this,((o,c={})=>{let d=new ls(o,c),f=d.resolvedOptions(),m=f.locale,p=gi(Object.keys(c),f),u=pi(ag),g=(...h)=>{let T,P=h.map((b,w)=>{let D=q(b),N=(D||{}).branding;if(w&&T&&T!==N)throw new TypeError(Af);return T=N,D});return T?u(T)(m,p,...P):[d,...h]};return g.u=d,g})(r,l))};for(let r in s){let l=s[r],o=r.startsWith("format")&&ig(r);typeof l.value=="function"?l.value=r==="constructor"?t:o||sg(r):o&&(l.get=function(){return o.bind(this)})}return a.prototype.value=Object.create(i,s),Object.defineProperties(t,a),t}function ig(i){return function(...s){let a=vo.get(this),[t,...r]=a(...s);return t[i](...r)}}function sg(i){return function(...s){return vo.get(this).u[i](...s)}}function ag(i){let s=tg[i];if(!s)throw new TypeError(Kf(i));return Ri(s,pi(Il))}var tg={Instant:lo,PlainDateTime:oo,PlainDate:co,PlainTime:fo,PlainYearMonth:mo,PlainMonthDay:po},rg=Ri(lo),lg=Ri(Om),og=Ri(oo),cg=Ri(co),dg=Ri(fo),fg=Ri(mo),mg=Ri(po),Po={era:mc,eraYear:Pr,year:ba,month:vi,daysInMonth:vi,daysInYear:vi,inLeapYear:lm,monthsInYear:vi},Xt={monthCode:I},wo={day:vi},nm={dayOfWeek:vi,dayOfYear:vi,weekOfYear:pc,yearOfWeek:Pr,daysInWeek:vi},Im=Object.assign({},Po,Xt,wo,nm),Yt=new WeakMap,q=Yt.get.bind(Yt),vm=Yt.set.bind(Yt),pg={...Ht(Po,[Vs]),...Ht(nm,[]),...Ht(Xt,[Vs,ks]),...Ht(wo,[ks])},bo=ho(Im),ug=ho({...Po,...Xt}),gg=ho({...Xt,...wo}),Ca={calendarId:(i)=>K(i.calendar)},hg=Si((i,s)=>function(a){let{i:t}=this;return i(t[s](C(J(a,t))))},Im),Tg=Pa((i)=>(s)=>s[i],S.concat("sign")),Do=Pa((i,s)=>(a)=>a[Zi[s]],Gi),zm={epochSeconds:zc,epochMilliseconds:pt,epochMicroseconds:Cc,epochNanoseconds:Nc},Na=O(gr,new Set(["branding"])),[Pg,aa,wg]=Ni(ks,O(pf,k),{...Ca,...gg},{getISOFields:Na,getCalendar:Ia,with(i,s,a){return aa(af(Ig,i,this,ta(s),a))},equals:(i,s)=>$d(i,ym(s)),toPlainDate(i,s){return C(Mf(Wa,i,this,s))},toLocaleString(i,s,a){let[t,r]=mg(s,a,i);return t.format(r)},toString:Br,toJSON:(i)=>Br(i),valueOf:ms},{from:(i,s)=>aa(ym(i,s))}),Cm={getOffsetNanosecondsFor:Zm,getPossibleInstantsFor(i,s,a){let t=[...s.call(i,V(E(a,y)))].map((l)=>Dg(l).epochNanoseconds),r=t.length;return r>1&&(t.sort(si),Kr(Pi(Ti(t[0],t[r-1])))),t}},go={getOffsetNanosecondsFor:Zm},[bg,li,Dg]=Ni(Ut,of,zm,{add:(i,s)=>li(Ar(0,i,z(s))),subtract:(i,s)=>li(Ar(1,i,z(s))),until:(i,s,a)=>L(Tl(0,i,zi(s),a)),since:(i,s,a)=>L(Tl(1,i,zi(s),a)),round:(i,s)=>li(Jc(i,s)),equals:(i,s)=>Md(i,zi(s)),toZonedDateTime(i,s){let a=_i(s);return U(Zl(i,j(a.timeZone),k(a.calendar)))},toZonedDateTimeISO:(i,s)=>U(Zl(i,j(s))),toLocaleString(i,s,a){let[t,r]=rg(s,a,i);return t.format(r)},toString:(i,s)=>Wr(j,_,i,s),toJSON:(i)=>Wr(j,_,i),valueOf:ms},{from:(i)=>li(zi(i)),fromEpochSeconds:(i)=>li(Zf(i)),fromEpochMilliseconds:(i)=>li(xf(i)),fromEpochMicroseconds:(i)=>li($f(i)),fromEpochNanoseconds:(i)=>li(nf(i)),compare:(i,s)=>ul(zi(i),zi(s))}),[Kt,Fh]=Ni("TimeZone",(i)=>{let s=Sd(i);return{branding:"TimeZone",id:s,o:Bt(s)}},{id:(i)=>i.id},{getPossibleInstantsFor:({o:i},s)=>i.getPossibleInstantsFor(cs(s)).map((a)=>li(Y(a))),getOffsetNanosecondsFor:({o:i},s)=>i.getOffsetNanosecondsFor(zi(s).epochNanoseconds),getOffsetStringFor(i,s){let a=zi(s).epochNanoseconds,t=Gt(this,go).getOffsetNanosecondsFor(a);return Os(t)},getPlainDateTimeFor(i,s,a=y){let t=zi(s).epochNanoseconds,r=Gt(this,go).getOffsetNanosecondsFor(t);return V(E(ss(t,r),k(a)))},getInstantFor(i,s,a){let t=cs(s),r=Lr(a),l=Gt(this);return li(Y(ui(l,t,r)))},getNextTransition:({o:i},s)=>Fm(1,i,s),getPreviousTransition:({o:i},s)=>Fm(-1,i,s),equals(i,s){return!!Lt(this,j(s))},toString:(i)=>i.id,toJSON:(i)=>i.id},{from(i){let s=j(i);return typeof s=="string"?new Kt(s):s}}),Og=jm(Object.keys(Cm)),[yg,ds]=Ni(Jt,uf,Do,{getISOFields:Na,with(i,s,a){return ds(tf(this,ta(s),a))},add:(i,s)=>ds(er(0,i,z(s))),subtract:(i,s)=>ds(er(1,i,z(s))),until:(i,s,a)=>L(Ol(0,i,os(s),a)),since:(i,s,a)=>L(Ol(1,i,os(s),a)),round:(i,s)=>ds(Bc(i,s)),equals:(i,s)=>nd(i,os(s)),toZonedDateTime:(i,s)=>U(Lf(j,oi,M,i,s)),toPlainDateTime:(i,s)=>V(jf(i,oi(s))),toLocaleString(i,s,a){let[t,r]=dg(s,a,i);return t.format(r)},toString:Rr,toJSON:(i)=>Rr(i),valueOf:ms},{from:(i,s)=>ds(os(i,s)),compare:(i,s)=>Mt(os(i),os(s))}),[Fg,fs,Sg]=Ni(Vs,O(mf,k),{...Ca,...ug},{getISOFields:Na,getCalendar:Ia,with(i,s,a){return fs(sf(ng,i,this,ta(s),a))},add:(i,s,a)=>fs(qr(Mm,0,i,z(s),a)),subtract:(i,s,a)=>fs(qr(Mm,1,i,z(s),a)),until:(i,s,a)=>L(Dl(Lm,0,i,ia(s),a)),since:(i,s,a)=>L(Dl(Lm,1,i,ia(s),a)),equals:(i,s)=>xd(i,ia(s)),toPlainDate(i,s){return C(vf(Wa,i,this,s))},toLocaleString(i,s,a){let[t,r]=fg(s,a,i);return t.format(r)},toString:_r,toJSON:(i)=>_r(i),valueOf:ms},{from:(i,s)=>fs(ia(i,s)),compare:(i,s)=>Ss(ia(i),ia(s))}),[vg,V]=Ni(Zs,O(df,k),{...Ca,...bo,...Do},{getISOFields:Na,getCalendar:Ia,with(i,s,a){return V(qd(Wa,i,this,ta(s),a))},withCalendar:(i,s)=>V($t(i,k(s))),withPlainDate:(i,s)=>V(Nf(i,oi(s))),withPlainTime:(i,s)=>V(Cf(i,To(s))),add:(i,s,a)=>V(Vr($s,0,i,z(s),a)),subtract:(i,s,a)=>V(Vr($s,1,i,z(s),a)),until:(i,s,a)=>L(wl(Ci,0,i,cs(s),a)),since:(i,s,a)=>L(wl(Ci,1,i,cs(s),a)),round:(i,s)=>V(_c(i,s)),equals:(i,s)=>jd(i,cs(s)),toZonedDateTime:(i,s,a)=>U(wf(M,i,j(s),a)),toPlainDate:(i)=>C(J(i)),toPlainTime:(i)=>ds(Li(i)),toPlainYearMonth(i){return fs(bf(At,i,this))},toPlainMonthDay(i){return aa(Df(Vt,i,this))},toLocaleString(i,s,a){let[t,r]=og(s,a,i);return t.format(r)},toString:Jr,toJSON:(i)=>Jr(i),valueOf:ms},{from:(i,s)=>V(cs(i,s)),compare:(i,s)=>hl(cs(i),cs(s))}),[Mg,C,Nm]=Ni(js,O(ff,k),{...Ca,...bo},{getISOFields:Na,getCalendar:Ia,with(i,s,a){return C(ed(Wa,i,this,ta(s),a))},withCalendar:(i,s)=>C($t(i,k(s))),add:(i,s,a)=>C(kr($s,0,i,z(s),a)),subtract:(i,s,a)=>C(kr($s,1,i,z(s),a)),until:(i,s,a)=>L(bl(Ci,0,i,oi(s),a)),since:(i,s,a)=>L(bl(Ci,1,i,oi(s),a)),equals:(i,s)=>Zd(i,oi(s)),toZonedDateTime(i,s){let a=!G(s)||s instanceof Kt?{timeZone:s}:s;return U(Of(j,os,M,i,a))},toPlainDateTime:(i,s)=>V(yf(i,To(s))),toPlainYearMonth(i){return fs(Ff(At,i,this))},toPlainMonthDay(i){return aa(Sf(Vt,i,this))},toLocaleString(i,s,a){let[t,r]=cg(s,a,i);return t.format(r)},toString:Ur,toJSON:(i)=>Ur(i),valueOf:ms},{from:(i,s)=>C(oi(i,s)),compare:(i,s)=>Ss(oi(i),oi(s))}),Oo={fields(i,s,a){return[...s.call(i,a)]}},Wm=Object.assign({dateFromFields(i,s,a,t){return Nm(s.call(i,Object.assign(Object.create(null),a),t))}},Oo),Em=Object.assign({yearMonthFromFields(i,s,a,t){return Sg(s.call(i,Object.assign(Object.create(null),a),t))}},Oo),Jm=Object.assign({monthDayFromFields(i,s,a,t){return wg(s.call(i,Object.assign(Object.create(null),a),t))}},Oo),yo={mergeFields(i,s,a,t){return _i(s.call(i,Object.assign(Object.create(null),a),Object.assign(Object.create(null),t)))}},Lg=Object.assign({},Wm,yo),jg=Object.assign({},Em,yo),Zg=Object.assign({},Jm,yo),Fo={dateAdd(i,s,a,t,r){return Nm(s.call(i,C(J(a,i)),L(x(t)),r))}},Um=Object.assign({},Fo,{dateUntil(i,s,a,t,r,l){return Cg(s.call(i,C(J(a,i)),C(J(t,i)),Object.assign(Object.create(null),l,{largestUnit:La[r]})))}}),xg=Object.assign({},Fo,{day:xm}),$g=Object.assign({},Um,{day:xm}),At=Wi(Em),Qt=Wi(Wm),Vt=Wi(Jm),ng=Wi(jg),Wa=Wi(Lg),Ig=Wi(Zg),$s=Wi(Fo),Ci=Wi(Um),Mm=Wi(xg),Lm=Wi($g),[zg,L,Cg]=Ni(_t,gf,{...Tg,blank:rd},{with:(i,s)=>L(rf(i,s)),negated:(i)=>L(Ot(i)),abs:(i)=>L(td(i)),add:(i,s,a)=>L(rl(na,Ci,M,0,i,z(s),a)),subtract:(i,s,a)=>L(rl(na,Ci,M,1,i,z(s),a)),round:(i,s)=>L(ad(na,Ci,M,i,s)),total:(i,s)=>Ec(na,Ci,M,i,s),toLocaleString(i,s,a){return Intl.DurationFormat?new Intl.DurationFormat(s,a).format(this):Tt(i)},toString:Tt,toJSON:(i)=>Tt(i),valueOf:ms},{from:(i)=>L(z(i)),compare:(i,s,a)=>vd(na,$s,M,z(i),z(s),a)}),_m={toString:(i)=>i.id,toJSON:(i)=>i.id,...pg,dateAdd:({id:i,o:s},a,t,r)=>C(J(s.dateAdd(oi(a),z(t),r),i)),dateUntil:({o:i},s,a,t)=>L(x(i.dateUntil(oi(s),oi(a),Zc(t)))),dateFromFields:({id:i,o:s},a,t)=>C(Sl(s,a,t,fc(i))),yearMonthFromFields:({id:i,o:s},a,t)=>fs(vl(s,a,t,cc(i))),monthDayFromFields:({id:i,o:s},a,t)=>aa(Ml(s,0,a,t,dc(i))),fields({o:i},s){let a=new Set(ji),t=[];for(let r of s){if(I(r),!a.has(r))throw new RangeError(Cl(r));a.delete(r),t.push(r)}return i.fields(t)},mergeFields:({o:i},s,a)=>i.mergeFields(hr(wr(s)),hr(wr(a)))},[So]=Ni("Calendar",(i)=>{let s=Ud(i);return{branding:"Calendar",id:s,o:qs(s)}},{id:(i)=>i.id},_m,{from(i){let s=k(i);return typeof s=="string"?new So(s):s}}),Ng=jm(Object.keys(_m).slice(4)),[Wg,U]=Ni(Yi,O(cf,k,j),{...zm,...Ca,...Sm(bo),...Sm(Do),offset:(i)=>Os(uo(i).offsetNanoseconds),offsetNanoseconds:(i)=>uo(i).offsetNanoseconds,timeZoneId:(i)=>K(i.timeZone),hoursInDay:(i)=>Rc(M,i)},{getISOFields:(i)=>id(_,i),getCalendar:Ia,getTimeZone:({timeZone:i})=>typeof i=="string"?new Kt(i):i,with(i,s,a){return U(kd(Wa,M,i,this,ta(s),a))},withCalendar:(i,s)=>U($t(i,k(s))),withTimeZone:(i,s)=>U(Wf(i,j(s))),withPlainDate:(i,s)=>U(zf(M,i,oi(s))),withPlainTime:(i,s)=>U(If(M,i,To(s))),add:(i,s,a)=>U(Qr($s,M,0,i,z(s),a)),subtract:(i,s,a)=>U(Qr($s,M,1,i,z(s),a)),until:(i,s,a)=>L(x(Pl(Ci,M,0,i,sa(s),a))),since:(i,s,a)=>L(x(Pl(Ci,M,1,i,sa(s),a))),round:(i,s)=>U(Uc(M,i,s)),startOfDay:(i)=>U(Hc(M,i)),equals:(i,s)=>Ld(i,sa(s)),toInstant:(i)=>li(hf(i)),toPlainDateTime:(i)=>V(xl(_,i)),toPlainDate:(i)=>C($l(_,i)),toPlainTime:(i)=>ds(nl(_,i)),toPlainYearMonth(i){return fs(Tf(At,i,this))},toPlainMonthDay(i){return aa(Pf(Vt,i,this))},toLocaleString(i,s,a={}){let[t,r]=lg(s,a,i);return t.format(r)},toString:(i,s)=>Er(_,i,s),toJSON:(i)=>Er(_,i),valueOf:ms},{from:(i,s)=>U(sa(i,s)),compare:(i,s)=>gl(sa(i),sa(s))}),Eg=Object.defineProperties({},{...ea("Temporal.Now"),...ws({timeZoneId:()=>Hi(),instant:()=>li(Y(Sa())),zonedDateTime:(i,s=Hi())=>U(Q(Sa(),j(s),k(i))),zonedDateTimeISO:(i=Hi())=>U(Q(Sa(),j(i),y)),plainDateTime:(i,s=Hi())=>V(E(As(_(j(s))),k(i))),plainDateTimeISO:(i=Hi())=>V(E(As(_(j(i))),y)),plainDate:(i,s=Hi())=>C(J(As(_(j(s))),k(i))),plainDateISO:(i=Hi())=>C(J(As(_(j(i))),y)),plainTimeISO:(i=Hi())=>ds(Li(As(_(j(i)))))})}),Xi=Object.defineProperties({},{...ea("Temporal"),...ws({PlainYearMonth:Fg,PlainMonthDay:Pg,PlainDate:Mg,PlainTime:yg,PlainDateTime:vg,ZonedDateTime:Wg,Instant:bg,Calendar:So,TimeZone:Kt,Duration:zg,Now:Eg})}),Jg=eu(),vo=new WeakMap,Ug=Object.defineProperties(Object.create(Intl),ws({DateTimeFormat:Jg}));class ns extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class Mo{createSession(){throw new ns}deleteSession(){throw new ns}findSession(){throw new ns}findUserByEmailAddress(){throw new ns}updateSession(){throw new ns}createUser(){throw new ns}}class Ym extends R{schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class Xm extends R{schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Km extends R{schema={email:{required:"Email is required",email:"Invalid email"}}}class Am extends R{schema={password:{required:"Password is required",password:"Invalid password"}}}class Ki extends Bm{provider=oa.use().provider;async me(){let i=await Ai.user();if(!i)throw new Gm;return i}async verifyEmail(i=new R){let s=await i.input(),a=await this.provider.adapter.findUserByVerificationToken(s.get("token"));if(!a)return{email:null};if(await this.provider.adapter.verifyUser(a.id),a)return{email:a.email};return{email:null}}async signIn(i=new Ym){let s=await i.input.call(i),{email:a,password:t}=s.toJSON(),r=await this.provider.adapter.findUserByEmailAddress(a,this.provider.verifyEmail);if(!r)throw new ps({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(t,r.password))throw new ps({invalid_credentials:["Invalid credentials"]});let o=i.headers.get("User-Agent"),c=new Bun.CryptoHasher("sha256");c.update(`${r.email}${o}`);let d=c.digest("hex"),f=await this.provider.adapter.findSession({token:d,userAgent:i.headers.get("User-Agent")});if(!f)f=await this.provider.adapter.createSession({token:d,userId:r.id,userAgent:i.headers.get("User-Agent"),expiresAt:new Date(Xi.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(Xi.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else f=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(Xi.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return i.ctx.setCookie("access_token",f.token,{expires:f.expiresAt}),await this.provider.onSignIn(r),r}async signUp(i=new Xm){let s=await i.input(),{email:a,password:t,name:r,invitationId:l}=s.toJSON();if(await this.provider.adapter.findUserByEmailAddress(a,!1))throw new ps({email:["Email address already exists"]});let c=await this.provider.hashPassword(t),d=gs.use().detectLocale(i),f;if(l){if(f=await this.provider.adapter.findInvitation(l,a),f)await this.provider.adapter.deleteInvitationById(l)}let m,p;if(f)m=await this.provider.adapter.createUser({email:a,name:r,password:c,emailVerifiedAt:new Date,locale:d}),await this.provider.adapter.createAccount({organizationId:f.organizationId,userId:m.id,organizationRole:f.role});else p=await this.provider.generateEmailVerificationToken(a),m=await this.provider.adapter.createUser({email:a,name:r,password:c,verificationToken:p,locale:d});return await this.provider.onSignUp(m,p),m}async signOut(i=new R){let s=i.cookies.get("access_token"),a=await Ai.user();return await this.provider.adapter.deleteSession({token:s}),i.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(a),{}}async forgotPassword(i=new Km){let s=await i.input(),{email:a}=s.toJSON(),t=await this.provider.adapter.findUserByEmailAddress(a,this.provider.verifyEmail);if(!t)return{};let r=await this.provider.generateForgotPasswordToken(t);return await this.provider.adapter.createPasswordResetToken({user:t,token:r}),await this.provider.onForgotPassword(t,r),{}}async resetPassword(i=new Am){let s=await i.input(),{password:a,token:t}=s.toJSON(),r=await this.provider.adapter.findPasswordResetToken({token:t});if(!r)throw new ps({token:["Invalid token"]});if(Xi.Instant.from(r.createdAt.toISOString()).add({hours:24}).until(Xi.Now.instant()).sign>=0)throw new ps({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:t});let o=await this.provider.adapter.findUserByEmailAddress(r.user.email,this.provider.verifyEmail);if(!o)throw new ps({email:["User not found"]});let c=await this.provider.hashPassword(a);return await this.provider.adapter.updateUserPassword({id:o.id,password:c}),await this.provider.adapter.deleteAllUserSessions(o.id),await this.provider.onResetPassword(o),{}}async changePassword(i=new R){let s=await Ai.user(),a=await i.input(),{oldPassword:t,newPassword:r}=a.toJSON(),{password:l}=await this.provider.adapter.findUserByEmailAddress(s.email,this.provider.verifyEmail);if(!await this.provider.verifyPassword(t,l))throw new ps({oldPassword:["Incorrect password"]});let c=await this.provider.hashPassword(r);return await this.provider.adapter.updateUserPassword({id:s.id,password:c}),await this.provider.adapter.deleteAllUserSessions(s.id),{}}}class Lo extends zs{middlewares=["cache:private"];routes={"/sign-in":this.post(Ki,"signIn"),"/sign-up":this.post(Ki,"signUp"),"/sign-out":this.post(Ki,"signOut"),"/forgot-password":this.post(Ki,"forgotPassword"),"/reset-password":this.post(Ki,"resetPassword"),"/change-password":this.post(Ki,"changePassword"),"/verify-email":this.post(Ki,"verifyEmail"),"/me":this.get(Ki,"me").middleware(["auth"])}}class _g extends Rm{middlewares=["cache:public"];routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class Bg extends Hm{basePath="/auth";verifyEmail=!0;sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new Mo;boot(){}async verifyPassword(i,s){return await Bun.password.verify(i,s)}async hashPassword(i){return await Bun.password.hash(i)}async generateForgotPasswordToken(i){let s=new Bun.CryptoHasher("sha256");return s.update(`${i.email}${Date.now()}`),s.digest("hex")}generateEmailVerificationToken(i){if(!this.verifyEmail)return"";let s=new Bun.CryptoHasher("sha256");return s.update(`${i}${Date.now()}`),s.digest("hex")}extendSession(i){return{}}onSignUp(i,s){}onSignIn(i){}onSignOut(i){}onForgotPassword(i,s){}onResetPassword(i){}}import{mkdir as Rg,exists as Hg,readdir as Gg}from"fs/promises";class bi extends hi{i;static _name="LoggingServiceContainer";writer;isReady=!1;logsDirPath=`${process.env.ROOT_DIR}/storage/logs`;flushTimeout;fileSize=0;writerSize=0;isCreatingFile=!1;currentLogFilePath;constructor(i){super();this.service=i;this.boot().then(()=>{this.isReady=!0})}async boot(){if(!process.env.ROOT_DIR)return;if(!await Hg(this.logsDirPath))await Rg(this.logsDirPath);this.newLogFile()}async newLogFile(){if(this.isCreatingFile=!0,this.currentLogFilePath){this.writer.flush(),this.writer.end(),this.writer=null;let a=new File([await Bun.file(this.currentLogFilePath).arrayBuffer()],this.currentLogFilePath.split("/").pop(),{type:"text/plain"});this.service.onLogFileClosed(a),this.fileSize=0,this.writerSize=0}let s=(await Gg(this.logsDirPath)).sort().reverse()[0];if(s){let a=Bun.file(`${this.logsDirPath}/${s}`);if(a.size<this.service.maxFileSize)this.currentLogFilePath=`${this.logsDirPath}/${s}`,this.writer=a.writer(),this.writer.write(await a.text()),this.writer.write("\n"),this.writer.flush(),this.fileSize=a.size}if(!this.writer){let a=`${new Date(Date.now()).toISOString()}.log`.replaceAll(":","-");this.currentLogFilePath=`${this.logsDirPath}/${a}`;let t=Bun.file(`${this.logsDirPath}/${a}`);this.writer=t.writer(),this.fileSize=0,this.writerSize=0}this.isCreatingFile=!1}async log(i,s,a={}){if(!this.isReady)await new Promise((c)=>{let d=setInterval(()=>{if(this.isReady)c({}),clearInterval(d)},100)});let t=ci.getStore(),r={};if(t)r={url:t.req.rawRequest.url,method:t.req.rawRequest.method,headers:t.req.rawRequest.headers,body:t.req.rawRequest.body};let l={timestamp:new Date(Date.now()).toISOString(),env:"production",level:i,message:s,metadata:{...r,...a}},o="";try{o=JSON.stringify(l)}catch(c){throw new Error("Metadata must be a valid JSON object")}this.writerSize+=o.length,this.fileSize+=o.length,this.writer.write(o),this.writer.write("\n"),kt.channel("/logs/live",{}).publish(JSON.stringify(l)),this.service.onLogCreated(l),this.tryFlush()}async tryFlush(){if(this.fileSize>this.service.maxFileSize){if(!this.isCreatingFile)await this.newLogFile()}if(this.writerSize>this.service.maxFileSize/2)await this.writer.flush(),this.writerSize=0,await this.newLogFile();else clearTimeout(this.flushTimeout),this.flushTimeout=setTimeout(async()=>{await this.writer.flush(),this.writerSize=0},100)}}class jo extends zs{middlewares=["cache:private,0"];routes={"/live":this.get(async()=>{let i=Bun.file(bi.use().currentLogFilePath);return new Response(await i.text(),{headers:{"Content-Type":"text/plain"}})})}}function Yg(i){let s=new Map;for(let a of i)if(typeof a==="string"){let[t,r=""]=a.split(":");if(t.startsWith("-")){if(s.has(t.replace("-","")))s.delete(t.replace("-",""))}else s.set(t,r.split(",").filter(Boolean))}else s.set(a,[]);return s}class Zo extends hi{i;static _name="MiddlewareServiceContainer";constructor(i){super();this.service=i}runMiddleware(i){let s=new R;return Array.from(Yg(i).entries()).map(([a,t])=>{if(typeof a==="string"){let r=this.service.aliases[a];if(r){let l=new r(s);return()=>l.run.call(l,...t)}}else{if(Qm(a)){let r=new a(s);return r.run.bind(r)}return a}}).filter(Boolean).reduce((a,t)=>{return async()=>{return{...await a(),...await t()}}},()=>Promise.resolve({}))()}}function Vm(i){return i.replace(/-([a-z])/g,(s)=>s[1].toUpperCase())}function Xg(i){if("__brand"in i)return i.__brand==="ApiRouter";return!1}function xo(i,s=""){let a={};for(let[t,r]of Object.entries(i))if("run"in r){let l=r;if(!a[t])a[t]={};let{method:o,middlewares:c}=l,d=l.run.bind(l);a[t][o]={exec:d,middleware:c}}else if(typeof r==="function"){let l={},o=[];if(Xg(r)){let d=new r;l=d.routes,o=[d.middleware,...d.middlewares]}else{let[d]=(t==="/"?s:t).split("/").reverse();if(d==="")throw new Error(`"${t}" is not valid for a resource route`);if(d.includes(":"))throw new Error(`Last segment of a resource route has to be static. See "${t}"`);l=r(`${Vm(d)}Id`)}let c=xo(l,t);for(let[d,f]of Object.entries(c)){let m=d==="/"?"":d,p=t==="/"?"":t,u=`${p}${m}`===""?"/":`${p}${m}`;if(!a[u])a[u]={};for(let[g,h]of Object.entries(f))a[u][g]={exec:h.exec,middleware:[...o,...h.middleware]}}}else for(let l of Object.values(r)){if(!a[t])a[t]={};let{method:o,middlewares:c}=l,d=l.run.bind(l);a[t][o]={exec:d,middleware:c}}return Object.fromEntries(Object.entries(a).sort(([t],[r])=>{let l=t.split("/").length+t.split(":").length,o=r.split("/").length+r.split(":").length;return l-o}))}class no extends hi{i;static _name="ApiRouterServiceContainer";flatRoutes={};constructor(i){super();this.service=i;this.flatRoutes=xo({"/":this.service.rootRouter.bind(this.service),"/auth":Lo,"/__gemi__/services/i18n":et,"/__gemi__/services/logs":jo})}getRouteHandlerAndParams(i){let a=new URL(i.url).pathname.replace("/api",""),t={},r;for(let[l]of Object.entries(this.flatRoutes))try{let o=new URLPattern({pathname:l});if(o.test({pathname:a})){r=l,t=o.exec({pathname:a})?.pathname.groups;break}}catch(o){console.error(o)}return{params:t,path:r}}async runRouteMiddleware(i,s){let t=this.flatRoutes[i][s.rawRequest.method].middleware;try{await Zo.use().runMiddleware(t)}catch(r){if(r.kind===$o){if(s.rawRequest.url.includes("/api")){let{status:l=400,data:o,headers:c}=r.payload.api;return new Response(JSON.stringify(o),{status:l,headers:{"Content-Type":"application/json",...c}})}}else throw this.service.onRequestFail(s,r),console.error(r),r}}async getRouteData(i){let s=this.flatRoutes[i],a=ci.getStore(),t=s[a.req.rawRequest.method].exec??(()=>Promise.resolve({})),r={};try{r=await t()}catch(l){if(l.kind===$o){let{status:o=400,data:c,headers:d}=l.payload.api;return new Response(JSON.stringify(c),{status:o,headers:{"Content-Type":"application/json",...d}})}else throw this.service.onRequestFail(a.req,l),console.error(l),l}return r}async handleApiRequest(i){let{params:s,path:a}=this.getRouteHandlerAndParams(i),t=this.flatRoutes[a];if(!t||!t[i.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});let r=new R(i,s,"api",a);if(!i.url.includes("/__gemi__"))this.service.onRequestStart(r);return await ci.run(r,async()=>{let l=ci.getStore();l.setRequest(r);let o=await this.runRouteMiddleware(a,r);if(o instanceof Response)return o;let c=await this.getRouteData(a);if(c instanceof Response)return c;let d=l.headers;if(d.append("Content-Type","application/json"),l.cookies.forEach((f)=>d.append("Set-Cookie",f.toString())),l.destroy(),!i.url.includes("/__gemi__"))this.service.onRequestEnd(r);return new Response(JSON.stringify(c),{headers:d})})}}class qt{static prepare(i,...s){let a={params:{},search:{}},[t={}]=s,{search:r,params:l}={...a,...t},o=ci.getStore();if(o.req.kind==="api")throw new Error("Query.prefetch() cannot be called from an API request");let c=o.req.rawRequest,d=new URL(c.url),f=new URLSearchParams(Uo(r));f.delete("json"),f.sort();let m=[`${xi(i,l)}`,f.toString()].filter((P)=>P.length>0).join("?"),p=`${d.origin}/${m}`,u=new Request(p,{headers:c.headers}),g=new R(u,l),h=(P)=>{o.prefetchedResources.set(xi(i,l),{[f.toString()]:P})},T=()=>{return ci.run(g,async()=>{let P=await no.use().getRouteData(i);return h(P),P})};return{instant:T,prefetch:()=>{o.prefetchPromiseQueue.add(T)}}}static instant(i,...s){return qt.prepare(i,...s).instant()}static prefetch(i,...s){return qt.prepare(i,...s).prefetch()}}class kt{static channel(i,s){let a=Is.use().service.channels[i];if(!a)return console.error(`Channel ${i} not found`),{publish:()=>{}};let t=new a;return{publish:(r,l=!1)=>{let o=xi(i,s);Is.use().publish(o,JSON.stringify({topic:o,data:t.publish(r)}),l)}}}}class km{static absolute(i,...s){return`${process.env.HOST_NAME}${xi(String(i),s[0]??{})}`}static relative(i,...s){return xi(String(i),s[0]??{})}}class qm{static debug(i,s){bi.use().log("debug",i,s)}static info(i,s){bi.use().log("info",i,s)}static notice(i,s){bi.use().log("notice",i,s)}static warning(i,s){bi.use().log("warning",i,s)}static error(i,s){bi.use().log("error",i,s)}static critical(i,s){bi.use().log("critical",i,s)}static alert(i,s){bi.use().log("alert",i,s)}static emergency(i,s){bi.use().log("emergency",i,s)}}export{km as Url,Co as Redirect,qt as Query,qm as Log,Wo as I18n,Jo as FileStorage,kt as Broadcast,Ai as Auth};export{Is as f,gs as g,ca as h,bi as i,Bg as j,Zo as k,no as l};
3
3
 
4
- //# debugId=94E379A67D356FA964756E2164756E21
4
+ //# debugId=9B4799E35024E08264756E2164756E21