gemi 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/app/index.js +77 -77
  2. package/dist/app/index.js.map +4 -4
  3. package/dist/bin/gemi.js +142 -512
  4. package/dist/bin/gemi.js.map +4 -4
  5. package/dist/broadcasting/index.js +1 -1
  6. package/dist/{chunk-wvyxxxz7.js → chunk-00q77h4a.js} +2 -2
  7. package/dist/{chunk-wvyxxxz7.js.map → chunk-00q77h4a.js.map} +1 -1
  8. package/dist/{chunk-c3s0zqhy.js → chunk-0mfpz0sr.js} +2 -2
  9. package/dist/{chunk-c3s0zqhy.js.map → chunk-0mfpz0sr.js.map} +1 -1
  10. package/dist/chunk-0vq2p4bq.js +4 -0
  11. package/dist/{chunk-wwkrdyb4.js.map → chunk-0vq2p4bq.js.map} +6 -6
  12. package/dist/{chunk-azy2vwhc.js → chunk-0wa1m3yq.js} +3 -3
  13. package/dist/{chunk-azy2vwhc.js.map → chunk-0wa1m3yq.js.map} +1 -1
  14. package/dist/{chunk-1rrb8c0v.js → chunk-0wr6m6f4.js} +3 -3
  15. package/dist/{chunk-1rrb8c0v.js.map → chunk-0wr6m6f4.js.map} +1 -1
  16. package/dist/{chunk-6yvggc3x.js → chunk-3nzz6kqw.js} +2 -2
  17. package/dist/{chunk-6yvggc3x.js.map → chunk-3nzz6kqw.js.map} +1 -1
  18. package/dist/chunk-3q85w7aa.js +4 -0
  19. package/dist/{chunk-catb1gz8.js.map → chunk-3q85w7aa.js.map} +1 -1
  20. package/dist/{chunk-dmnc50py.js → chunk-4e18rqet.js} +2 -2
  21. package/dist/{chunk-dmnc50py.js.map → chunk-4e18rqet.js.map} +1 -1
  22. package/dist/{chunk-8ctxajfc.js → chunk-5q5qjyxf.js} +2 -2
  23. package/dist/{chunk-8ctxajfc.js.map → chunk-5q5qjyxf.js.map} +1 -1
  24. package/dist/{chunk-334phrqw.js → chunk-67ytmbmn.js} +3 -3
  25. package/dist/{chunk-334phrqw.js.map → chunk-67ytmbmn.js.map} +1 -1
  26. package/dist/{chunk-6pv9ngqe.js → chunk-68kvbrqd.js} +2 -2
  27. package/dist/{chunk-6pv9ngqe.js.map → chunk-68kvbrqd.js.map} +1 -1
  28. package/dist/{chunk-ebcx322z.js → chunk-6fy0y9na.js} +2 -2
  29. package/dist/{chunk-ebcx322z.js.map → chunk-6fy0y9na.js.map} +1 -1
  30. package/dist/chunk-6kfbsmxx.js +4 -0
  31. package/dist/{chunk-6cjfy81h.js.map → chunk-6kfbsmxx.js.map} +3 -3
  32. package/dist/chunk-6pwjkfk5.js +4 -0
  33. package/dist/{chunk-rahb5fwx.js.map → chunk-6pwjkfk5.js.map} +1 -1
  34. package/dist/{chunk-yrxxkmag.js → chunk-95b1a8cw.js} +2 -2
  35. package/dist/{chunk-yrxxkmag.js.map → chunk-95b1a8cw.js.map} +1 -1
  36. package/dist/chunk-9aswnsye.js +4 -0
  37. package/dist/chunk-9aswnsye.js.map +10 -0
  38. package/dist/chunk-acfdk70y.js +27 -0
  39. package/dist/{chunk-na4qm9jr.js.map → chunk-acfdk70y.js.map} +3 -3
  40. package/dist/{chunk-nnxgdzqx.js → chunk-cgh2sw3g.js} +2 -2
  41. package/dist/{chunk-nnxgdzqx.js.map → chunk-cgh2sw3g.js.map} +1 -1
  42. package/dist/{chunk-2wsmhvhf.js → chunk-fe1gn043.js} +2 -2
  43. package/dist/{chunk-2wsmhvhf.js.map → chunk-fe1gn043.js.map} +1 -1
  44. package/dist/{chunk-1gfsxd5v.js → chunk-jn8jhrkd.js} +2 -2
  45. package/dist/{chunk-1gfsxd5v.js.map → chunk-jn8jhrkd.js.map} +1 -1
  46. package/dist/chunk-jwebzy40.js +5 -0
  47. package/dist/{chunk-g8b20w5m.js.map → chunk-jwebzy40.js.map} +3 -3
  48. package/dist/chunk-jxftkhsd.js +4 -0
  49. package/dist/chunk-jxftkhsd.js.map +10 -0
  50. package/dist/{chunk-xm62byj2.js → chunk-m2p40y0k.js} +2 -2
  51. package/dist/{chunk-xm62byj2.js.map → chunk-m2p40y0k.js.map} +1 -1
  52. package/dist/{chunk-5yz4jjwj.js → chunk-mtbjk5px.js} +2 -2
  53. package/dist/{chunk-5yz4jjwj.js.map → chunk-mtbjk5px.js.map} +1 -1
  54. package/dist/{chunk-wnq14j8v.js → chunk-nxrhps23.js} +2 -2
  55. package/dist/{chunk-wnq14j8v.js.map → chunk-nxrhps23.js.map} +1 -1
  56. package/dist/chunk-pvxzx61f.js +5 -0
  57. package/dist/chunk-pvxzx61f.js.map +53 -0
  58. package/dist/{chunk-4wgjccxt.js → chunk-qcr71k85.js} +2 -2
  59. package/dist/{chunk-4wgjccxt.js.map → chunk-qcr71k85.js.map} +1 -1
  60. package/dist/{chunk-jfsxm8sz.js → chunk-rre72epn.js} +3 -3
  61. package/dist/{chunk-jfsxm8sz.js.map → chunk-rre72epn.js.map} +1 -1
  62. package/dist/chunk-svh4hjg3.js +4 -0
  63. package/dist/{chunk-ja250f5w.js.map → chunk-svh4hjg3.js.map} +3 -3
  64. package/dist/{chunk-ws63sddd.js → chunk-tw3t6x2n.js} +3 -3
  65. package/dist/{chunk-ws63sddd.js.map → chunk-tw3t6x2n.js.map} +1 -1
  66. package/dist/{chunk-kaa6sxg2.js → chunk-tyv9h73f.js} +3 -3
  67. package/dist/{chunk-kaa6sxg2.js.map → chunk-tyv9h73f.js.map} +1 -1
  68. package/dist/{chunk-akw359wq.js → chunk-wbg45cdc.js} +3 -3
  69. package/dist/{chunk-akw359wq.js.map → chunk-wbg45cdc.js.map} +1 -1
  70. package/dist/chunk-wewz52mc.js +3 -0
  71. package/dist/{chunk-skkyvmp4.js.map → chunk-wewz52mc.js.map} +4 -7
  72. package/dist/{chunk-47xbr7nj.js → chunk-yvrp97kk.js} +3 -3
  73. package/dist/{chunk-47xbr7nj.js.map → chunk-yvrp97kk.js.map} +1 -1
  74. package/dist/client/ProgressManager.d.ts +1 -1
  75. package/dist/client/index.js +18485 -18166
  76. package/dist/client/index.js.map +1 -1
  77. package/dist/email/index.js +2 -2
  78. package/dist/email/index.js.map +1 -1
  79. package/dist/facades/index.js +4 -4
  80. package/dist/facades/index.js.map +5 -4
  81. package/dist/http/HttpRequest.d.ts +1 -1
  82. package/dist/http/index.js +2 -2
  83. package/dist/http/index.js.map +4 -5
  84. package/dist/i18n/I18nRouter.d.ts +10 -0
  85. package/dist/i18n/I18nRouter.d.ts.map +1 -0
  86. package/dist/i18n/I18nServiceContainer.d.ts +1 -1
  87. package/dist/i18n/I18nServiceContainer.d.ts.map +1 -1
  88. package/dist/i18n/I18nServiceProvider.d.ts +2 -1
  89. package/dist/i18n/I18nServiceProvider.d.ts.map +1 -1
  90. package/dist/i18n/index.js +1 -1
  91. package/dist/kernel/index.js +2 -2
  92. package/dist/kernel/index.js.map +2 -2
  93. package/dist/server/index.js +2 -2
  94. package/dist/server/index.js.map +1 -1
  95. package/dist/services/index.js +73 -62
  96. package/dist/services/index.js.map +19 -7
  97. package/package.json +2 -2
  98. package/dist/chunk-3ram01pg.js +0 -4
  99. package/dist/chunk-3ram01pg.js.map +0 -10
  100. package/dist/chunk-6cjfy81h.js +0 -4
  101. package/dist/chunk-catb1gz8.js +0 -4
  102. package/dist/chunk-ecfnwya3.js +0 -4
  103. package/dist/chunk-ecfnwya3.js.map +0 -10
  104. package/dist/chunk-g8b20w5m.js +0 -5
  105. package/dist/chunk-ja250f5w.js +0 -4
  106. package/dist/chunk-na4qm9jr.js +0 -27
  107. package/dist/chunk-qpm7mvjd.js +0 -5
  108. package/dist/chunk-qpm7mvjd.js.map +0 -53
  109. package/dist/chunk-rahb5fwx.js +0 -4
  110. package/dist/chunk-skkyvmp4.js +0 -4
  111. package/dist/chunk-wwkrdyb4.js +0 -4
  112. package/dist/http/I18nServiceContainer.d.ts +0 -27
  113. package/dist/http/I18nServiceContainer.d.ts.map +0 -1
  114. package/dist/http/I18nServiceProvider.d.ts +0 -12
  115. package/dist/http/I18nServiceProvider.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{uc as Pt,wc as Mn}from"../chunk-2wsmhvhf.js";import{xc as En}from"../chunk-catb1gz8.js";import{zc as bs}from"../chunk-wnq14j8v.js";import"../chunk-ebcx322z.js";class Xr{static kind="controller";constructor(){}}class Ea extends Xr{}function Dn(t){return typeof t==="function"&&t.prototype!==void 0}function zu(t){return Dn(t)}class pt{method;handler;methodName;__internal_brand="RouteHandler";middlewares=[];constructor(t,s,a){this.method=t;this.handler=s;this.methodName=a;this.handler=s,this.methodName=a,this.method=t}__internal_use(){return{run:this.run.bind(this),middlewares:this.middlewares}}run(t){if(zu(this.handler)){let s=new this.handler;return s[this.methodName].bind(s)()}return this.handler()}middleware(t){return this.middlewares=t,this}}class In{constructor(...t){return new pt(...t)}}class ta{static __brand="ApiRouter";routes={};middlewares=[];middleware(t){}get(t,s){return new pt("GET",t,s)}post(t,s){return new pt("POST",t,s)}put(t,s){return new pt("PUT",t,s)}patch(t,s){return new pt("PATCH",t,s)}delete(t,s){return new pt("DELETE",t,s)}resource(t){return{first:{get:new pt("GET",t,"list"),post:new pt("POST",t,"store")},second:{get:new pt("GET",t,"show"),put:new pt("PUT",t,"update"),delete:new pt("DELETE",t,"delete")}}}file(t,s){return new In("GET",t,s)}}class Sn extends Ea{async list(){}async show(){}async store(){}async update(){}async delete(){}}class Bu extends ta{routes={"/:orgId/products/:productId":this.resource(Sn)}}class Kn{kind="redirect";viewPath="REDIRECT";middlewares=[];handler;constructor(t){if(!t)this.handler=()=>({});else if(typeof t==="function")this.handler=t;else{let[s,a]=t,r=new s,o=r[a].bind(r);this.handler=(i)=>{return o()}}}async run(t,s){let{destination:a,permanent:r=!1,status:o=307}=await this.handler(t);if(!a)throw new Error(`Redirect destination is required see ${s}`);return Mn.to(a,{permanent:r,status:o}),{}}middleware(t){return this.middlewares=t,this}}class An{viewPath;middlewares=[];handler;constructor(t,s){this.viewPath=t;if(!s)this.handler=()=>({});else if(typeof s==="function")this.handler=s;else{let[a,r]=s,o=new a,i=o[r].bind(o);this.handler=(n)=>{return i()}}}async run(t,s){let a=await this.handler(t);return{[this.viewPath]:{...a,breadcrumb:{label:a?.breadcrumb??"",href:s}}}}middleware(t){return this.middlewares=t,this}}class vn{viewPath;children;middlewares=[];handler=()=>({});constructor(t,s,a){this.viewPath=t;if(typeof s==="function")this.handler=s,this.children=class extends sa{routes=a??{}};else if(Array.isArray(s)){let[r,o]=s,i=new r,n=i[o].bind(i);this.handler=(e)=>{return n(e)},this.children=class extends sa{routes=a??{}}}else this.children=class extends sa{routes=s},this.handler=()=>({})}async run(t,s){let a=await this.handler(t);return{[this.viewPath]:{...a,breadcrumb:{label:a?.breadcrumb??"",href:s}}}}middleware(t){return this.middlewares=t,this}}class sa{middlewares=[];routes={};view(t,s){return new An(t,s)}redirect(t){return new Kn(t)}layout(t,s,a){return new vn(t,s,a)}}class aa extends Pt{errors={};constructor(t){super("Validation error");this.name="ValidationError",this.errors=t,this.payload={api:{status:400,data:{error:{kind:"validation_error",messages:t}},headers:{"Content-Type":"application/json"}},view:{status:400}}}}class Ju extends ta{middlewares=["cache:private,0,no-store"];routes={"/translations/:locale/:scope*":this.get(async()=>{let t=new es,s=`/${t.params.scope??""}`,r=t.params.locale??ra.use().detectLocale(t),o=ra.use().getPageTranslations(r,s);return t.ctx().setCookie("i18n-locale",r,{expires:new Date(Date.now()+31536000000)}),{[r]:o}})}}class ra extends bs{service;static _name="I18nServiceContainer";isEnabled=!1;translations=new Map;supportedLocales=[];constructor(t){super();this.service=t;let s=new Map;for(let[r,o]of Object.entries(this.service.dictionary))for(let[i,n]of Object.entries(o))for(let[e,l]of Object.entries(n)){let d=e==="default"?this.service.defaultLocale:e;if(!s.has(`${d}.${r}`))s.set(`${d}.${r}`,new Map);s.get(`${d}.${r}`)?.set(i,l),this.isEnabled=!0}let a=new Set(t.supportedLocales);for(let[r,o]of s.entries()){this.translations.set(r,Object.fromEntries(o.entries()));let[i]=r.split(".");if(!a.has(i))a.add(i)}this.supportedLocales=Array.from(a)}detectLocale(t){let s=this.service.detectLocale(t);if(this.supportedLocales.includes(s))return s;let r=t.cookies.get("i18n-locale")??(t.headers.get("accept-language")||"en-US"),[o]=r.split(",");if(this.supportedLocales.includes(o))return o;if(o.length===2){for(let n of this.supportedLocales)if(n.startsWith(o))return n}let i=this.service.defaultLocale??this.supportedLocales[0];if(i)return i;return"en-US"}getPageTranslations(t,s){if(!s)return{};let a=this.translations.get(`${t}.view:${s}`)??{},r={[`view:${s}`]:a};for(let[o]of this.translations.entries()){let i=o.split(".")[1];if(!i.startsWith("layout:"))continue;let n=i.split(":")[1];if(s?.startsWith(n))r[i]=this.translations.get(`${t}.${i}`)??{}}return r}}import{AsyncLocalStorage as Xu}from"async_hooks";class Fa{name;value;options;constructor(t,s,a={}){this.name=t;this.value=s;this.options=a}toString(){return[`${this.name}=${this.value}`,this.options.maxAge?`Max-Age=${this.options.maxAge}`:"",this.options.httpOnly?"HttpOnly":"",this.options.secure?"Secure":"",this.options.sameSite?`SameSite=${this.options.sameSite}`:"SameSite=Strict",this.options.path?`Path=${this.options.path}`:"Path=/",this.options.domain?`Domain=${this.options.domain}`:"",this.options.expires?`Expires=${this.options.expires.toUTCString()}`:"",this.options.partitioned?"Partitioned":""].filter((t)=>t!=="").join("; ")}}var Qr=new Xu;class qn{req;cookies=new Set;headers=new Headers;prefetchedResources=new Map;prefetchPromiseQueue=new Set;user=null;csrfHmac=null;constructor(t){this.req=t}setCSRFHmac(t){this.csrfHmac=t}setCookie(t,s,a={}){this.cookies.add(new Fa(t,s,a))}deleteCookie(t){this.cookies.add(new Fa(t,"",{maxAge:-1}))}setHeaders(t,s){this.headers.set(t,s)}setUser(t){this.user=t}setRequest(t){this.req=t}destroy(){delete this.cookies,delete this.headers,delete this.prefetchedResources,delete this.prefetchPromiseQueue,delete this.user}}class Hs{static getStore(){return Qr.getStore()}static setRequest(t){Qr.getStore().req=t}static run(t,s){return Qr.run(new qn(t),s)}}class Ds{data;constructor(t){this.data=t}get(t){return this.data[t]}has(t){return this.data[t]!==void 0}toJSON(){return this.data}}function Qu(t){let[s,a]=t.match(/\d+|\D+/g)??[];if(!s||!a)return 0;let r=parseInt(s);switch(a){case"B":return r;case"KB":return r*1024;case"MB":return r*1024*1024;case"GB":return r*1024*1024*1024;case"TB":return r*1024*1024*1024*1024;default:return 0}}function Yu(t){switch(t){case"image":return"image";case"png":return"image/png";case"jpg":return"image/jpeg";case"jpeg":return"image/jpeg";case"ttf":return"font/ttf";case"excel":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"csv":return"text/csv";case"word":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"pdf":return"application/pdf";case"json":return"application/json";default:return t}}function tc(t){let[s,a]=t.split(":");switch(s){case"required":return(r)=>{if(r instanceof Blob)return r.size>0;return r!==null&&r!==void 0&&r?.length>0};case"password":return(r)=>{return/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/.test(r)};case"number":return(r)=>{if(typeof r!=="number")return!1;return!isNaN(r)};case"min":return(r)=>{return r?.length>=parseInt(a)};case"max":return(r)=>{return r?.length<=parseInt(a)};case"email":return(r)=>{return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)};case"file":return(r)=>{return r instanceof Blob};case"fileType":return(r)=>{if(r instanceof Blob){let o=Yu(a);return r.type.startsWith(o)}};case"fileSize":return(r)=>{if(r instanceof Blob){let o=Qu(a);return r.size<=o}};default:return()=>!0}}class es{kind;rawRequest;headers;cookies;search;schema={};routePath;params;constructor(t,s,a,r){if(!t){let n=Hs.getStore().req;this.params=n.params,this.rawRequest=n.rawRequest,this.kind=n.kind,this.routePath=n.routePath}else this.params=s,this.rawRequest=t,this.routePath=r,this.kind=a??"api";this.headers=this.rawRequest.headers;let o=this.rawRequest.headers.get("Cookie"),i=new Map;if(o){let n=o.split(";");for(let e of n){let[l,d]=e.split("=");i.set(l.trim(),d.trim())}}if(this.rawRequest.method==="GET"){let n=new URL(this.rawRequest.url),e=new Map;for(let[d,u]of n.searchParams)if(e.has(d)){let c=e.get(d);if(Array.isArray(c))c.push(u),e.set(d,c);else e.set(d,[c,u])}else e.set(d,u);let l=Object.fromEntries(e.entries());this.search=new Ds(l)}this.cookies=i}locale(){return ra.use().detectLocale(this)}ctx(){return Hs.getStore()}refine(t){return{}}async parseBody(){let t=new Ds({});if(this.rawRequest.headers.get("Content-Type")==="application/json"){let s=await this.rawRequest.json();t=new Ds(s)}if(this.rawRequest.headers.get("Content-Type")==="application/x-www-form-urlencoded"){let s=await this.rawRequest.formData();t=new Ds(s)}if(this.rawRequest.headers.get("Content-Type")?.startsWith("multipart/form-data")){let s=await this.rawRequest.formData(),a=new Map;for(let[r,o]of s.entries())if(a.has(r)){let i=a.get(r);if(Array.isArray(i))i.push(o),a.set(r,i);else a.set(r,[i,o])}else a.set(r,o);t=new Ds(Object.fromEntries(a.entries()))}return t}validateInput(t){let s={};for(let[a,r]of Object.entries(this.schema))for(let[o,i]of Object.entries(r)){let n=tc(o),e=i,l=!1;if(typeof i==="function")e=i(t.get(a)),l=typeof e==="undefined";else l=n(t.get(a));if(l)continue;if(!s[a])s[a]=[];if(o==="required"){s[a]=[String(e)];break}else s[a].push(String(e))}for(let[a,r]of Object.entries(this.refine(t.toJSON())??{})){if(!s[a])s[a]=[];s[a]=[...s[a]??[],r]}if(Object.keys(s).length>0)throw new aa(s);else return t}async input(){return this.validateInput(await this.parseBody())}async safeInput(){let t=await this.parseBody();try{return this.validateInput(t),{isValid:!0,errors:{},input:t}}catch(s){if(!(s instanceof aa))throw s;return{isValid:!1,errors:s.errors,input:t}}}}class mt{req;config={};constructor(t){this.req=t}run(...t){return{}}static configure(t){let s=this;return class extends s{config=t}}}function sc(t){let s=t.headers.get("cookie");if(!s)return new Map;let a=new Map,r=s.split(";");for(let o of r){let[i,n]=o.split("=");a.set(i.trim(),n)}return a}class Fn extends En{aliases={};boot(){}}class $n extends Pt{error;constructor(t="Not authorized"){super("Authentication error");this.name="AuthenticationError",this.error=t,this.payload={api:{status:401,data:{error:this.error}},view:{}}}}class Ln extends Pt{error;constructor(t="Insufficient permissions"){super("Authentication error");this.name="AuthenticationError",this.error=t,this.payload={api:{status:401,data:{error:this.error}},view:{}}}}class oa extends Pt{constructor(){super("Authentication error");this.name="AuthenticationError"}payload={api:{status:401,data:{error:"Authentication error"}},view:{status:302,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:"/auth/sign-in"}}}}import{randomBytes as Lm}from"crypto";function nt(t,s,a,r,o){return yt(s,te(t,s),a,r,o)}function yt(t,s,a,r,o,i){let n=ro(s,a,r);if(o&&s!==n)throw new RangeError($d(t,s,a,r,i));return n}function te(t,s){let a=t[s];if(a===void 0)throw new TypeError(vi(s));return a}function N(t){return t!==null&&/object|function/.test(typeof t)}function dt(t,s=Map){let a=new s;return(r,...o)=>{if(a.has(r))return a.get(r);let i=t(r,...o);return a.set(r,i),i}}function po(t){return cs({name:t},1)}function cs(t,s){return Ct((a)=>({value:a,configurable:1,writable:!s}),t)}function se(t){return Ct((s)=>({get:s,configurable:1}),t)}function Qa(t){return{[Symbol.toStringTag]:{value:t,configurable:1}}}function qs(t,s){let a={},r=t.length;for(let o of s)a[t[--r]]=o;return a}function Ct(t,s,a){let r={};for(let o in s)r[o]=t(s[o],o,a);return r}function ma(t,s,a){let r={};for(let o=0;o<s.length;o++){let i=s[o];r[i]=t(i,o,a)}return r}function ac(t,s,a){let r={};for(let o=0;o<t.length;o++)r[s[o]]=a[t[o]];return r}function ct(t,s){let a={};for(let r of t)a[r]=s[r];return a}function mo(t,s){let a={};for(let r in s)t.has(r)||(a[r]=s[r]);return a}function To(t){t={...t};let s=Object.keys(t);for(let a of s)t[a]===void 0&&delete t[a];return t}function ae(t,s){for(let a of s)if(!(a in t))return 0;return 1}function re(t,s,a){for(let r of t)if(s[r]!==a[r])return 0;return 1}function oe(t,s,a){let r={...a};for(let o=0;o<s;o++)r[t[o]]=0;return r}function w(t,...s){return(...a)=>t(...s,...a)}function jn(t){return t[0].toUpperCase()+t.substring(1)}function Ta(t){return t.slice().sort()}function Na(t,s){return String(s).padStart(t,"0")}function Gt(t,s){return Math.sign(t-s)}function ro(t,s,a){return Math.min(Math.max(t,s),a)}function Ft(t,s){return[Math.floor(t/s),na(t,s)]}function na(t,s){return(t%s+s)%s}function _t(t,s){return[Ya(t,s),ho(t,s)]}function Ya(t,s){return Math.trunc(t/s)||0}function ho(t,s){return t%s||0}function $a(t){return Math.abs(t%1)===0.5}function ie(t,s,a){let r=0,o=0;for(let e=0;e<=s;e++){let l=t[a[e]],d=St[e],u=O/d,[c,p]=_t(l,u);r+=p*d,o+=c}let[i,n]=_t(r,O);return[o+i,n]}function tr(t,s,a){let r={};for(let o=s;o>=0;o--){let i=St[o];r[a[o]]=Ya(t,i),t=ho(t,i)}return r}function ne(t){return t===x?qr:[]}function ee(t){return t===x?Oa:[]}function le(t){return t===x?["year","day"]:[]}function de(t){if(t!==void 0)return A(t)}function ue(t){if(t!==void 0)return Rt(t)}function fo(t){if(t!==void 0)return ha(t)}function Rt(t){return me(ha(t))}function ha(t){return pe(_c(t))}function Po(t){if(t==null)throw new TypeError("Cannot be null or undefined");return t}function ce(t,s){if(s==null)throw new RangeError(vi(t));return s}function Lt(t){if(!N(t))throw new TypeError(Fd);return t}function sr(t,s,a=t){if(typeof s!==t)throw new TypeError(xa(a,s));return s}function pe(t,s="number"){if(!Number.isInteger(t))throw new RangeError(yc(s,t));return t||0}function me(t,s="number"){if(t<=0)throw new RangeError(gc(s,t));return t}function yo(t){if(typeof t=="symbol")throw new TypeError(Rc);return String(t)}function Ga(t,s){return N(t)?String(t):A(t,s)}function ar(t){if(typeof t=="string")return BigInt(t);if(typeof t!="bigint")throw new TypeError(Cc(t));return t}function Te(t,s="number"){if(typeof t=="bigint")throw new TypeError(xc(s));if(t=Number(t),!Number.isFinite(t))throw new RangeError(wc(s,t));return t}function Q(t,s){return Math.trunc(Te(t,s))||0}function he(t,s){return pe(Te(t,s),s)}function Zn(t,s){return me(Q(t,s),s)}function go(t,s){let[a,r]=_t(s,O),o=t+a,i=Math.sign(o);return i&&i===-Math.sign(r)&&(o-=i,r+=i*O),[o,r]}function Ss(t,s,a=1){return go(t[0]+s[0]*a,t[1]+s[1]*a)}function Ms(t,s){return go(t[0],t[1]+s)}function Tt(t,s){return Ss(s,t,-1)}function tt(t,s){return Gt(t[0],s[0])||Gt(t[1],s[1])}function fe(t,s,a){return tt(t,s)===-1||tt(t,a)===1}function rr(t,s=1){let a=BigInt(O/s);return[Number(t/a),Number(t%a)*s]}function Ks(t,s=1){let a=O/s,[r,o]=_t(t,a);return[r,o*s]}function Pe(t,s=1){let[a,r]=t,o=Math.floor(r/s),i=O/s;return BigInt(a)*BigInt(i)+BigInt(o)}function ht(t,s=1,a){let[r,o]=t,[i,n]=_t(o,s);return r*(O/s)+(i+(a?n/s:0))}function wo(t,s,a=Ft){let[r,o]=t,[i,n]=a(o,s);return[r*(O/s)+i,n]}function xo(t,s){let a=t.formatToParts(s),r={};for(let o of a)r[o.type]=o.value;return r}function Co(t){return nt(t,"isoYear",pa,ca,1),t.isoYear===pa?nt(t,"isoMonth",4,12,1):t.isoYear===ca&&nt(t,"isoMonth",1,9,1),t}function Vt(t){return jt({...t,...xt,isoHour:12}),t}function jt(t){let s=nt(t,"isoYear",pa,ca,1),a=s===pa?1:s===ca?-1:0;return a&&ft(Y({...t,isoDay:t.isoDay+a,isoNanosecond:t.isoNanosecond-a})),t}function ft(t){if(!t||fe(t,tp,Yc))throw new RangeError(Mr);return t}function zt(t){return ie(t,5,Dt)[1]}function or(t){let[s,a]=Ft(t,O);return[tr(a,5,Dt),s]}function ye(t){return ge(t)[0]}function ge(t){return wo(t,wt)}function st(t){return Es(t.isoYear,t.isoMonth,t.isoDay,t.isoHour,t.isoMinute,t.isoSecond,t.isoMillisecond)}function Y(t){let s=st(t);if(s!==void 0){let[a,r]=_t(s,lt);return[a,r*Mt+(t.isoMicrosecond||0)*ws+(t.isoNanosecond||0)]}}function Ro(t,s){let[a,r]=or(zt(t)-s);return ft(Y({...t,isoDay:t.isoDay+r,...a}))}function Va(...t){return Es(...t)/zd}function Es(...t){let[s,a]=we(...t),r=s.valueOf();if(!isNaN(r))return r-a*lt}function we(t,s=1,a=1,r=0,o=0,i=0,n=0){let e=t===pa?1:t===ca?-1:0,l=new Date;return l.setUTCHours(r,o,i,n),l.setUTCFullYear(t,s-1,a+e),[l,e]}function Jt(t,s){let[a,r]=Ms(t,s);r<0&&(r+=O,a-=1);let[o,i]=Ft(r,Mt),[n,e]=Ft(i,ws);return ir(a*lt+o,n,e)}function ir(t,s=0,a=0){let r=Math.ceil(Math.max(0,Math.abs(t)-Qc)/lt)*Math.sign(t),o=new Date(t-r*lt);return qs(Fr,[o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate()+r,o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds(),s,a])}function xe(t){return[t.isoYear,t.isoMonth,t.isoDay]}function Ce(){return Et}function Oo(t,s){switch(s){case 2:return bo(t)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Re(t){return bo(t)?366:365}function bo(t){return t%4==0&&(t%100!=0||t%400==0)}function Oe(t){let[s,a]=we(t.isoYear,t.isoMonth,t.isoDay);return na(s.getUTCDay()-a,7)||7}function be({isoYear:t}){return t<1?["bce",1-t]:["ce",t]}function rc(t){let s=st(t);if(s<ap)return be(t);let a=xo(Xi(As),s),{era:r,eraYear:o}=Fl(a,As);return[r,o]}function nr(t){return ps(t),er(t,1),t}function ps(t){return He(t,1),t}function kn(t){return re(Ni,t,He(t))}function He(t,s){let{isoYear:a}=t,r=nt(t,"isoMonth",1,Ce(),s);return{isoYear:a,isoMonth:r,isoDay:nt(t,"isoDay",1,Oo(a,r),s)}}function er(t,s){return qs(Dt,[nt(t,"isoHour",0,23,s),nt(t,"isoMinute",0,59,s),nt(t,"isoSecond",0,59,s),nt(t,"isoMillisecond",0,999,s),nt(t,"isoMicrosecond",0,999,s),nt(t,"isoNanosecond",0,999,s)])}function C(t){return t===void 0?0:cu(Lt(t))}function fa(t,s=0){t=Ot(t);let a=pu(t),r=pp(t,s);return[cu(t),r,a]}function Ho(t){return pu(Ot(t))}function De(t){return t=Ot(t),Wi(t,9,6,1)}function Fs(t,s,a,r=9,o=0,i=4){s=Ot(s);let n=Wi(s,r,o),e=So(s),l=Ha(s,i),d=ba(s,r,o,1);return n==null?n=Math.max(a,d):Ke(n,d),e=Mo(e,d,1),t&&(l=((u)=>u<4?(u+2)%4:u)(l)),[n,d,e,l]}function lr(t,s=6,a){let r=So(t=Ko(t,Xa)),o=Ha(t,7),i=ba(t,s);return i=ce(Xa,i),r=Mo(r,i,void 0,a),[i,r,o]}function Do(t){return _i(Ot(t))}function Ie(t,s){return Io(Ot(t),s)}function Io(t,s=4){let a=Me(t);return[Ha(t,4),...Se(ba(t,s),a)]}function Se(t,s){return t!=null?[St[t],t<4?9-3*t:-1]:[s===void 0?1:10**(9-s),s]}function So(t){let s=t[ea];return s===void 0?1:Q(s,ea)}function Mo(t,s,a,r){let o=r?O:St[s+1];if(o){let i=St[s];if(o%((t=yt(ea,t,1,o/i-(r?0:1),1))*i))throw new RangeError(xa(ea,t))}else t=yt(ea,t,1,a?1e9:1,1);return t}function Me(t){let s=t[ao];if(s!==void 0){if(typeof s!="number"){if(yo(s)==="auto")return;throw new RangeError(xa(ao,s))}s=yt(ao,Math.floor(s),0,9,1)}return s}function Ot(t){return t===void 0?{}:Lt(t)}function Ko(t,s){return typeof t=="string"?{[s]:t}:Lt(t)}function F(t){if(t!==void 0){if(N(t))return Object.assign(Object.create(null),t);throw new TypeError(Fd)}}function dr(t,s){return t&&Object.assign(Object.create(null),t,{overflow:op[s]})}function Ao(t,s,a=9,r=0,o){let i=s[t];if(i===void 0)return o?r:void 0;if(i=yo(i),i==="auto")return o?r:null;let n=eo[i];if(n===void 0&&(n=Jc[i]),n===void 0)throw new RangeError(Zd(t,i,eo));return yt(t,n,r,a,1,Ra),n}function ms(t,s,a,r=0){let o=a[t];if(o===void 0)return r;let i=yo(o),n=s[i];if(n===void 0)throw new RangeError(Zd(t,i,s));return n}function Ke(t,s){if(s>t)throw new RangeError(Uc)}function G(t){return{branding:Lr,epochNanoseconds:t}}function z(t,s,a){return{branding:Nt,calendar:a,timeZone:s,epochNanoseconds:t}}function $(t,s=t.calendar){return{branding:Cs,calendar:s,...ct(eu,t)}}function L(t,s=t.calendar){return{branding:xs,calendar:s,...ct(Gi,t)}}function ds(t,s=t.calendar){return{branding:Gs,calendar:s,...ct(Gi,t)}}function Wa(t,s=t.calendar){return{branding:Vs,calendar:s,...ct(Gi,t)}}function bt(t){return{branding:$r,...ct(nu,t)}}function S(t){return{branding:jr,sign:Xt(t),...ct(Zi,t)}}function Ae(t){return ye(t.epochNanoseconds)}function ur(t){return wo(t.epochNanoseconds,Mt)[0]}function ve(t){return Pe(t.epochNanoseconds,ws)}function qe(t){return Pe(t.epochNanoseconds)}function Ee(t){return t.epochNanoseconds}function W(t){return typeof t=="string"?t:A(t.id)}function $s(t,s){return t===s||W(t)===W(s)}function Fe(t,s,a,r,o){let i=us(r),[n,e]=((f,y)=>{let P=y((f=Ko(f,co))[du]),g=cp(f);return g=ce(co,g),[g,P]})(o,t);if(da(Math.max(n,i),e))return Un(r,n);if(!e)throw new RangeError(Kr);let[l,d,u]=fr(s,a,e),c=ai(u),p=Pr(u),m=ri(u),T=p(d,l,r),h=m(d,l,T,n);return da(n,e)?Un(h,n):((f,y,P,g,E,M,I)=>{let K=Xt(f),[V,k]=vo(g,Ui(P,f),P,K,E,M,I),Qs=qo(y,V,k);return f[R[P]]+Qs*K})(h,c(T),n,d,l,c,p)}function Un(t,s){return ht(U(t),St[s],1)}function vo(t,s,a,r,o,i,n){let e=R[a],l={...s,[e]:s[e]+r},d=n(t,o,s),u=n(t,o,l);return[i(d),i(u)]}function qo(t,s,a){let r=ht(Tt(s,a));if(!r)throw new RangeError(Ca);return ht(Tt(s,t))/r}function $e(t,s){let[a,r,o]=lr(s,5,1);return G(pr(t.epochNanoseconds,a,r,o,1))}function Le(t,s,a){let{epochNanoseconds:r,timeZone:o,calendar:i}=s,[n,e,l]=lr(a);if(n===0&&e===1)return s;let d=t(o);if(n===6)r=((u,c,p,m)=>{let T=at(p,c),[h,f]=u(T),y=p.epochNanoseconds,P=ut(c,h),g=ut(c,f);if(fe(y,P,g))throw new RangeError(Ca);return _e(qo(y,P,g),m)?g:P})(Ve,d,s,l);else{let u=d.getOffsetNanosecondsFor(r);r=hs(d,Ne(Jt(r,u),n,e,l),u,2,0,1)}return z(r,o,i)}function je(t,s){return $(Ne(t,...lr(s)),t.calendar)}function Ze(t,s){let[a,r,o]=lr(s,5);var i;return bt((i=o,Eo(t,Pa(a,r),i)[0]))}function ke(t,s){let a=t(s.timeZone),r=at(s,a),[o,i]=Ve(r),n=ht(Tt(ut(a,o),ut(a,i)),vr,1);if(n<=0)throw new RangeError(Ca);return n}function Ue(t,s){let{timeZone:a,calendar:r}=s,o=((i,n,e)=>ut(n,i(at(e,n))))(We,t(a),s);return z(o,a,r)}function Ne(t,s,a,r){return Ge(t,Pa(s,a),r)}function Ge(t,s,a){let[r,o]=Eo(t,s,a);return jt({...fs(t,o),...r})}function Eo(t,s,a){return or(Bt(zt(t),s,a))}function _a(t){return Bt(t,Ar,7)}function Pa(t,s){return St[t]*s}function Ve(t){let s=We(t);return[s,fs(s,1)]}function We(t){return Xc(6,t)}function oc(t,s,a){let r=Math.min(us(t),6);return js(mr(U(t,r),s,a),r)}function cr(t,s,a,r,o,i,n,e,l,d){if(r===0&&o===1)return t;let u=da(r,e)?yr(e)&&r<6&&a>=6?nc:ic:ec,[c,p,m]=u(t,s,a,r,o,i,n,e,l,d);return m&&r!==7&&(c=((T,h,f,y,P,g,E,M)=>{let I=Xt(T);for(let K=y+1;K<=f;K++){if(K===7&&f!==7)continue;let V=Ui(K,T);V[R[K]]+=I;let k=ht(Tt(E(M(P,g,V)),h));if(k&&Math.sign(k)!==I)break;T=V}return T})(c,p,a,Math.max(6,r),n,e,l,d)),c}function pr(t,s,a,r,o){if(s===6){let i=((n)=>n[0]+n[1]/O)(t);return[Bt(i,a,r),0]}return mr(t,Pa(s,a),r,o)}function mr(t,s,a,r){let[o,i]=t;r&&i<0&&(i+=O,o-=1);let[n,e]=Ft(Bt(i,s,a),O);return go(o+n,e)}function Bt(t,s,a){return _e(t/s,a)*s}function _e(t,s){return hp[s](t)}function ic(t,s,a,r,o,i){let n=Xt(t),e=U(t),l=pr(e,r,o,i),d=Tt(e,l),u=Math.sign(l[0]-e[0])===n,c=js(l,Math.min(a,6));return[{...t,...c},Ss(s,d),u]}function nc(t,s,a,r,o,i,n,e,l,d){let u=Xt(t),c=ht(U(t,5)),p=Pa(r,o),m=Bt(c,p,i),[T,h]=vo(n,{...t,...ki},6,u,e,l,d),f=m-ht(Tt(T,h)),y=0;f&&Math.sign(f)!==u?s=Ms(T,m):(y+=u,m=Bt(f,p,i),s=Ms(h,m));let P=wr(m);return[{...t,...P,days:t.days+y},s,Boolean(y)]}function ec(t,s,a,r,o,i,n,e,l,d){let u=Xt(t),c=R[r],p=Ui(r,t);r===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});let m=Ya(t[c],o)*o;p[c]=m;let[T,h]=vo(n,p,r,o*u,e,l,d),f=m+qo(s,T,h)*u*o,y=Bt(f,o,i),P=Math.sign(y-f)===u;return p[c]=y,[p,P?h:T,P]}function Fo(t,s,a,r){let[o,i,n,e]=((d)=>{let u=Io(d=Ot(d));return[d.timeZone,...u]})(r),l=o!==void 0;return((d,u,c,p,m,T)=>{c=mr(c,m,p,1);let h=u.getOffsetNanosecondsFor(c);return No(Jt(c,h),T)+(d?Ts(_a(h)):"Z")})(l,s(l?t(o):Rs),a.epochNanoseconds,i,n,e)}function $o(t,s,a){let[r,o,i,n,e,l]=((d)=>{d=Ot(d);let u=_i(d),c=Me(d),p=Tp(d),m=Ha(d,4),T=ba(d,4);return[u,mp(d),p,m,...Se(T,c)]})(a);return((d,u,c,p,m,T,h,f,y,P)=>{p=mr(p,y,f,1);let g=d(c).getOffsetNanosecondsFor(p);return No(Jt(p,g),P)+Ts(_a(g),h)+((E,M)=>M!==1?"["+(M===2?"!":"")+W(E)+"]":"")(c,T)+Go(u,m)})(t,s.calendar,s.timeZone,s.epochNanoseconds,r,o,i,n,e,l)}function Lo(t,s){let[a,r,o,i]=((d)=>(d=Ot(d),[_i(d),...Io(d)]))(s);return n=t.calendar,e=a,l=i,No(Ge(t,o,r),l)+Go(n,e);var n,e,l}function jo(t,s){return a=t.calendar,r=t,o=Do(s),za(r)+Go(a,o);var a,r,o}function Zo(t,s){return ze(t.calendar,Be,t,Do(s))}function ko(t,s){return ze(t.calendar,lc,t,Do(s))}function Uo(t,s){let[a,r,o]=Ie(s);return i=o,Je(Eo(t,r,a)[0],i);var i}function Tr(t,s){let[a,r,o]=Ie(s,3);return r>1&&(t={...t,...oc(t,r,a)}),((i,n)=>{let{sign:e}=i,l=e===-1?rt(i):i,{hours:d,minutes:u}=l,[c,p]=wo(U(l,3),wt,_t);ol(c);let m=Vo(p,n),T=n>=0||!e||m;return(e<0?"-":"")+"P"+Nn({Y:ls(l.years),M:ls(l.months),W:ls(l.weeks),D:ls(l.days)})+(d||u||c||T?"T"+Nn({H:ls(d),M:ls(u),S:ls(c,T)+m}):"")})(t,o)}function ze(t,s,a,r){let o=W(t),i=r>1||r===0&&o!==x;return r===1?o===x?s(a):za(a):i?za(a)+Xe(o,r===2):s(a)}function Nn(t){let s=[];for(let a in t){let r=t[a];r&&s.push(r,a)}return s.join("")}function No(t,s){return za(t)+"T"+Je(t,s)}function za(t){return Be(t)+"-"+gt(t.isoDay)}function Be(t){let{isoYear:s}=t;return(s<0||s>9999?Qe(s)+Na(6,Math.abs(s)):Na(4,s))+"-"+gt(t.isoMonth)}function lc(t){return gt(t.isoMonth)+"-"+gt(t.isoDay)}function Je(t,s){let a=[gt(t.isoHour),gt(t.isoMinute)];return s!==-1&&a.push(gt(t.isoSecond)+((r,o,i,n)=>Vo(r*Mt+o*ws+i,n))(t.isoMillisecond,t.isoMicrosecond,t.isoNanosecond,s)),a.join(":")}function Ts(t,s=0){if(s===1)return"";let[a,r]=Ft(Math.abs(t),vr),[o,i]=Ft(r,Ar),[n,e]=Ft(i,wt);return Qe(t)+gt(a)+":"+gt(o)+(n||e?":"+gt(n)+Vo(e):"")}function Go(t,s){if(s!==1){let a=W(t);if(s>1||s===0&&a!==x)return Xe(a,s===2)}return""}function Xe(t,s){return"["+(s?"!":"")+"u-ca="+t+"]"}function Vo(t,s){let a=Na(9,t);return a=s===void 0?a.replace(yp,""):a.slice(0,s),a?"."+a:""}function Qe(t){return t<0?"-":"+"}function ls(t,s){return t||s?t.toLocaleString("fullwide",{useGrouping:0}):""}function dc(t,s){let{epochNanoseconds:a}=t,r=(s.getOffsetNanosecondsFor?s:s(t.timeZone)).getOffsetNanosecondsFor(a),o=Jt(a,r);return{calendar:t.calendar,...o,offsetNanoseconds:r}}function Ye(t,s){let a=at(s,t);return{calendar:s.calendar,...ct(eu,a),offset:Ts(a.offsetNanoseconds),timeZone:s.timeZone}}function hs(t,s,a,r=0,o=0,i,n){if(a!==void 0&&r===1&&(r===1||n))return Ro(s,a);let e=t.getPossibleInstantsFor(s);if(a!==void 0&&r!==3){let l=((d,u,c,p)=>{let m=Y(u);p&&(c=_a(c));for(let T of d){let h=ht(Tt(T,m));if(p&&(h=_a(h)),h===c)return T}})(e,s,a,i);if(l!==void 0)return l;if(r===0)throw new RangeError(Fc)}return n?Y(s):ut(t,s,o,e)}function ut(t,s,a=0,r=t.getPossibleInstantsFor(s)){if(r.length===1)return r[0];if(a===1)throw new RangeError($c);if(r.length)return r[a===3?1:0];let o=Y(s),i=((e,l)=>{let d=e.getOffsetNanosecondsFor(Ms(l,-O));return _o(e.getOffsetNanosecondsFor(Ms(l,O))-d)})(t,o),n=i*(a===2?-1:1);return(r=t.getPossibleInstantsFor(Jt(o,n)))[a===2?0:r.length-1]}function Wo(t){if(Math.abs(t)>=O)throw new RangeError(qc);return t}function _o(t){if(t>O)throw new RangeError(Ec);return t}function zo(t,s,a){return G(ft(Ss(s.epochNanoseconds,((r)=>{if(il(r))throw new RangeError(Zc);return U(r,5)})(t?rt(a):a))))}function Bo(t,s,a,r,o,i=Object.create(null)){let n=s(r.timeZone),e=t(r.calendar);return{...r,...ti(n,e,r,a?rt(o):o,i)}}function Jo(t,s,a,r,o=Object.create(null)){let{calendar:i}=a;return $(si(t(i),a,s?rt(r):r,o),i)}function Xo(t,s,a,r,o){let{calendar:i}=a;return L(hr(t(i),a,s?rt(r):r,o),i)}function Qo(t,s,a,r,o=Object.create(null)){let i=a.calendar,n=t(i),e=la(n,a);s&&(r=gr(r)),r.sign<0&&(e=n.dateAdd(e,{..._,months:1}),e=fs(e,-1));let l=n.dateAdd(e,r,o);return ds(la(n,l),i)}function Yo(t,s,a){return bt(tl(s,t?rt(a):a)[0])}function ti(t,s,a,r,o){let i=U(r,5),n=a.epochNanoseconds;if(il(r)){let e=at(a,t);n=Ss(ut(t,{...hr(s,e,{...r,...ki},o),...ct(Dt,e)}),i)}else n=Ss(n,i),C(o);return{epochNanoseconds:ft(n)}}function si(t,s,a,r){let[o,i]=tl(s,a);return jt({...hr(t,s,{...a,...ki,days:a.days+i},r),...o})}function hr(t,s,a,r){if(a.years||a.months||a.weeks)return t.dateAdd(s,a,r);C(r);let o=a.days+U(a,5)[0];return o?Vt(fs(s,o)):s}function la(t,s,a=1){return fs(s,a-t.day(s))}function tl(t,s){let[a,r]=U(s,5),[o,i]=or(zt(t)+r);return[o,a+i]}function fs(t,s){return s?{...t,...ir(st(t)+s*lt)}:t}function fr(t,s,a){let r=t(a.calendar);return yr(a)?[a,r,s(a.timeZone)]:[{...a,...xt},r]}function ai(t){return t?Ee:Y}function Pr(t){return t?w(ti,t):si}function ri(t){return t?w(cc,t):pc}function yr(t){return t&&t.epochNanoseconds}function da(t,s){return t<=6-(yr(s)?1:0)}function oi(t,s,a,r,o,i,n){let e=t(Ot(n).relativeTo),l=Math.max(us(o),us(i));if(da(l,e))return S(Ls(((h,f,y,P)=>{let g=Ss(U(h),U(f),P?-1:1);if(!Number.isFinite(g[0]))throw new RangeError(Mr);return{..._,...js(g,y)}})(o,i,l,r)));if(!e)throw new RangeError(Kr);r&&(i=rt(i));let[d,u,c]=fr(s,a,e),p=Pr(c),m=ri(c),T=p(u,d,o);return S(m(u,d,p(u,T,i),l))}function sl(t,s,a,r,o){let i=us(r),[n,e,l,d,u]=((I,K,V)=>{I=Ko(I,Xa);let k=Wi(I),Qs=V(I[du]),Ys=So(I),_u=Ha(I,7),ns=ba(I);if(k===void 0&&ns===void 0)throw new RangeError(kc);return ns==null&&(ns=0),k==null&&(k=Math.max(ns,K)),Ke(k,ns),Ys=Mo(Ys,ns,1),[k,ns,Ys,_u,Qs]})(o,i,t),c=Math.max(i,n);if(!yr(u)&&c<=6)return S(Ls(((I,K,V,k,Qs)=>{let Ys=pr(U(I),V,k,Qs);return{..._,...js(Ys,K)}})(r,n,e,l,d)));if(!u)throw new RangeError(Kr);let[p,m,T]=fr(s,a,u),h=ai(T),f=Pr(T),y=ri(T),P=f(m,p,r),g=y(m,p,P,n),E=r.sign,M=Xt(g);if(E&&M&&E!==M)throw new RangeError(Ca);return M&&(g=cr(g,h(P),n,e,l,d,m,p,h,f)),S(g)}function al(t){return t.sign===-1?gr(t):t}function gr(t){return S(rt(t))}function rt(t){let s={};for(let a of R)s[a]=-1*t[a]||0;return s}function rl(t){return!t.sign}function Xt(t,s=R){let a=0;for(let r of s){let o=Math.sign(t[r]);if(o){if(a&&a!==o)throw new RangeError(jc);a=o}}return a}function Ls(t){for(let s of Bc)yt(s,t[s],-Jn,Jn,1);return ol(ht(U(t),wt)),t}function ol(t){if(!Number.isSafeInteger(t))throw new RangeError(Lc)}function U(t,s=6){return ie(t,s,R)}function js(t,s=6){let[a,r]=t,o=tr(r,s,R);if(o[R[s]]+=a*(O/St[s]),!Number.isFinite(o[R[s]]))throw new RangeError(Mr);return o}function wr(t,s=5){return tr(t,s,R)}function il(t){return Boolean(Xt(t,iu))}function us(t){let s=9;for(;s>0&&!t[R[s]];s--);return s}function uc(t,s){return[t,s]}function Gn(t){let s=Math.floor(t/ka)*ka;return[s,s+ka]}function nl(t){let s=Qt(t=Ga(t));if(!s)throw new RangeError(et(t));let a;if(s.m)a=0;else{if(!s.offset)throw new RangeError(et(t));a=Zs(s.offset)}return s.timeZone&&li(s.timeZone,1),G(Ro(nr(s),a))}function el(t){let s=Qt(A(t));if(!s)throw new RangeError(et(t));if(s.timeZone)return fl(s,s.offset?Zs(s.offset):void 0);if(s.m)throw new RangeError(et(t));return yl(s)}function ll(t,s){let a=Qt(A(t));if(!a||!a.timeZone)throw new RangeError(et(t));let{offset:r}=a,o=r?Zs(r):void 0,[,i,n]=fa(s);return fl(a,o,i,n)}function Zs(t){let s=li(t);if(s===void 0)throw new RangeError(et(t));return s}function dl(t){let s=Qt(A(t));if(!s||s.m)throw new RangeError(et(t));return $(Pl(s))}function xr(t){let s=Qt(A(t));if(!s||s.m)throw new RangeError(et(t));return L(s.p?Pl(s):yl(s))}function ul(t,s){let a=ni(A(s));if(a)return ii(a),ds(Co(ps(a)));let r=xr(s);return ds(la(t(r.calendar),r))}function ii(t){if(t.calendar!==x)throw new RangeError($t(t.calendar))}function cl(t,s){let a=ei(A(s));if(a)return ii(a),Wa(ps(a));let r=xr(s),{calendar:o}=r,i=t(o),[n,e,l]=i.h(r),[d,u]=i.I(n,e),[c,p]=i.N(d,u,l);return Wa(Vt(i.P(c,p,l)),o)}function pl(t){let s,a=((r)=>{let o=Rp.exec(r);return o?(Cr(o[10]),xl(o)):void 0})(A(t));if(!a){if(a=Qt(t),!a)throw new RangeError(et(t));if(!a.p)throw new RangeError(et(t));if(a.m)throw new RangeError($t("Z"));ii(a)}if((s=ni(t))&&kn(s))throw new RangeError(et(t));if((s=ei(t))&&kn(s))throw new RangeError(et(t));return bt(er(a,1))}function ml(t){let s=((a)=>{let r=Hp.exec(a);return r?((o)=>{function i(u,c,p){let m=0,T=0;if(p&&([m,l]=Ft(l,St[p])),u!==void 0){if(e)throw new RangeError($t(u));T=((h)=>{let f=parseInt(h);if(!Number.isFinite(f))throw new RangeError($t(h));return f})(u),n=1,c&&(l=di(c)*(St[p]/wt),e=1)}return m+T}let n=0,e=0,l=0,d={...qs(R,[i(o[2]),i(o[3]),i(o[4]),i(o[5]),i(o[6],o[7],5),i(o[8],o[9],4),i(o[10],o[11],3)]),...tr(l,2,R)};if(!n)throw new RangeError(Ld(R));return ui(o[1])<0&&(d=rt(d)),d})(r):void 0})(A(t));if(!s)throw new RangeError(et(t));return S(Ls(s))}function Tl(t){let s=Qt(t)||ni(t)||ei(t);return s?s.calendar:t}function hl(t){let s=Qt(t);return s&&(s.timeZone||s.m&&Rs||s.offset)||t}function fl(t,s,a=0,r=0){let o=Rr(t.timeZone),i=Zr(o);return z(hs(i,nr(t),s,a,r,!i.v,t.m),o,ya(t.calendar))}function Pl(t){return gl(jt(nr(t)))}function yl(t){return gl(Vt(ps(t)))}function gl(t){return{...t,calendar:ya(t.calendar)}}function Qt(t){let s=Cp.exec(t);return s?((a)=>{let r=a[10],o=(r||"").toUpperCase()==="Z";return{isoYear:wl(a),isoMonth:parseInt(a[4]),isoDay:parseInt(a[5]),...xl(a.slice(5)),...Cr(a[16]),p:Boolean(a[6]),m:o,offset:o?void 0:r}})(s):void 0}function ni(t){let s=wp.exec(t);return s?((a)=>({isoYear:wl(a),isoMonth:parseInt(a[4]),isoDay:1,...Cr(a[5])}))(s):void 0}function ei(t){let s=xp.exec(t);return s?((a)=>({isoYear:vs,isoMonth:parseInt(a[1]),isoDay:parseInt(a[2]),...Cr(a[3])}))(s):void 0}function li(t,s){let a=Op.exec(t);return a?((r,o)=>{let i=r[4]||r[5];if(o&&i)throw new RangeError($t(i));return Wo((Is(r[2])*vr+Is(r[3])*Ar+Is(r[4])*wt+di(r[5]||""))*ui(r[1]))})(a,s):void 0}function wl(t){let s=ui(t[1]),a=parseInt(t[2]||t[3]);if(s<0&&!a)throw new RangeError($t(-0));return s*a}function xl(t){let s=Is(t[3]);return{...or(di(t[4]||""))[0],isoHour:Is(t[1]),isoMinute:Is(t[2]),isoSecond:s===60?59:s}}function Cr(t){let s,a,r=[];if(t.replace(bp,(o,i,n)=>{let e=Boolean(i),[l,d]=n.split("=").reverse();if(d){if(d==="u-ca")r.push(l),s||(s=e);else if(e||/[A-Z]/.test(d))throw new RangeError($t(o))}else{if(a)throw new RangeError($t(o));a=l}return""}),r.length>1&&s)throw new RangeError($t(t));return{timeZone:a,calendar:r[0]||x}}function di(t){return parseInt(t.padEnd(9,"0"))}function ks(t){return new RegExp(`^${t}$`,"i")}function ui(t){return t&&t!=="+"?-1:1}function Is(t){return t===void 0?0:parseInt(t)}function Cl(t){return Rr(A(t))}function Rr(t){let s=ci(t);return typeof s=="number"?Ts(s):s?((a)=>{if(Ip.test(a))throw new RangeError(vc);return a.toLowerCase().split("/").map((r,o)=>(r.length<=3||/\d/.test(r))&&!/etc|yap/.test(r)?r.toUpperCase():r.replace(/baja|dumont|[a-z]+/g,(i,n)=>i.length<=2&&!o||i==="in"||i==="chat"?i.toUpperCase():i.length>2||!n?jn(i).replace(/island|noronha|murdo|rivadavia|urville/,jn):i)).join("/")})(t):Rs}function Vn(t){let s=ci(t);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:Rs}function ci(t){let s=li(t=t.toUpperCase(),1);return s!==void 0?s:t!==Rs?Dp(t):void 0}function pi(t,s){return tt(t.epochNanoseconds,s.epochNanoseconds)}function mi(t,s){return tt(t.epochNanoseconds,s.epochNanoseconds)}function Rl(t,s,a,r,o,i){let n=t(Ot(i).relativeTo),e=Math.max(us(r),us(o));if(re(R,r,o))return 0;if(da(e,n))return tt(U(r),U(o));if(!n)throw new RangeError(Kr);let[l,d,u]=fr(s,a,n),c=ai(u),p=Pr(u);return tt(c(p(d,l,r)),c(p(d,l,o)))}function Ti(t,s){return Ps(t,s)||Or(t,s)}function Ps(t,s){return Gt(st(t),st(s))}function Or(t,s){return Gt(zt(t),zt(s))}function Ol(t,s){return!pi(t,s)}function bl(t,s){return!mi(t,s)&&!!br(t.timeZone,s.timeZone)&&$s(t.calendar,s.calendar)}function Hl(t,s){return!Ti(t,s)&&$s(t.calendar,s.calendar)}function Dl(t,s){return!Ps(t,s)&&$s(t.calendar,s.calendar)}function Il(t,s){return!Ps(t,s)&&$s(t.calendar,s.calendar)}function Sl(t,s){return!Ps(t,s)&&$s(t.calendar,s.calendar)}function Ml(t,s){return!Or(t,s)}function br(t,s){if(t===s)return 1;let a=W(t),r=W(s);if(a===r)return 1;try{return Vn(a)===Vn(r)}catch(o){}}function hi(t,s,a,r){let o=Fs(t,F(r),3,5),i=Hr(s.epochNanoseconds,a.epochNanoseconds,...o);return S(t?rt(i):i)}function fi(t,s,a,r,o,i){let n=Ir(r.calendar,o.calendar),e=F(i),[l,d,u,c]=Fs(a,e,5),p=r.epochNanoseconds,m=o.epochNanoseconds,T=tt(m,p),h;if(T)if(l<6)h=Hr(p,m,l,d,u,c);else{let f=s(((P,g)=>{if(!br(P,g))throw new RangeError(Gd);return P})(r.timeZone,o.timeZone)),y=t(n);h=Al(y,f,r,o,T,l,e),h=cr(h,m,l,d,u,c,y,r,Ee,w(ti,f))}else h=_;return S(a?rt(h):h)}function Pi(t,s,a,r,o){let i=Ir(a.calendar,r.calendar),n=F(o),[e,l,d,u]=Fs(s,n,6),c=Y(a),p=Y(r),m=tt(p,c),T;if(m)if(e<=6)T=Hr(c,p,e,l,d,u);else{let h=t(i);T=vl(h,a,r,m,e,n),T=cr(T,p,e,l,d,u,h,a,Y,si)}else T=_;return S(s?rt(T):T)}function yi(t,s,a,r,o){let i=Ir(a.calendar,r.calendar),n=F(o);return Kl(s,()=>t(i),a,r,...Fs(s,n,6,9,6),n)}function gi(t,s,a,r,o){let i=Ir(a.calendar,r.calendar),n=F(o),e=Fs(s,n,9,9,8),l=t(i);return Kl(s,()=>l,la(l,a),la(l,r),...e,n)}function Kl(t,s,a,r,o,i,n,e,l){let d=Y(a),u=Y(r),c;if(tt(u,d))if(o===6)c=Hr(d,u,o,i,n,e);else{let p=s();c=p.dateUntil(a,r,o,l),i===6&&n===1||(c=cr(c,u,o,i,n,e,p,a,Y,hr))}else c=_;return S(t?rt(c):c)}function wi(t,s,a,r){let o=F(r),[i,n,e,l]=Fs(t,o,5,5),d=Bt(xi(s,a),Pa(n,e),l),u={..._,...wr(d,i)};return S(t?rt(u):u)}function cc(t,s,a,r,o,i){let n=tt(r.epochNanoseconds,a.epochNanoseconds);return n?o<6?ql(a.epochNanoseconds,r.epochNanoseconds,o):Al(s,t,a,r,n,o,i):_}function pc(t,s,a,r,o){let i=Y(s),n=Y(a),e=tt(n,i);return e?r<=6?ql(i,n,r):vl(t,s,a,e,r,o):_}function Al(t,s,a,r,o,i,n){let[e,l,d]=((p,m,T,h)=>{function f(){return K={...fs(g,M++*-h),...P},V=ut(p,K),tt(E,V)===-h}let y=at(m,p),P=ct(Dt,y),g=at(T,p),E=T.epochNanoseconds,M=0,I=xi(y,g),K,V;if(Math.sign(I)===-h&&M++,f()&&(h===-1||f()))throw new RangeError(Ca);let k=ht(Tt(V,E));return[y,K,k]})(s,a,r,o);var u,c;return{...i===6?(u=e,c=l,{..._,days:El(u,c)}):t.dateUntil(e,l,i,n),...wr(d)}}function vl(t,s,a,r,o,i){let[n,e,l]=((d,u,c)=>{let p=u,m=xi(d,u);return Math.sign(m)===-c&&(p=fs(u,-c),m+=O*c),[d,p,m]})(s,a,r);return{...t.dateUntil(n,e,o,i),...wr(l)}}function Hr(t,s,a,r,o,i){return{..._,...js(pr(Tt(t,s),r,o,i),a)}}function ql(t,s,a){return{..._,...js(Tt(t,s),a)}}function El(t,s){return Dr(st(t),st(s))}function Dr(t,s){return Math.trunc((s-t)/lt)}function xi(t,s){return zt(s)-zt(t)}function Ir(t,s){if(!$s(t,s))throw new RangeError(Fi);return t}function mc(t){function s(o){return((i,n)=>({...Fl(i,n),F:i.month,day:parseInt(i.day)}))(xo(a,o),r)}let a=Xi(t),r=Ba(t);return{id:t,O:Tc(s),B:hc(s)}}function Tc(t){return dt((s)=>{let a=st(s);return t(a)},WeakMap)}function hc(t){let s=t(0).year-sp;return dt((a)=>{let r,o=Es(a-s),i=[],n=[];do o+=400*lt;while((r=t(o)).year<=a);do o+=(1-r.day)*lt,r.year===a&&(i.push(o),n.push(r.F)),o-=lt;while((r=t(o)).year>=a);return{k:i.reverse(),C:_d(n.reverse())}})}function Fl(t,s){let a,r,o=$l(t);if(t.era){let i=au[s];i!==void 0&&(a=s==="islamic"?"ah":t.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),a==="bc"||a==="b"?a="bce":a!=="ad"&&a!=="a"||(a="ce"),r=o,o=Ul(r,i[a]||0))}return{era:a,eraYear:r,year:o}}function $l(t){return parseInt(t.relatedYear||t.year)}function oo(t){let{year:s,F:a,day:r}=this.O(t),{C:o}=this.B(s);return[s,o[a]+1,r]}function ua(t,s=1,a=1){return this.B(t).k[s-1]+(a-1)*lt}function La(t){let s=_n(this,t),a=_n(this,t-1),r=s.length;if(r>a.length){let o=Nl(this);if(o<0)return-o;for(let i=0;i<r;i++)if(s[i]!==a[i])return i+1}}function ja(t){return Dr(ua.call(this,t),ua.call(this,t+1))}function Wn(t,s){let{k:a}=this.B(t),r=s+1,o=a;return r>a.length&&(r=1,o=this.B(t+1).k),Dr(a[s-1],o[r-1])}function Za(t){return this.B(t).k.length}function _n(t,s){return Object.keys(t.B(s).C)}function Ll(t){return ya(A(t))}function ya(t){if((t=t.toLowerCase())!==x&&t!==Er&&Ba(t)!==Ba(Xi(t).resolvedOptions().calendar))throw new RangeError(Ac(t));return t}function Ba(t){return t==="islamicc"&&(t="islamic"),t.split("-")[0]}function jl(t){return this.R(t)[0]}function Zl(t){return this.R(t)[1]}function Ci(t){let[s]=this.h(t);return Dr(this.q(s),st(t))+1}function kl(t){let s=Mp.exec(t);if(!s)throw new RangeError(Mc(t));return[parseInt(s[1]),Boolean(s[2])]}function Ja(t,s,a){return t+(s||a&&t>=a?1:0)}function io(t,s){return t-(s&&t>=s?1:0)}function Ul(t,s){return(s+t)*(Math.sign(s)||1)||0}function no(t){return au[Gl(t)]}function Nl(t){return Wc[Gl(t)]}function Gl(t){return Ba(t.id||x)}function Vl(t,s,a,r){let o=Yt(a,r,Ht,[],Qd);if(o.timeZone!==void 0){let i=a.dateFromFields(o),n=ys(o),e=t(o.timeZone);return{epochNanoseconds:hs(s(e),{...i,...n},o.offset!==void 0?Zs(o.offset):void 0),timeZone:e}}return{...a.dateFromFields(o),...xt}}function Wl(t,s,a,r,o,i){let n=Yt(a,o,Ht,Jd,Qd),e=t(n.timeZone),[l,d,u]=fa(i),c=a.dateFromFields(n,dr(i,l)),p=ys(n,l);return z(hs(s(e),{...c,...p},n.offset!==void 0?Zs(n.offset):void 0,d,u),e,r)}function _l(t,s,a){let r=Yt(t,s,Ht,[],Ut),o=C(a);return $(jt({...t.dateFromFields(r,dr(a,o)),...ys(r,o)}))}function Ri(t,s,a,r=[]){let o=Yt(t,s,Ht,r);return t.dateFromFields(o,a)}function Oi(t,s,a,r){let o=Yt(t,s,ji,r);return t.yearMonthFromFields(o,a)}function bi(t,s,a,r,o=[]){let i=Yt(t,a,Ht,o);return s&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=vs),t.monthDayFromFields(i,r)}function zl(t,s){let a=C(s);return bt(ys(It(t,lo,[],1),a))}function Bl(t){let s=It(t,Zi);return S(Ls({..._,...s}))}function Yt(t,s,a,r=[],o=[]){return It(s,[...t.fields(a),...o].sort(),r)}function It(t,s,a,r=!a){let o={},i,n=0;for(let e of s){if(e===i)throw new RangeError(Oc(e));if(e==="constructor"||e==="__proto__")throw new RangeError(qi(e));let l=t[e];if(l!==void 0)n=1,Xn[e]&&(l=Xn[e](l,e)),o[e]=l;else if(a){if(a.includes(e))throw new TypeError(vi(e));o[e]=su[e]}i=e}if(r&&!n)throw new TypeError(Ld(s));return o}function ys(t,s){return er(qp({...su,...t}),s)}function Jl(t,s,a,r,o,i){let n=F(i),{calendar:e,timeZone:l}=a;return z(((d,u,c,p,m)=>{let T=ga(d,c,p,Ht,Xd,Bd),[h,f,y]=fa(m,2);return hs(u,{...d.dateFromFields(T,dr(m,h)),...ys(T,h)},Zs(T.offset),f,y)})(t(e),s(l),r,o,n),l,e)}function Xl(t,s,a,r,o){let i=F(o);return $(((n,e,l,d)=>{let u=ga(n,e,l,Ht,Ut),c=C(d);return jt({...n.dateFromFields(u,dr(d,c)),...ys(u,c)})})(t(s.calendar),a,r,i))}function Ql(t,s,a,r,o){let i=F(o);return((n,e,l,d)=>{let u=ga(n,e,l,Ht);return n.dateFromFields(u,d)})(t(s.calendar),a,r,i)}function Yl(t,s,a,r,o){let i=F(o);return ds(((n,e,l,d)=>{let u=ga(n,e,l,ji);return n.yearMonthFromFields(u,d)})(t(s.calendar),a,r,i))}function td(t,s,a,r,o){let i=F(o);return((n,e,l,d)=>{let u=ga(n,e,l,Ht);return n.monthDayFromFields(u,d)})(t(s.calendar),a,r,i)}function sd(t,s,a){return bt(((r,o,i)=>{let n=C(i);return ys({...ct(lo,r),...It(o,lo)},n)})(t,s,a))}function ad(t,s){return S((a=t,r=s,Ls({...a,...It(r,Zi)})));var a,r}function ga(t,s,a,r,o=[],i=[]){let n=[...t.fields(r),...o].sort(),e=It(s,n,i),l=It(a,n);return e=t.mergeFields(e,l),It(e,n,[])}function Hi(t,s){let a=Yt(t,s,tu);return t.monthDayFromFields(a)}function Di(t,s,a){let r=Yt(t,s,Yd);return t.yearMonthFromFields(r,a)}function rd(t,s,a,r,o){s=ct(a=t.fields(a),s),r=It(r,o=t.fields(o),[]);let i=t.mergeFields(s,r);return i=It(i,[...a,...o].sort(),[]),t.dateFromFields(i)}function Yr(t,s){let{era:a,eraYear:r,year:o}=s,i=no(t);if(a!==void 0||r!==void 0){if(a===void 0||r===void 0)throw new TypeError(Hc);if(!i)throw new RangeError(bc);let n=i[a];if(n===void 0)throw new RangeError(Ic(a));let e=Ul(r,n);if(o!==void 0&&o!==e)throw new RangeError(Dc);o=e}else if(o===void 0)throw new TypeError(Sc(i));return o}function to(t,s,a,r){let{month:o,monthCode:i}=s;if(i!==void 0){let n=((e,l,d,u)=>{let c=e.U(d),[p,m]=kl(l),T=Ja(p,m,c);if(m){let h=Nl(e);if(h===void 0)throw new RangeError(ia);if(h>0){if(T>h)throw new RangeError(ia);if(c===void 0){if(u===1)throw new RangeError(ia);T--}}else{if(T!==-h)throw new RangeError(ia);if(c===void 0&&u===1)throw new RangeError(ia)}}return T})(t,i,a,r);if(o!==void 0&&o!==n)throw new RangeError(Ud);o=n,r=1}else if(o===void 0)throw new TypeError(Kc);return yt("month",o,1,t.L(a),r)}function zn(t,s,a,r,o){return nt(s,"day",1,t.j(r,a),o)}function so(t,s,a,r){let o=0,i=[];for(let n of a)s[n]!==void 0?o=1:i.push(n);if(Object.assign(t,s),o)for(let n of r||i)delete t[n]}function od(t){return G(ft(rr(ar(t))))}function id(t,s,a,r,o=x){return z(ft(rr(ar(a))),s(r),t(o))}function nd(t,s,a,r,o=0,i=0,n=0,e=0,l=0,d=0,u=x){return $(jt(nr(Ct(Q,qs(Fr,[s,a,r,o,i,n,e,l,d])))),t(u))}function ed(t,s,a,r,o=x){return L(Vt(ps(Ct(Q,{isoYear:s,isoMonth:a,isoDay:r}))),t(o))}function ld(t,s,a,r=x,o=1){let i=Q(s),n=Q(a),e=t(r);return ds(Co(ps({isoYear:i,isoMonth:n,isoDay:Q(o)})),e)}function dd(t,s,a,r=x,o=vs){let i=Q(s),n=Q(a),e=t(r);return Wa(Vt(ps({isoYear:Q(o),isoMonth:i,isoDay:n})),e)}function ud(t=0,s=0,a=0,r=0,o=0,i=0){return bt(er(Ct(Q,qs(Dt,[t,s,a,r,o,i])),1))}function cd(t=0,s=0,a=0,r=0,o=0,i=0,n=0,e=0,l=0,d=0){return S(Ls(Ct(he,qs(R,[t,s,a,r,o,i,n,e,l,d]))))}function Ii(t,s,a=x){return z(t.epochNanoseconds,s,a)}function pd(t){return G(t.epochNanoseconds)}function Si(t,s){return $(at(s,t))}function Mi(t,s){return L(at(s,t))}function md(t,s,a){return Di(t(s.calendar),a)}function Td(t,s,a){return Hi(t(s.calendar),a)}function Ki(t,s){return bt(at(s,t))}function hd(t,s,a,r){let o=((i,n,e,l)=>{let d=Ho(l);return ut(i(n),e,d)})(t,a,s,r);return z(ft(o),a,s.calendar)}function fd(t,s,a){let r=t(s.calendar);return ds({...s,...Di(r,a)})}function Pd(t,s,a){return Hi(t(s.calendar),a)}function yd(t,s,a,r,o){let i=t(o.timeZone),n=o.plainTime,e=n!==void 0?s(n):xt;return z(ut(a(i),{...r,...e}),i,r.calendar)}function gd(t,s=xt){return $(jt({...t,...s}))}function wd(t,s,a){return Di(t(s.calendar),a)}function xd(t,s,a){return Hi(t(s.calendar),a)}function Cd(t,s,a,r){return((o,i,n)=>rd(o,i,Yd,Lt(n),Oa))(t(s.calendar),a,r)}function Rd(t,s,a,r){return((o,i,n)=>rd(o,i,tu,Lt(n),qr))(t(s.calendar),a,r)}function Od(t,s,a,r,o){let i=Lt(o),n=s(i.plainDate),e=t(i.timeZone);return z(ut(a(e),{...n,...r}),e,n.calendar)}function bd(t,s){return $(jt({...t,...s}))}function Hd(t){return G(ft(Ks(t,wt)))}function Dd(t){return G(ft(Ks(t,Mt)))}function Id(t){return G(ft(rr(ar(t),ws)))}function Sd(t){return G(ft(rr(ar(t))))}function Md(t,s,a=xt){let r=s.timeZone,o=t(r),i={...at(s,o),...a};return z(hs(o,i,i.offsetNanoseconds,2),r,s.calendar)}function Kd(t,s,a){let r=s.timeZone,o=t(r),i={...at(s,o),...a},n=Ed(s.calendar,a.calendar);return z(hs(o,i,i.offsetNanoseconds,2),r,n)}function Ad(t,s=xt){return $({...t,...s})}function vd(t,s){return $({...t,...s},Ed(t.calendar,s.calendar))}function Sr(t,s){return{...t,calendar:s}}function qd(t,s){return{...t,timeZone:s}}function Ed(t,s){if(t===s)return t;let a=W(t),r=W(s);if(a===r||a===x)return s;if(r===x)return t;throw new RangeError(Fi)}function fc(t,s){return(a)=>a===x?t:a===Er||a===As?Object.assign(Object.create(t),{id:a}):Object.assign(Object.create(s),Sp(a))}function gs(t,s,a){let r=new Set(a);return(o)=>(((i,n)=>{for(let e of n)if(e in i)return 1;return 0})(o=mo(r,o),t)||Object.assign(o,s),a&&(o.timeZone=Rs,["full","long"].includes(o.timeStyle)&&(o.timeStyle="medium")),o)}function Zt(t,s=Ai){let[a,,,r]=t;return(o,i=Jp,...n)=>{let e=s(r&&r(...n),o,i,a),l=e.resolvedOptions();return[e,...Pc(t,l,n)]}}function Ai(t,s,a,r){if(a=r(a),t){if(a.timeZone!==void 0)throw new TypeError(Nc);a.timeZone=t}return new ts(s,a)}function Pc(t,s,a){let[,r,o]=t;return a.map((i)=>(i.calendar&&((n,e,l)=>{if((l||n!==x)&&n!==e)throw new RangeError(Fi)})(W(i.calendar),s.calendar,o),r(i,s)))}function Us(t){let s=wa();return Jt(s,t.getOffsetNanosecondsFor(s))}function wa(){return Ks(Date.now(),Mt)}function kt(){return Yn||(Yn=new ts().resolvedOptions().timeZone)}var yc=(t,s)=>`Non-integer ${t}: ${s}`,gc=(t,s)=>`Non-positive ${t}: ${s}`,wc=(t,s)=>`Non-finite ${t}: ${s}`,xc=(t)=>`Cannot convert bigint to ${t}`,Cc=(t)=>`Invalid bigint: ${t}`,Rc="Cannot convert Symbol to string",Fd="Invalid object",$d=(t,s,a,r,o)=>o?$d(t,o[s],o[a],o[r]):xa(t,s)+`; must be between ${a}-${r}`,xa=(t,s)=>`Invalid ${t}: ${s}`,vi=(t)=>`Missing ${t}`,qi=(t)=>`Invalid field ${t}`,Oc=(t)=>`Duplicate field ${t}`,Ld=(t)=>"No valid fields: "+t.join(),jd="Invalid bag",Zd=(t,s,a)=>xa(t,s)+"; must be "+Object.keys(a).join(),kd="Cannot use valueOf",Ei="Invalid calling context",bc="Forbidden era/eraYear",Hc="Mismatching era/eraYear",Dc="Mismatching year/eraYear",Ic=(t)=>`Invalid era: ${t}`,Sc=(t)=>"Missing year"+(t?"/era/eraYear":""),Mc=(t)=>`Invalid monthCode: ${t}`,Ud="Mismatching month/monthCode",Kc="Missing month/monthCode",Bn="Cannot guess year",ia="Invalid leap month",Nd="Invalid protocol",Ca="Invalid protocol results",Fi="Mismatching Calendars",Ac=(t)=>`Invalid Calendar: ${t}`,Gd="Mismatching TimeZones",vc="Forbidden ICU TimeZone",qc="Out-of-bounds offset",Ec="Out-of-bounds TimeZone gap",Fc="Invalid TimeZone offset",$c="Ambiguous offset",Mr="Out-of-bounds date",Lc="Out-of-bounds duration",jc="Cannot mix duration signs",Kr="Missing relativeTo",Zc="Cannot use large units",kc="Required smallestUnit or largestUnit",Uc="smallestUnit > largestUnit",et=(t)=>`Cannot parse: ${t}`,$t=(t)=>`Invalid substring: ${t}`,Vd=(t)=>`Cannot format ${t}`,Wd="Mismatching types for formatting",Nc="Cannot specify TimeZone",_d=w(ma,(t,s)=>s),Ns=w(ma,(t,s,a)=>a),gt=w(Na,2),eo={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},Ra=Object.keys(eo),lt=86400000,zd=1000,ws=1000,Mt=1e6,wt=1e9,Ar=60000000000,vr=3600000000000,O=86400000000000,St=[1,ws,Mt,wt,Ar,vr,O],Ut=Ra.slice(0,6),lo=Ta(Ut),Bd=["offset"],Jd=["timeZone"],Xd=Ut.concat(Bd),Qd=Xd.concat(Jd),uo=["era","eraYear"],Gc=uo.concat(["year"]),qr=["year"],$i=["monthCode"],Li=["month"].concat($i),Oa=["day"],ji=Li.concat(qr),Yd=$i.concat(qr),Ht=Oa.concat(ji),Vc=Oa.concat(Li),tu=Oa.concat($i),su=Ns(Ut,0),x="iso8601",Er="gregory",As="japanese",au={[Er]:{bce:-1,ce:0},[As]:{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}},Wc={chinese:13,dangi:13,hebrew:-6},A=w(sr,"string"),ru=w(sr,"boolean"),_c=w(sr,"number"),ou=w(sr,"function"),R=Ra.map((t)=>t+"s"),Zi=Ta(R),zc=R.slice(0,6),iu=R.slice(6),Bc=iu.slice(1),Jc=_d(R),_=Ns(R,0),ki=Ns(zc,0),Ui=w(oe,R),Dt=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Ni=["isoDay","isoMonth","isoYear"],Fr=Dt.concat(Ni),Gi=Ta(Ni),nu=Ta(Dt),eu=Ta(Fr),xt=Ns(nu,0),Xc=w(oe,Fr),ts=Intl.DateTimeFormat,lu="en-GB",Vi=1e8,Qc=Vi*lt,Yc=[Vi,0],tp=[-Vi,0],ca=275760,pa=-271821,sp=1970,vs=1972,Et=12,ap=Es(1868,9,8),rp=dt(rc,WeakMap),Xa="smallestUnit",co="unit",ea="roundingIncrement",ao="fractionalSecondDigits",du="relativeTo",uu={constrain:0,reject:1},op=Object.keys(uu),ip={compatible:0,reject:1,earlier:2,later:3},np={reject:0,use:1,prefer:2,ignore:3},ep={auto:0,never:1,critical:2,always:3},lp={auto:0,never:1,critical:2},dp={auto:0,never:1},up={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},ba=w(Ao,Xa),Wi=w(Ao,"largestUnit"),cp=w(Ao,co),cu=w(ms,"overflow",uu),pu=w(ms,"disambiguation",ip),pp=w(ms,"offset",np),_i=w(ms,"calendarName",ep),mp=w(ms,"timeZoneName",lp),Tp=w(ms,"offset",dp),Ha=w(ms,"roundingMode",up),Gs="PlainYearMonth",Vs="PlainMonthDay",xs="PlainDate",Cs="PlainDateTime",$r="PlainTime",Nt="ZonedDateTime",Lr="Instant",jr="Duration",hp=[Math.floor,(t)=>$a(t)?Math.floor(t):Math.round(t),Math.ceil,(t)=>$a(t)?Math.ceil(t):Math.round(t),Math.trunc,(t)=>$a(t)?Math.trunc(t)||0:Math.round(t),(t)=>t<0?Math.floor(t):Math.ceil(t),(t)=>Math.sign(t)*Math.round(Math.abs(t))||0,(t)=>$a(t)?(t=Math.trunc(t)||0)+t%2:Math.round(t)],Rs="UTC",ka=5184000,fp=Va(1847),Pp=Va(new Date().getUTCFullYear()+10),yp=/0+$/,at=dt(dc,WeakMap),Jn=4294967295,Zr=dt((t)=>{let s=ci(t);return typeof s=="object"?new Tu(s):new mu(s||0)});class mu{constructor(t){this.v=t}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(t){return[Ro(t,this.v)]}l(){}}class Tu{constructor(t){this.$=((s)=>{function a(l){let d=ro(l,n,e),[u,c]=Gn(d),p=o(u),m=o(c);return p===m?p:r(i(u,c),p,m,l)}function r(l,d,u,c){let p,m;for(;(c===void 0||(p=c<l[0]?d:c>=l[1]?u:void 0)===void 0)&&(m=l[1]-l[0]);){let T=l[0]+Math.floor(m/2);s(T)===u?l[1]=T:l[0]=T+1}return p}let o=dt(s),i=dt(uc),n=fp,e=Pp;return{G(l){let d=a(l-86400),u=a(l+86400),c=l-d,p=l-u;if(d===u)return[c];let m=a(c);return m===a(p)?[l-m]:d>u?[c,p]:[]},V:a,l(l,d){let u=ro(l,n,e),[c,p]=Gn(u),m=ka*d,T=d<0?()=>p>n||(n=u,0):()=>c<e||(e=u,0);for(;T();){let h=o(c),f=o(p);if(h!==f){let y=i(c,p);r(y,h,f);let P=y[0];if((Gt(P,l)||1)===d)return P}c+=m,p+=m}}}})(((s)=>(a)=>{let r=xo(s,a*zd);return Va($l(r),parseInt(r.month),parseInt(r.day),parseInt(r.hour),parseInt(r.minute),parseInt(r.second))-a})(t))}getOffsetNanosecondsFor(t){return this.$.V(ye(t))*wt}getPossibleInstantsFor(t){let[s,a]=[Va((r=t).isoYear,r.isoMonth,r.isoDay,r.isoHour,r.isoMinute,r.isoSecond),r.isoMillisecond*Mt+r.isoMicrosecond*ws+r.isoNanosecond];var r;return this.$.G(s).map((o)=>ft(Ms(Ks(o,wt),a)))}l(t,s){let[a,r]=ge(t),o=this.$.l(a+(s>0||r?1:0),s);if(o!==void 0)return Ks(o,wt)}}var zi="([+\u2212-])",Ua="(?:[.,](\\d{1,9}))?",hu=`(?:(?:${zi}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Bi="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+Ua+")?)?",Ji=zi+Bi,gp=hu+"-?(\\d{2})(?:[T ]"+Bi+"(Z|"+Ji+")?)?",fu="\\[(!?)([^\\]]*)\\]",kr=`((?:${fu}){0,9})`,wp=ks(hu+kr),xp=ks("(?:--)?(\\d{2})-?(\\d{2})"+kr),Cp=ks(gp+kr),Rp=ks("T?"+Bi+"(?:"+Ji+")?"+kr),Op=ks(Ji),bp=new RegExp(fu,"g"),Hp=ks(`${zi}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${Ua}H)?(?:(\\d+)${Ua}M)?(?:(\\d+)${Ua}S)?)?`),Dp=dt((t)=>new ts(lu,{timeZone:t,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Ip=/^(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$/,Sp=dt(mc),Xi=dt((t)=>new ts(lu,{calendar:t,timeZone:Rs,era:"short",year:"numeric",month:"short",day:"numeric"})),Mp=/^M(\d{2})(L?)$/,Kp={era:Ga,eraYear:Q,year:Q,month:Zn,monthCode:Ga,day:Zn},Ap=Ns(Ut,Q),vp=Ns(R,he),Xn=Object.assign({},Kp,Ap,vp,{offset:Ga}),qp=w(ac,Ut,Dt),Qn={dateAdd(t,s,a){let r=C(a),o,{years:i,months:n,weeks:e,days:l}=s;if(l+=U(s,5)[0],i||n)o=((d,u,c,p,m)=>{let[T,h,f]=d.h(u);if(c){let[y,P]=d.I(T,h);T+=c,h=Ja(y,P,d.U(T)),h=yt("month",h,1,d.L(T),m)}return p&&([T,h]=d._(T,h,p)),f=yt("day",f,1,d.j(T,h),m),d.q(T,h,f)})(this,t,i,n,r);else{if(!e&&!l)return t;o=st(t)}return o+=(7*e+l)*lt,Vt(ir(o))},dateUntil(t,s,a){if(a<=7){let l=0,d=El({...t,...xt},{...s,...xt});return a===7&&([l,d]=_t(d,7)),{..._,weeks:l,days:d}}let r=this.h(t),o=this.h(s),[i,n,e]=((l,d,u,c,p,m,T)=>{let h=p-d,f=m-u,y=T-c;if(h||f){let P=Math.sign(h||f),g=l.j(p,m),E=0;if(Math.sign(y)===-P){let M=g;[p,m]=l._(p,m,-P),h=p-d,f=m-u,g=l.j(p,m),E=P<0?-M:g}if(y=T-Math.min(c,g)+E,h){let[M,I]=l.I(d,u),[K,V]=l.I(p,m);if(f=K-M||Number(V)-Number(I),Math.sign(f)===-P){let k=P<0&&-l.L(p);h=(p-=P)-d,f=m-Ja(M,I,l.U(p))+(k||l.L(p))}}}return[h,f,y]})(this,...r,...o);return a===8&&(n+=this.J(i,r[0]),i=0),{..._,years:i,months:n,days:e}},dateFromFields(t,s){let a=C(s),r=Yr(this,t),o=to(this,t,r,a),i=zn(this,t,o,r,a);return L(Vt(this.P(r,o,i)),this.id||x)},yearMonthFromFields(t,s){let a=C(s),r=Yr(this,t),o=to(this,t,r,a);return ds(Co(this.P(r,o,1)),this.id||x)},monthDayFromFields(t,s){let a=C(s),r=!this.id,{monthCode:o,year:i,month:n}=t,e,l,d,u,c;if(o!==void 0){[e,l]=kl(o),c=te(t,"day");let p=this.N(e,l,c);if(!p)throw new RangeError(Bn);if([d,u]=p,n!==void 0&&n!==u)throw new RangeError(Ud);r&&(u=yt("month",u,1,Et,1),c=yt("day",c,1,Oo(i!==void 0?i:d,u),a))}else{d=i===void 0&&r?vs:Yr(this,t),u=to(this,t,d,a),c=zn(this,t,u,d,a);let p=this.U(d);l=u===p,e=io(u,p);let m=this.N(e,l,c);if(!m)throw new RangeError(Bn);[d,u]=m}return Wa(Vt(this.P(d,u,c)),this.id||x)},fields(t){return no(this)&&t.includes("year")?[...t,...uo]:t},mergeFields(t,s){let a=Object.assign(Object.create(null),t);return so(a,s,Li),no(this)&&(so(a,s,Gc),this.id===As&&so(a,s,Vc,uo)),a},inLeapYear(t){let[s]=this.h(t);return this.K(s)},monthsInYear(t){let[s]=this.h(t);return this.L(s)},daysInMonth(t){let[s,a]=this.h(t);return this.j(s,a)},daysInYear(t){let[s]=this.h(t);return this.X(s)},dayOfYear:Ci,era(t){return this.ee(t)[0]},eraYear(t){return this.ee(t)[1]},monthCode(t){let[s,a]=this.h(t),[r,o]=this.I(s,a);return((i,n)=>"M"+gt(i)+(n?"L":""))(r,o)},dayOfWeek:Oe,daysInWeek(){return 7}},Ep={dayOfYear:Ci,h:xe,q:Es},Fp=Object.assign({},Ep,{weekOfYear:jl,yearOfWeek:Zl,R(t){function s(m){return(7-m<r?7:0)-m}function a(m){let T=Re(p+m),h=m||1,f=s(na(l+T*h,7));return u=(T+(f-d)*h)/7}let r=this.id?1:4,o=Oe(t),i=this.dayOfYear(t),n=na(o-1,7),e=i-1,l=na(n-e,7),d=s(l),u,c=Math.floor((e-d)/7)+1,p=t.isoYear;return c?c>a(0)&&(c=1,p++):(c=a(-1),p--),[c,p,u]}}),$p={dayOfYear:Ci,h:oo,q:ua,weekOfYear:jl,yearOfWeek:Zl,R(){return[]}},Ws=fc(Object.assign({},Qn,Fp,{h:xe,ee(t){return this.id===Er?be(t):this.id===As?rp(t):[]},I:(t,s)=>[s,0],N(t,s){if(!s)return[vs,t]},K:bo,U(){},L:Ce,J:(t)=>t*Et,j:Oo,X:Re,P:(t,s,a)=>({isoYear:t,isoMonth:s,isoDay:a}),q:Es,_:(t,s,a)=>(t+=Ya(a,Et),(s+=ho(a,Et))<1?(t--,s+=Et):s>Et&&(t++,s-=Et),[t,s]),year(t){return t.isoYear},month(t){return t.isoMonth},day:(t)=>t.isoDay}),Object.assign({},Qn,$p,{h:oo,ee(t){let s=this.O(t);return[s.era,s.eraYear]},I(t,s){let a=La.call(this,t);return[io(s,a),a===s]},N(t,s,a){let[r,o,i]=oo.call(this,{isoYear:vs,isoMonth:Et,isoDay:31}),n=La.call(this,r),e=o===n;(Gt(t,io(o,n))||Gt(Number(s),Number(e))||Gt(a,i))===1&&r--;for(let l=0;l<100;l++){let d=r-l,u=La.call(this,d),c=Ja(t,s,u);if(s===(c===u)&&a<=Wn.call(this,d,c))return[d,c]}},K(t){let s=ja.call(this,t);return s>ja.call(this,t-1)&&s>ja.call(this,t+1)},U:La,L:Za,J(t,s){let a=s+t,r=Math.sign(t),o=r<0?-1:0,i=0;for(let n=s;n!==a;n+=r)i+=Za.call(this,n+o);return i},j:Wn,X:ja,P(t,s,a){return ir(ua.call(this,t,s,a))},q:ua,_(t,s,a){if(a){if(s+=a,!Number.isSafeInteger(s))throw new RangeError(Mr);if(a<0)for(;s<1;)s+=Za.call(this,--t);else{let r;for(;s>(r=Za.call(this,t));)s-=r,t++}}return[t,s]},year(t){return this.O(t).year},month(t){let{year:s,F:a}=this.O(t),{C:r}=this.B(s);return r[a]+1},day(t){return this.O(t).day}})),Wt="numeric",_s=["timeZoneName"],Pu={month:Wt,day:Wt},Qi={year:Wt,month:Wt},Yi=Object.assign({},Qi,{day:Wt}),tn={hour:Wt,minute:Wt,second:Wt},sn=Object.assign({},Yi,tn),Lp=Object.assign({},sn,{timeZoneName:"short"}),jp=Object.keys(Qi),Zp=Object.keys(Pu),kp=Object.keys(Yi),Up=Object.keys(tn),an=["dateStyle"],Np=jp.concat(an),Gp=Zp.concat(an),rn=kp.concat(an,["weekday"]),Da=Up.concat(["dayPeriod","timeStyle"]),on=rn.concat(Da),Vp=on.concat(_s),Wp=_s.concat(Da),_p=_s.concat(rn),zp=_s.concat(["day","weekday"],Da),Bp=_s.concat(["year","weekday"],Da),Jp={},nn=[gs(on,sn),ur],yu=[gs(Vp,Lp),ur,0,(t,s)=>{let a=W(t.timeZone);if(s&&W(s.timeZone)!==a)throw new RangeError(Gd);return a}],en=[gs(on,sn,_s),st],ln=[gs(rn,Yi,Wp),st],dn=[gs(Da,tn,_p),(t)=>zt(t)/Mt],un=[gs(Np,Qi,zp),st,1],cn=[gs(Gp,Pu,Bp),st,1],Yn;function vt(t,s,a,r,o){function i(...l){if(!(this instanceof i))throw new TypeError(Ei);Cu(this,s(...l))}function n(l,d){return Object.defineProperties(function(...u){return l.call(this,e(this),...u)},po(d))}function e(l){let d=X(l);if(!d||d.branding!==t)throw new TypeError(Ei);return d}return Object.defineProperties(i.prototype,{...se(Ct(n,a)),...cs(Ct(n,r)),...Qa("Temporal."+t)}),Object.defineProperties(i,{...cs(o),...po(t)}),[i,(l)=>{let d=Object.create(i.prototype);return Cu(d,l),d},e]}function bu(t){return t=t.concat("id").sort(),(s)=>{if(!ae(s,t))throw new TypeError(Nd);return s}}function Xs(t){if(X(t)||t.calendar!==void 0||t.timeZone!==void 0)throw new TypeError(jd);return t}function Ur(t,s){let a={};for(let r in t)a[r]=({o},i)=>{let n=X(i)||{},{branding:e}=n,l=e===xs||s.includes(e)?n:it(i);return o[r](l)};return a}function Tn(t){let s={};for(let a in t)s[a]=(r)=>{let{calendar:o}=r;return(i=o,typeof i=="string"?Ws(i):(n=i,Object.assign(Object.create(pm),{i:n})))[a](r);var i,n};return s}function is(){throw new TypeError(kd)}function Sa({calendar:t}){return typeof t=="string"?new Rn(t):t}function gu(t,s){if(s=F(s),N(t)){let r=X(t);if(r&&r.branding===Vs)return C(s),r;let o=Iu(t);return bi(Br(o||x),!o,t,s)}let a=cl(Ws,t);return C(s),a}function Hu(t,s,a){return r=s.call(t,ot(G(a))),Wo(ha(r));var r}function Nr(t,s=Au){let a=Object.keys(s).sort(),r={};for(let o of a)r[o]=w(s[o],t,ou(t[o]));return r}function b(t,s){return typeof t=="string"?Zr(t):Nr(t,s)}function Z(t){return b(t,mn)}function Kt(t){if(N(t)){let s=X(t);if(s)switch(s.branding){case Lr:return s;case Nt:return G(s.epochNanoseconds)}}return nl(t)}function wu(t,s,a){let r=s.l(Kt(a).epochNanoseconds,t);return r?ot(G(r)):null}function D(t){return N(t)?(X(t)||{}).timeZone||ym(t):((s)=>Rr(hl(A(s))))(t)}function ss(t,s){if(N(t)){let a=X(t)||{};switch(a.branding){case $r:return C(s),a;case Cs:return C(s),bt(a);case Nt:return C(s),Ki(Z,a)}return zl(t,s)}return C(s),pl(t)}function hn(t){return t===void 0?void 0:ss(t)}function zs(t,s){if(s=F(s),N(t)){let r=X(t);return r&&r.branding===Gs?(C(s),r):Oi(_r(Ma(t)),t,s)}let a=ul(Ws,t);return C(s),a}function as(t,s){if(s=F(s),N(t)){let r=X(t)||{};switch(r.branding){case Cs:return C(s),r;case xs:return C(s),$({...r,...xt});case Nt:return C(s),Si(Z,r)}return _l(zr(Ma(t)),t,s)}let a=dl(t);return C(s),a}function it(t,s){if(s=F(s),N(t)){let r=X(t)||{};switch(r.branding){case xs:return C(s),r;case Cs:return C(s),L(r);case Nt:return C(s),Mi(Z,r)}return Ri(zr(Ma(t)),t,s)}let a=xr(t);return C(s),a}function Du(t,s,a){return Rt(s.call(t,q(L(a,t))))}function qt(t){return(s)=>typeof s=="string"?Ws(s):((a,r)=>{let o=Object.keys(r).sort(),i={};for(let n of o)i[n]=w(r[n],a,a[n]);return i})(s,t)}function v(t){if(N(t)){let s=X(t);return s&&s.branding===jr?s:Bl(t)}return ml(t)}function Ia(t){if(t!==void 0){if(N(t)){let s=X(t)||{};switch(s.branding){case Nt:case xs:return s;case Cs:return L(s)}let a=Ma(t);return{...Vl(D,b,zr(a),t),calendar:a}}return el(t)}}function Ma(t){return Iu(t)||x}function Iu(t){let{calendar:s}=t;if(s!==void 0)return J(s)}function J(t){return N(t)?(X(t)||{}).calendar||vm(t):((s)=>ya(Tl(A(s))))(t)}function Bs(t,s){if(s=F(s),N(t)){let a=X(t);if(a&&a.branding===Nt)return fa(s),a;let r=Ma(t);return Wl(D,b,zr(r),r,t,s)}return ll(t,s)}function xu(t){return Ct((s)=>(a)=>s(pn(a)),t)}function pn(t){return at(t,Z)}function Xp(){let t=ts.prototype,s=Object.getOwnPropertyDescriptors(t),a=Object.getOwnPropertyDescriptors(ts),r=function(o,i={}){if(!(this instanceof r))return new r(o,i);On.set(this,((n,e={})=>{let l=new ts(n,e),d=l.resolvedOptions(),u=d.locale,c=ct(Object.keys(e),d),p=dt(tm),m=(...T)=>{let h,f=T.map((y,P)=>{let g=X(y),E=(g||{}).branding;if(P&&h&&h!==E)throw new TypeError(Wd);return h=E,g});return h?p(h)(u,c,...f):[l,...T]};return m.u=l,m})(o,i))};for(let o in s){let i=s[o],n=o.startsWith("format")&&Qp(o);typeof i.value=="function"?i.value=o==="constructor"?r:n||Yp(o):n&&(i.get=function(){return n.bind(this)})}return a.prototype.value=Object.create(t,s),Object.defineProperties(r,a),r}function Qp(t){return function(...s){let a=On.get(this),[r,...o]=a(...s);return r[t](...o)}}function Yp(t){return function(...s){return On.get(this).u[t](...s)}}function tm(t){let s=sm[t];if(!s)throw new TypeError(Vd(t));return Zt(s,dt(Ai))}var sm={Instant:nn,PlainDateTime:en,PlainDate:ln,PlainTime:dn,PlainYearMonth:un,PlainMonthDay:cn},am=Zt(nn),rm=Zt(yu),om=Zt(en),im=Zt(ln),nm=Zt(dn),em=Zt(un),lm=Zt(cn),fn={era:de,eraYear:fo,year:ha,month:Rt,daysInMonth:Rt,daysInYear:Rt,inLeapYear:ru,monthsInYear:Rt},Vr={monthCode:A},Pn={day:Rt},Su={dayOfWeek:Rt,dayOfYear:Rt,weekOfYear:ue,yearOfWeek:fo,daysInWeek:Rt},Mu=Object.assign({},fn,Vr,Pn,Su),Gr=new WeakMap,X=Gr.get.bind(Gr),Cu=Gr.set.bind(Gr),dm={...Ur(fn,[Gs]),...Ur(Su,[]),...Ur(Vr,[Gs,Vs]),...Ur(Pn,[Vs])},yn=Tn(Mu),um=Tn({...fn,...Vr}),cm=Tn({...Vr,...Pn}),Ka={calendarId:(t)=>W(t.calendar)},pm=Ct((t,s)=>function(a){let{i:r}=this;return t(r[s](q(L(a,r))))},Mu),mm=ma((t)=>(s)=>s[t],R.concat("sign")),gn=ma((t,s)=>(a)=>a[Dt[s]],Ut),Ku={epochSeconds:Ae,epochMilliseconds:ur,epochMicroseconds:ve,epochNanoseconds:qe},Aa=w(mo,new Set(["branding"])),[Tm,Js,hm]=vt(Vs,w(dd,J),{...Ka,...cm},{getISOFields:Aa,getCalendar:Sa,with(t,s,a){return Js(td(Mm,t,this,Xs(s),a))},equals:(t,s)=>Sl(t,gu(s)),toPlainDate(t,s){return q(Rd(va,t,this,s))},toLocaleString(t,s,a){let[r,o]=lm(s,a,t);return r.format(o)},toString:ko,toJSON:(t)=>ko(t),valueOf:is},{from:(t,s)=>Js(gu(t,s))}),Au={getOffsetNanosecondsFor:Hu,getPossibleInstantsFor(t,s,a){let r=[...s.call(t,B($(a,x)))].map((i)=>Pm(i).epochNanoseconds),o=r.length;return o>1&&(r.sort(tt),_o(ht(Tt(r[0],r[o-1])))),r}},mn={getOffsetNanosecondsFor:Hu},[fm,ot,Pm]=vt(Lr,od,Ku,{add:(t,s)=>ot(zo(0,t,v(s))),subtract:(t,s)=>ot(zo(1,t,v(s))),until:(t,s,a)=>H(hi(0,t,Kt(s),a)),since:(t,s,a)=>H(hi(1,t,Kt(s),a)),round:(t,s)=>ot($e(t,s)),equals:(t,s)=>Ol(t,Kt(s)),toZonedDateTime(t,s){let a=Lt(s);return j(Ii(t,D(a.timeZone),J(a.calendar)))},toZonedDateTimeISO:(t,s)=>j(Ii(t,D(s))),toLocaleString(t,s,a){let[r,o]=am(s,a,t);return r.format(o)},toString:(t,s)=>Fo(D,Z,t,s),toJSON:(t)=>Fo(D,Z,t),valueOf:is},{from:(t)=>ot(Kt(t)),fromEpochSeconds:(t)=>ot(Hd(t)),fromEpochMilliseconds:(t)=>ot(Dd(t)),fromEpochMicroseconds:(t)=>ot(Id(t)),fromEpochNanoseconds:(t)=>ot(Sd(t)),compare:(t,s)=>pi(Kt(t),Kt(s))}),[Wr,wT]=vt("TimeZone",(t)=>{let s=Cl(t);return{branding:"TimeZone",id:s,o:Zr(s)}},{id:(t)=>t.id},{getPossibleInstantsFor:({o:t},s)=>t.getPossibleInstantsFor(as(s)).map((a)=>ot(G(a))),getOffsetNanosecondsFor:({o:t},s)=>t.getOffsetNanosecondsFor(Kt(s).epochNanoseconds),getOffsetStringFor(t,s){let a=Kt(s).epochNanoseconds,r=Nr(this,mn).getOffsetNanosecondsFor(a);return Ts(r)},getPlainDateTimeFor(t,s,a=x){let r=Kt(s).epochNanoseconds,o=Nr(this,mn).getOffsetNanosecondsFor(r);return B($(Jt(r,o),J(a)))},getInstantFor(t,s,a){let r=as(s),o=Ho(a),i=Nr(this);return ot(G(ut(i,r,o)))},getNextTransition:({o:t},s)=>wu(1,t,s),getPreviousTransition:({o:t},s)=>wu(-1,t,s),equals(t,s){return!!br(this,D(s))},toString:(t)=>t.id,toJSON:(t)=>t.id},{from(t){let s=D(t);return typeof s=="string"?new Wr(s):s}}),ym=bu(Object.keys(Au)),[gm,rs]=vt($r,ud,gn,{getISOFields:Aa,with(t,s,a){return rs(sd(this,Xs(s),a))},add:(t,s)=>rs(Yo(0,t,v(s))),subtract:(t,s)=>rs(Yo(1,t,v(s))),until:(t,s,a)=>H(wi(0,t,ss(s),a)),since:(t,s,a)=>H(wi(1,t,ss(s),a)),round:(t,s)=>rs(Ze(t,s)),equals:(t,s)=>Ml(t,ss(s)),toZonedDateTime:(t,s)=>j(Od(D,it,b,t,s)),toPlainDateTime:(t,s)=>B(bd(t,it(s))),toLocaleString(t,s,a){let[r,o]=nm(s,a,t);return r.format(o)},toString:Uo,toJSON:(t)=>Uo(t),valueOf:is},{from:(t,s)=>rs(ss(t,s)),compare:(t,s)=>Or(ss(t),ss(s))}),[wm,os,xm]=vt(Gs,w(ld,J),{...Ka,...um},{getISOFields:Aa,getCalendar:Sa,with(t,s,a){return os(Yl(Sm,t,this,Xs(s),a))},add:(t,s,a)=>os(Qo(Ru,0,t,v(s),a)),subtract:(t,s,a)=>os(Qo(Ru,1,t,v(s),a)),until:(t,s,a)=>H(gi(Ou,0,t,zs(s),a)),since:(t,s,a)=>H(gi(Ou,1,t,zs(s),a)),equals:(t,s)=>Il(t,zs(s)),toPlainDate(t,s){return q(Cd(va,t,this,s))},toLocaleString(t,s,a){let[r,o]=em(s,a,t);return r.format(o)},toString:Zo,toJSON:(t)=>Zo(t),valueOf:is},{from:(t,s)=>os(zs(t,s)),compare:(t,s)=>Ps(zs(t),zs(s))}),[Cm,B]=vt(Cs,w(nd,J),{...Ka,...yn,...gn},{getISOFields:Aa,getCalendar:Sa,with(t,s,a){return B(Xl(va,t,this,Xs(s),a))},withCalendar:(t,s)=>B(Sr(t,J(s))),withPlainDate:(t,s)=>B(vd(t,it(s))),withPlainTime:(t,s)=>B(Ad(t,hn(s))),add:(t,s,a)=>B(Jo(Os,0,t,v(s),a)),subtract:(t,s,a)=>B(Jo(Os,1,t,v(s),a)),until:(t,s,a)=>H(Pi(At,0,t,as(s),a)),since:(t,s,a)=>H(Pi(At,1,t,as(s),a)),round:(t,s)=>B(je(t,s)),equals:(t,s)=>Hl(t,as(s)),toZonedDateTime:(t,s,a)=>j(hd(b,t,D(s),a)),toPlainDate:(t)=>q(L(t)),toPlainTime:(t)=>rs(bt(t)),toPlainYearMonth(t){return os(fd(_r,t,this))},toPlainMonthDay(t){return Js(Pd(Br,t,this))},toLocaleString(t,s,a){let[r,o]=om(s,a,t);return r.format(o)},toString:Lo,toJSON:(t)=>Lo(t),valueOf:is},{from:(t,s)=>B(as(t,s)),compare:(t,s)=>Ti(as(t),as(s))}),[Rm,q,vu]=vt(xs,w(ed,J),{...Ka,...yn},{getISOFields:Aa,getCalendar:Sa,with(t,s,a){return q(Ql(va,t,this,Xs(s),a))},withCalendar:(t,s)=>q(Sr(t,J(s))),add:(t,s,a)=>q(Xo(Os,0,t,v(s),a)),subtract:(t,s,a)=>q(Xo(Os,1,t,v(s),a)),until:(t,s,a)=>H(yi(At,0,t,it(s),a)),since:(t,s,a)=>H(yi(At,1,t,it(s),a)),equals:(t,s)=>Dl(t,it(s)),toZonedDateTime(t,s){let a=!N(s)||s instanceof Wr?{timeZone:s}:s;return j(yd(D,ss,b,t,a))},toPlainDateTime:(t,s)=>B(gd(t,hn(s))),toPlainYearMonth(t){return os(wd(_r,t,this))},toPlainMonthDay(t){return Js(xd(Br,t,this))},toLocaleString(t,s,a){let[r,o]=im(s,a,t);return r.format(o)},toString:jo,toJSON:(t)=>jo(t),valueOf:is},{from:(t,s)=>q(it(t,s)),compare:(t,s)=>Ps(it(t),it(s))}),wn={fields(t,s,a){return[...s.call(t,a)]}},qu=Object.assign({dateFromFields(t,s,a,r){return vu(s.call(t,Object.assign(Object.create(null),a),r))}},wn),Eu=Object.assign({yearMonthFromFields(t,s,a,r){return xm(s.call(t,Object.assign(Object.create(null),a),r))}},wn),Fu=Object.assign({monthDayFromFields(t,s,a,r){return hm(s.call(t,Object.assign(Object.create(null),a),r))}},wn),xn={mergeFields(t,s,a,r){return Lt(s.call(t,Object.assign(Object.create(null),a),Object.assign(Object.create(null),r)))}},Om=Object.assign({},qu,xn),bm=Object.assign({},Eu,xn),Hm=Object.assign({},Fu,xn),Cn={dateAdd(t,s,a,r,o){return vu(s.call(t,q(L(a,t)),H(S(r)),o))}},$u=Object.assign({},Cn,{dateUntil(t,s,a,r,o,i){return Am(s.call(t,q(L(a,t)),q(L(r,t)),Object.assign(Object.create(null),i,{largestUnit:Ra[o]})))}}),Dm=Object.assign({},Cn,{day:Du}),Im=Object.assign({},$u,{day:Du}),_r=qt(Eu),zr=qt(qu),Br=qt(Fu),Sm=qt(bm),va=qt(Om),Mm=qt(Hm),Os=qt(Cn),At=qt($u),Ru=qt(Dm),Ou=qt(Im),[Km,H,Am]=vt(jr,cd,{...mm,blank:rl},{with:(t,s)=>H(ad(t,s)),negated:(t)=>H(gr(t)),abs:(t)=>H(al(t)),add:(t,s,a)=>H(oi(Ia,At,b,0,t,v(s),a)),subtract:(t,s,a)=>H(oi(Ia,At,b,1,t,v(s),a)),round:(t,s)=>H(sl(Ia,At,b,t,s)),total:(t,s)=>Fe(Ia,At,b,t,s),toLocaleString(t,s,a){return Intl.DurationFormat?new Intl.DurationFormat(s,a).format(this):Tr(t)},toString:Tr,toJSON:(t)=>Tr(t),valueOf:is},{from:(t)=>H(v(t)),compare:(t,s,a)=>Rl(Ia,Os,b,v(t),v(s),a)}),Lu={toString:(t)=>t.id,toJSON:(t)=>t.id,...dm,dateAdd:({id:t,o:s},a,r,o)=>q(L(s.dateAdd(it(a),v(r),o),t)),dateUntil:({o:t},s,a,r)=>H(S(t.dateUntil(it(s),it(a),De(r)))),dateFromFields:({id:t,o:s},a,r)=>q(Ri(s,a,r,le(t))),yearMonthFromFields:({id:t,o:s},a,r)=>os(Oi(s,a,r,ne(t))),monthDayFromFields:({id:t,o:s},a,r)=>Js(bi(s,0,a,r,ee(t))),fields({o:t},s){let a=new Set(Ht),r=[];for(let o of s){if(A(o),!a.has(o))throw new RangeError(qi(o));a.delete(o),r.push(o)}return t.fields(r)},mergeFields:({o:t},s,a)=>t.mergeFields(To(Po(s)),To(Po(a)))},[Rn]=vt("Calendar",(t)=>{let s=Ll(t);return{branding:"Calendar",id:s,o:Ws(s)}},{id:(t)=>t.id},Lu,{from(t){let s=J(t);return typeof s=="string"?new Rn(s):s}}),vm=bu(Object.keys(Lu).slice(4)),[qm,j]=vt(Nt,w(id,J,D),{...Ku,...Ka,...xu(yn),...xu(gn),offset:(t)=>Ts(pn(t).offsetNanoseconds),offsetNanoseconds:(t)=>pn(t).offsetNanoseconds,timeZoneId:(t)=>W(t.timeZone),hoursInDay:(t)=>ke(b,t)},{getISOFields:(t)=>Ye(Z,t),getCalendar:Sa,getTimeZone:({timeZone:t})=>typeof t=="string"?new Wr(t):t,with(t,s,a){return j(Jl(va,b,t,this,Xs(s),a))},withCalendar:(t,s)=>j(Sr(t,J(s))),withTimeZone:(t,s)=>j(qd(t,D(s))),withPlainDate:(t,s)=>j(Kd(b,t,it(s))),withPlainTime:(t,s)=>j(Md(b,t,hn(s))),add:(t,s,a)=>j(Bo(Os,b,0,t,v(s),a)),subtract:(t,s,a)=>j(Bo(Os,b,1,t,v(s),a)),until:(t,s,a)=>H(S(fi(At,b,0,t,Bs(s),a))),since:(t,s,a)=>H(S(fi(At,b,1,t,Bs(s),a))),round:(t,s)=>j(Le(b,t,s)),startOfDay:(t)=>j(Ue(b,t)),equals:(t,s)=>bl(t,Bs(s)),toInstant:(t)=>ot(pd(t)),toPlainDateTime:(t)=>B(Si(Z,t)),toPlainDate:(t)=>q(Mi(Z,t)),toPlainTime:(t)=>rs(Ki(Z,t)),toPlainYearMonth(t){return os(md(_r,t,this))},toPlainMonthDay(t){return Js(Td(Br,t,this))},toLocaleString(t,s,a={}){let[r,o]=rm(s,a,t);return r.format(o)},toString:(t,s)=>$o(Z,t,s),toJSON:(t)=>$o(Z,t),valueOf:is},{from:(t,s)=>j(Bs(t,s)),compare:(t,s)=>mi(Bs(t),Bs(s))}),Em=Object.defineProperties({},{...Qa("Temporal.Now"),...cs({timeZoneId:()=>kt(),instant:()=>ot(G(wa())),zonedDateTime:(t,s=kt())=>j(z(wa(),D(s),J(t))),zonedDateTimeISO:(t=kt())=>j(z(wa(),D(t),x)),plainDateTime:(t,s=kt())=>B($(Us(Z(D(s))),J(t))),plainDateTimeISO:(t=kt())=>B($(Us(Z(D(t))),x)),plainDate:(t,s=kt())=>q(L(Us(Z(D(s))),J(t))),plainDateISO:(t=kt())=>q(L(Us(Z(D(t))),x)),plainTimeISO:(t=kt())=>rs(bt(Us(Z(D(t)))))})}),qa=Object.defineProperties({},{...Qa("Temporal"),...cs({PlainYearMonth:wm,PlainMonthDay:Tm,PlainDate:Rm,PlainTime:gm,PlainDateTime:Cm,ZonedDateTime:qm,Instant:fm,Calendar:Rn,TimeZone:Wr,Duration:Km,Now:Em})}),Fm=Xp(),On=new WeakMap,$m=Object.defineProperties(Object.create(Intl),cs({DateTimeFormat:Fm}));class Jr extends bs{provider;static _name="AuthenticationServiceContainer";constructor(t){super();this.provider=t}async getSession(t,s){let a=await this.provider.adapter.findSession({token:t,userAgent:s}),r=null;if(a?.user)r=await this.provider.extendSession(a.user),a.user.extension=r;return a}async generateMagicLink(t){}async upsertSession(t){await this.provider.adapter.findSession({token:"",userAgent:""})}async authenticate(t){try{let s=await this.provider.adapter.findUserByEmailAddress(t,!1),a=await this.createOrUpdateSession({email:t,id:s.id});return new es().ctx().setCookie("access_token",a.token,{expires:a.expiresAt}),!0}catch(s){console.log(s)}return!1}async createOrUpdateSession(t){let s=this.provider,a=new es,r=a.headers.get("User-Agent"),o=new Bun.CryptoHasher("sha256");o.update(`${t.email}${r}`);let i=o.digest("hex"),n=await s.adapter.findSession({token:i,userAgent:a.headers.get("User-Agent")});if(!n){let e=t.id;if(!e){let{id:l}=await s.adapter.findUserByEmailAddress(t.email,!1);e=l}n=await s.adapter.createSession({token:i,userId:e,userAgent:a.headers.get("User-Agent"),expiresAt:new Date(qa.Now.instant().add({hours:s.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(qa.Now.instant().add({hours:s.sessionAbsoluteExpiresInHours}).toString())})}else n=await s.adapter.updateSession({token:i,expiresAt:new Date(qa.Now.instant().add({hours:s.sessionExpiresInHours}).toString())});return n}async createMagicLinkToken(t){let s=Jr.use()?.provider,a=await s.adapter.findUserByEmailAddress(t,!1);if(a){await s.adapter.deleteMagicLinkToken(t);let r=await s.generateMagicLinkToken(t),o=(parseInt(Lm(4).toString("hex"),16)%1e6).toString().padStart(6,"0");return await s.adapter.createMagicLinkToken({email:t,token:r,pin:o}),{user:a,email:t,pin:o,token:r}}}}class ju extends mt{async run(t){let s=Hs.getStore(),a=s.req.cookies.get("access_token"),r=s.req.headers.get("access_token"),o=a||r;if(!o)throw new oa;let i=s.user;if(!i){let n=await Jr.use().getSession(o,s.req.headers.get("User-Agent"));if(!n)throw new oa;i=n?.user,s.setUser(i)}return{}}}class Zu extends mt{async run(...t){let[s="public",a="864000",...r]=t,o=`${s}, max-age=${a}${r.length>0?", ":""}${r.join(", ")}`;if(t.length===0)o="public, max-age=864000, stale-while-revalidate=300, stale-if-error=600";if(t.length===1&&t[0]==="public")o="public, max-age=864000, stale-while-revalidate=300, stale-if-error=600";if(t.length===1&&t[0]==="private")o="private, max-age=0, stale-while-revalidate=300, stale-if-error=600";if(this.req.rawRequest.method==="GET")this.req.ctx().setHeaders("Cache-Control",o);return{}}}var jm={"Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Authorization, X-Requested-With","Access-Control-Allow-Credentials":"true"};class ku extends mt{config={origins:{"":{"Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Authorization, X-Requested-With","Access-Control-Allow-Credentials":"true"}}};run(){let t=this.req,s=t.rawRequest.headers.get("Origin");if(this.config.origins[s]){t.ctx().setHeaders("Access-Control-Allow-Origin",s);let a={...jm,...this.config.origins[s]};for(let[r,o]of Object.entries(a))t.ctx().setHeaders(r,o)}return{}}}class bn extends bs{service;static _name="RateLimiterServiceContainer";constructor(t){super();this.service=t}}class Uu extends Pt{constructor(){super("Rate limit exceeded");this.payload={api:{status:429,data:{error:{message:"Rate limit exceeded"}},headers:{"Content-Type":"application/json"}},view:{error:{message:"Rate limit exceeded"},status:429}}}}class Nu extends mt{async run(t=1000){let s=this.req.headers.get("x-forwarded-for"),a=bn.use().service.driver;if(a.consume.call(a,s,this.req.routePath)>t)throw new Uu;return{}}}class Gu extends mt{async run(){let t=this.req.cookies.get("csrf_token");if(!t)throw new Hn;if(!["POST","PUT","PATCH","DELETE"].includes(this.req.rawRequest.method))return{};if(!Bun.CSRF.verify(t,{secret:process.env.SECRET}))throw new Hn;return{}}}class Hn extends Pt{constructor(){super("Invalid CSRF token");this.name="InvalidCSRFTokenError"}payload={api:{status:403,data:{error:"Invalid CSRF token"}},view:{}}}class Vu{policiesList={};constructor(){let t=this.register();for(let s of t){let a=new s;this.policiesList[s.name]=a}}register(){return[]}}class Wu{all(t,s){return!0}}export{sc as getCookies,sa as ViewRouter,aa as ValidationError,Ea as ResourceController,Pt as RequestBreakerError,Nu as RateLimitMiddleware,Vu as PoliciesServiceProvider,Wu as Policies,Fn as MiddlewareServiceProvider,mt as Middleware,Ln as InsufficientPermissionsError,es as HttpRequest,ku as CorsMiddleware,Xr as Controller,Zu as CacheMiddleware,Gu as CSRFMiddleware,$n as AuthorizationError,ju as AuthenticationMiddleware,oa as AuthenticationError,ta as ApiRouter};export{Xr as G,Dn as H,ta as I,sa as J,aa as K,Ju as L,Hs as M,es as N,Fn as O,$n as P,Ln as Q,qa as R,Jr as S,bn as T};
2
+ import{U as qe}from"../chunk-9aswnsye.js";import{sc as ft,uc as Me}from"../chunk-fe1gn043.js";import{vc as ve}from"../chunk-3q85w7aa.js";import{xc as _a}from"../chunk-nxrhps23.js";import"../chunk-6fy0y9na.js";class Ba{static kind="controller";constructor(){}}class Kr extends Ba{}function be(t){return typeof t==="function"&&t.prototype!==void 0}function zu(t){return be(t)}class pt{method;handler;methodName;__internal_brand="RouteHandler";middlewares=[];constructor(t,s,r){this.method=t;this.handler=s;this.methodName=r;this.handler=s,this.methodName=r,this.method=t}__internal_use(){return{run:this.run.bind(this),middlewares:this.middlewares}}run(t){if(zu(this.handler)){let s=new this.handler;return s[this.methodName].bind(s)()}return this.handler()}middleware(t){return this.middlewares=t,this}}class He{constructor(...t){return new pt(...t)}}class Ja{static __brand="ApiRouter";routes={};middlewares=[];middleware(t){}get(t,s){return new pt("GET",t,s)}post(t,s){return new pt("POST",t,s)}put(t,s){return new pt("PUT",t,s)}patch(t,s){return new pt("PATCH",t,s)}delete(t,s){return new pt("DELETE",t,s)}resource(t){return{first:{get:new pt("GET",t,"list"),post:new pt("POST",t,"store")},second:{get:new pt("GET",t,"show"),put:new pt("PUT",t,"update"),delete:new pt("DELETE",t,"delete")}}}file(t,s){return new He("GET",t,s)}}class De extends Kr{async list(){}async show(){}async store(){}async update(){}async delete(){}}class Bu extends Ja{routes={"/:orgId/products/:productId":this.resource(De)}}class Ie{kind="redirect";viewPath="REDIRECT";middlewares=[];handler;constructor(t){if(!t)this.handler=()=>({});else if(typeof t==="function")this.handler=t;else{let[s,r]=t,a=new s,i=a[r].bind(a);this.handler=(o)=>{return i()}}}async run(t,s){let{destination:r,permanent:a=!1,status:i=307}=await this.handler(t);if(!r)throw new Error(`Redirect destination is required see ${s}`);return Me.to(r,{permanent:a,status:i}),{}}middleware(t){return this.middlewares=t,this}}class Se{viewPath;middlewares=[];handler;constructor(t,s){this.viewPath=t;if(!s)this.handler=()=>({});else if(typeof s==="function")this.handler=s;else{let[r,a]=s,i=new r,o=i[a].bind(i);this.handler=(e)=>{return o()}}}async run(t,s){let r=await this.handler(t);return{[this.viewPath]:{...r,breadcrumb:{label:r?.breadcrumb??"",href:s}}}}middleware(t){return this.middlewares=t,this}}class Ae{viewPath;children;middlewares=[];handler=()=>({});constructor(t,s,r){this.viewPath=t;if(typeof s==="function")this.handler=s,this.children=class extends Qs{routes=r??{}};else if(Array.isArray(s)){let[a,i]=s,o=new a,e=o[i].bind(o);this.handler=(n)=>{return e(n)},this.children=class extends Qs{routes=r??{}}}else this.children=class extends Qs{routes=s},this.handler=()=>({})}async run(t,s){let r=await this.handler(t);return{[this.viewPath]:{...r,breadcrumb:{label:r?.breadcrumb??"",href:s}}}}middleware(t){return this.middlewares=t,this}}class Qs{middlewares=[];routes={};view(t,s){return new Se(t,s)}redirect(t){return new Ie(t)}layout(t,s,r){return new Ae(t,s,r)}}class Ys extends ft{errors={};constructor(t){super("Validation error");this.name="ValidationError",this.errors=t,this.payload={api:{status:400,data:{error:{kind:"validation_error",messages:t}},headers:{"Content-Type":"application/json"}},view:{status:400}}}}import{AsyncLocalStorage as Ju}from"async_hooks";class qr{name;value;options;constructor(t,s,r={}){this.name=t;this.value=s;this.options=r}toString(){return[`${this.name}=${this.value}`,this.options.maxAge?`Max-Age=${this.options.maxAge}`:"",this.options.httpOnly?"HttpOnly":"",this.options.secure?"Secure":"",this.options.sameSite?`SameSite=${this.options.sameSite}`:"SameSite=Strict",this.options.path?`Path=${this.options.path}`:"Path=/",this.options.domain?`Domain=${this.options.domain}`:"",this.options.expires?`Expires=${this.options.expires.toUTCString()}`:"",this.options.partitioned?"Partitioned":""].filter((t)=>t!=="").join("; ")}}var Xa=new Ju;class Ke{req;cookies=new Set;headers=new Headers;prefetchedResources=new Map;prefetchPromiseQueue=new Set;user=null;csrfHmac=null;constructor(t){this.req=t}setCSRFHmac(t){this.csrfHmac=t}setCookie(t,s,r={}){this.cookies.add(new qr(t,s,r))}deleteCookie(t){this.cookies.add(new qr(t,"",{maxAge:-1}))}setHeaders(t,s){this.headers.set(t,s)}setUser(t){this.user=t}setRequest(t){this.req=t}destroy(){delete this.cookies,delete this.headers,delete this.prefetchedResources,delete this.prefetchPromiseQueue,delete this.user}}class Os{static getStore(){return Xa.getStore()}static setRequest(t){Xa.getStore().req=t}static run(t,s){return Xa.run(new Ke(t),s)}}class bs{data;constructor(t){this.data=t}get(t){return this.data[t]}has(t){return this.data[t]!==void 0}toJSON(){return this.data}}function Xu(t){let[s,r]=t.match(/\d+|\D+/g)??[];if(!s||!r)return 0;let a=parseInt(s);switch(r){case"B":return a;case"KB":return a*1024;case"MB":return a*1024*1024;case"GB":return a*1024*1024*1024;case"TB":return a*1024*1024*1024*1024;default:return 0}}function Qu(t){switch(t){case"image":return"image";case"png":return"image/png";case"jpg":return"image/jpeg";case"jpeg":return"image/jpeg";case"ttf":return"font/ttf";case"excel":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"csv":return"text/csv";case"word":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"pdf":return"application/pdf";case"json":return"application/json";default:return t}}function Yu(t){let[s,r]=t.split(":");switch(s){case"required":return(a)=>{if(a instanceof Blob)return a.size>0;return a!==null&&a!==void 0&&a?.length>0};case"password":return(a)=>{return/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/.test(a)};case"number":return(a)=>{if(typeof a!=="number")return!1;return!isNaN(a)};case"min":return(a)=>{return a?.length>=parseInt(r)};case"max":return(a)=>{return a?.length<=parseInt(r)};case"email":return(a)=>{return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)};case"file":return(a)=>{return a instanceof Blob};case"fileType":return(a)=>{if(a instanceof Blob){let i=Qu(r);return a.type.startsWith(i)}};case"fileSize":return(a)=>{if(a instanceof Blob){let i=Xu(r);return a.size<=i}};default:return()=>!0}}class tr{kind;rawRequest;headers;cookies;search;schema={};routePath;params;constructor(t,s,r,a){if(!t){let e=Os.getStore().req;this.params=e.params,this.rawRequest=e.rawRequest,this.kind=e.kind,this.routePath=e.routePath}else this.params=s,this.rawRequest=t,this.routePath=a,this.kind=r??"api";this.headers=this.rawRequest.headers;let i=this.rawRequest.headers.get("Cookie"),o=new Map;if(i){let e=i.split(";");for(let n of e){let[d,l]=n.split("=");o.set(d.trim(),l.trim())}}if(this.rawRequest.method==="GET"){let e=new URL(this.rawRequest.url),n=new Map;for(let[l,u]of e.searchParams)if(n.has(l)){let c=n.get(l);if(Array.isArray(c))c.push(u),n.set(l,c);else n.set(l,[c,u])}else n.set(l,u);let d=Object.fromEntries(n.entries());this.search=new bs(d)}this.cookies=o}locale(){return qe.use().detectLocale(this)}ctx(){return Os.getStore()}refine(t){return{}}async parseBody(){let t=new bs({});if(this.rawRequest.headers.get("Content-Type")==="application/json"){let s=await this.rawRequest.json();t=new bs(s)}if(this.rawRequest.headers.get("Content-Type")==="application/x-www-form-urlencoded"){let s=await this.rawRequest.formData();t=new bs(s)}if(this.rawRequest.headers.get("Content-Type")?.startsWith("multipart/form-data")){let s=await this.rawRequest.formData(),r=new Map;for(let[a,i]of s.entries())if(r.has(a)){let o=r.get(a);if(Array.isArray(o))o.push(i),r.set(a,o);else r.set(a,[o,i])}else r.set(a,i);t=new bs(Object.fromEntries(r.entries()))}return t}validateInput(t){let s={};for(let[r,a]of Object.entries(this.schema))for(let[i,o]of Object.entries(a)){let e=Yu(i),n=o,d=!1;if(typeof o==="function")n=o(t.get(r)),d=typeof n==="undefined";else d=e(t.get(r));if(d)continue;if(!s[r])s[r]=[];if(i==="required"){s[r]=[String(n)];break}else s[r].push(String(n))}for(let[r,a]of Object.entries(this.refine(t.toJSON())??{})){if(!s[r])s[r]=[];s[r]=[...s[r]??[],a]}if(Object.keys(s).length>0)throw new Ys(s);else return t}async input(){return this.validateInput(await this.parseBody())}async safeInput(){let t=await this.parseBody();try{return this.validateInput(t),{isValid:!0,errors:{},input:t}}catch(s){if(!(s instanceof Ys))throw s;return{isValid:!1,errors:s.errors,input:t}}}}class mt{req;config={};constructor(t){this.req=t}run(...t){return{}}static configure(t){let s=this;return class extends s{config=t}}}function tc(t){let s=t.headers.get("cookie");if(!s)return new Map;let r=new Map,a=s.split(";");for(let i of a){let[o,e]=i.split("=");r.set(o.trim(),e)}return r}class Ee extends ve{aliases={};boot(){}}class Fe extends ft{error;constructor(t="Not authorized"){super("Authentication error");this.name="AuthenticationError",this.error=t,this.payload={api:{status:401,data:{error:this.error}},view:{}}}}class $e extends ft{error;constructor(t="Insufficient permissions"){super("Authentication error");this.name="AuthenticationError",this.error=t,this.payload={api:{status:401,data:{error:this.error}},view:{}}}}class sr extends ft{constructor(){super("Authentication error");this.name="AuthenticationError"}payload={api:{status:401,data:{error:"Authentication error"}},view:{status:302,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:"/auth/sign-in"}}}}import{randomBytes as $m}from"crypto";function et(t,s,r,a,i){return yt(s,Ye(t,s),r,a,i)}function yt(t,s,r,a,i,o){let e=ri(s,r,a);if(i&&s!==e)throw new RangeError($l(t,s,r,a,o));return e}function Ye(t,s){let r=t[s];if(r===void 0)throw new TypeError(Ko(s));return r}function U(t){return t!==null&&/object|function/.test(typeof t)}function lt(t,s=Map){let r=new s;return(a,...i)=>{if(r.has(a))return r.get(a);let o=t(a,...i);return r.set(a,o),o}}function ui(t){return us({name:t},1)}function us(t,s){return Ct((r)=>({value:r,configurable:1,writable:!s}),t)}function tn(t){return Ct((s)=>({get:s,configurable:1}),t)}function Br(t){return{[Symbol.toStringTag]:{value:t,configurable:1}}}function Ks(t,s){let r={},a=t.length;for(let i of s)r[t[--a]]=i;return r}function Ct(t,s,r){let a={};for(let i in s)a[i]=t(s[i],i,r);return a}function ur(t,s,r){let a={};for(let i=0;i<s.length;i++){let o=s[i];a[o]=t(o,i,r)}return a}function sc(t,s,r){let a={};for(let i=0;i<t.length;i++)a[s[i]]=r[t[i]];return a}function ct(t,s){let r={};for(let a of t)r[a]=s[a];return r}function ci(t,s){let r={};for(let a in s)t.has(a)||(r[a]=s[a]);return r}function pi(t){t={...t};let s=Object.keys(t);for(let r of s)t[r]===void 0&&delete t[r];return t}function sn(t,s){for(let r of s)if(!(r in t))return 0;return 1}function rn(t,s,r){for(let a of t)if(s[a]!==r[a])return 0;return 1}function an(t,s,r){let a={...r};for(let i=0;i<s;i++)a[t[i]]=0;return a}function w(t,...s){return(...r)=>t(...s,...r)}function Ze(t){return t[0].toUpperCase()+t.substring(1)}function cr(t){return t.slice().sort()}function Lr(t,s){return String(s).padStart(t,"0")}function Vt(t,s){return Math.sign(t-s)}function ri(t,s,r){return Math.min(Math.max(t,s),r)}function Ft(t,s){return[Math.floor(t/s),ar(t,s)]}function ar(t,s){return(t%s+s)%s}function _t(t,s){return[Jr(t,s),mi(t,s)]}function Jr(t,s){return Math.trunc(t/s)||0}function mi(t,s){return t%s||0}function vr(t){return Math.abs(t%1)===0.5}function on(t,s,r){let a=0,i=0;for(let n=0;n<=s;n++){let d=t[r[n]],l=It[n],u=O/l,[c,p]=_t(d,u);a+=p*l,i+=c}let[o,e]=_t(a,O);return[i+o,e]}function Xr(t,s,r){let a={};for(let i=s;i>=0;i--){let o=It[i];a[r[i]]=Jr(t,o),t=mi(t,o)}return a}function en(t){return t===x?Aa:[]}function nn(t){return t===x?xr:[]}function dn(t){return t===x?["year","day"]:[]}function ln(t){if(t!==void 0)return K(t)}function un(t){if(t!==void 0)return Rt(t)}function Ti(t){if(t!==void 0)return pr(t)}function Rt(t){return mn(pr(t))}function pr(t){return pn(Wc(t))}function Pi(t){if(t==null)throw new TypeError("Cannot be null or undefined");return t}function cn(t,s){if(s==null)throw new RangeError(Ko(t));return s}function Zt(t){if(!U(t))throw new TypeError(Fl);return t}function Qr(t,s,r=t){if(typeof s!==t)throw new TypeError(yr(r,s));return s}function pn(t,s="number"){if(!Number.isInteger(t))throw new RangeError(fc(s,t));return t||0}function mn(t,s="number"){if(t<=0)throw new RangeError(yc(s,t));return t}function hi(t){if(typeof t=="symbol")throw new TypeError(Cc);return String(t)}function kr(t,s){return U(t)?String(t):K(t,s)}function Yr(t){if(typeof t=="string")return BigInt(t);if(typeof t!="bigint")throw new TypeError(xc(t));return t}function Tn(t,s="number"){if(typeof t=="bigint")throw new TypeError(wc(s));if(t=Number(t),!Number.isFinite(t))throw new RangeError(gc(s,t));return t}function Q(t,s){return Math.trunc(Tn(t,s))||0}function Pn(t,s){return pn(Tn(t,s),s)}function je(t,s){return mn(Q(t,s),s)}function fi(t,s){let[r,a]=_t(s,O),i=t+r,o=Math.sign(i);return o&&o===-Math.sign(a)&&(i-=o,a+=o*O),[i,a]}function Ds(t,s,r=1){return fi(t[0]+s[0]*r,t[1]+s[1]*r)}function Ms(t,s){return fi(t[0],t[1]+s)}function Tt(t,s){return Ds(s,t,-1)}function tt(t,s){return Vt(t[0],s[0])||Vt(t[1],s[1])}function hn(t,s,r){return tt(t,s)===-1||tt(t,r)===1}function ta(t,s=1){let r=BigInt(O/s);return[Number(t/r),Number(t%r)*s]}function Is(t,s=1){let r=O/s,[a,i]=_t(t,r);return[a,i*s]}function fn(t,s=1){let[r,a]=t,i=Math.floor(a/s),o=O/s;return BigInt(r)*BigInt(o)+BigInt(i)}function Pt(t,s=1,r){let[a,i]=t,[o,e]=_t(i,s);return a*(O/s)+(o+(r?e/s:0))}function yi(t,s,r=Ft){let[a,i]=t,[o,e]=r(i,s);return[a*(O/s)+o,e]}function gi(t,s){let r=t.formatToParts(s),a={};for(let i of r)a[i.type]=i.value;return a}function wi(t){return et(t,"isoYear",lr,dr,1),t.isoYear===lr?et(t,"isoMonth",4,12,1):t.isoYear===dr&&et(t,"isoMonth",1,9,1),t}function Gt(t){return jt({...t,...xt,isoHour:12}),t}function jt(t){let s=et(t,"isoYear",lr,dr,1),r=s===lr?1:s===dr?-1:0;return r&&ht(Y({...t,isoDay:t.isoDay+r,isoNanosecond:t.isoNanosecond-r})),t}function ht(t){if(!t||hn(t,Yc,Qc))throw new RangeError(Da);return t}function zt(t){return on(t,5,Dt)[1]}function sa(t){let[s,r]=Ft(t,O);return[Xr(r,5,Dt),s]}function yn(t){return gn(t)[0]}function gn(t){return yi(t,wt)}function st(t){return qs(t.isoYear,t.isoMonth,t.isoDay,t.isoHour,t.isoMinute,t.isoSecond,t.isoMillisecond)}function Y(t){let s=st(t);if(s!==void 0){let[r,a]=_t(s,dt);return[r,a*St+(t.isoMicrosecond||0)*gs+(t.isoNanosecond||0)]}}function xi(t,s){let[r,a]=sa(zt(t)-s);return ht(Y({...t,isoDay:t.isoDay+a,...r}))}function Nr(...t){return qs(...t)/zl}function qs(...t){let[s,r]=wn(...t),a=s.valueOf();if(!isNaN(a))return a-r*dt}function wn(t,s=1,r=1,a=0,i=0,o=0,e=0){let n=t===lr?1:t===dr?-1:0,d=new Date;return d.setUTCHours(a,i,o,e),d.setUTCFullYear(t,s-1,r+n),[d,n]}function Jt(t,s){let[r,a]=Ms(t,s);a<0&&(a+=O,r-=1);let[i,o]=Ft(a,St),[e,n]=Ft(o,gs);return ra(r*dt+i,e,n)}function ra(t,s=0,r=0){let a=Math.ceil(Math.max(0,Math.abs(t)-Xc)/dt)*Math.sign(t),i=new Date(t-a*dt);return Ks(qa,[i.getUTCFullYear(),i.getUTCMonth()+1,i.getUTCDate()+a,i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds(),s,r])}function xn(t){return[t.isoYear,t.isoMonth,t.isoDay]}function Cn(){return Et}function Ci(t,s){switch(s){case 2:return Ri(t)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Rn(t){return Ri(t)?366:365}function Ri(t){return t%4==0&&(t%100!=0||t%400==0)}function On(t){let[s,r]=wn(t.isoYear,t.isoMonth,t.isoDay);return ar(s.getUTCDay()-r,7)||7}function bn({isoYear:t}){return t<1?["bce",1-t]:["ce",t]}function rc(t){let s=st(t);if(s<sp)return bn(t);let r=gi(Jo(Ss),s),{era:a,eraYear:i}=Fd(r,Ss);return[a,i]}function aa(t){return cs(t),ia(t,1),t}function cs(t){return Hn(t,1),t}function Le(t){return rn(No,t,Hn(t))}function Hn(t,s){let{isoYear:r}=t,a=et(t,"isoMonth",1,Cn(),s);return{isoYear:r,isoMonth:a,isoDay:et(t,"isoDay",1,Ci(r,a),s)}}function ia(t,s){return Ks(Dt,[et(t,"isoHour",0,23,s),et(t,"isoMinute",0,59,s),et(t,"isoSecond",0,59,s),et(t,"isoMillisecond",0,999,s),et(t,"isoMicrosecond",0,999,s),et(t,"isoNanosecond",0,999,s)])}function C(t){return t===void 0?0:cu(Zt(t))}function mr(t,s=0){t=Ot(t);let r=pu(t),a=cp(t,s);return[cu(t),a,r]}function Oi(t){return pu(Ot(t))}function Dn(t){return t=Ot(t),Go(t,9,6,1)}function vs(t,s,r,a=9,i=0,o=4){s=Ot(s);let e=Go(s,a,i),n=Di(s),d=Rr(s,o),l=Cr(s,a,i,1);return e==null?e=Math.max(r,l):An(e,l),n=Mi(n,l,1),t&&(d=((u)=>u<4?(u+2)%4:u)(d)),[e,l,n,d]}function oa(t,s=6,r){let a=Di(t=Ii(t,zr)),i=Rr(t,7),o=Cr(t,s);return o=cn(zr,o),a=Mi(a,o,void 0,r),[o,a,i]}function bi(t){return Wo(Ot(t))}function Mn(t,s){return Hi(Ot(t),s)}function Hi(t,s=4){let r=Sn(t);return[Rr(t,4),...In(Cr(t,s),r)]}function In(t,s){return t!=null?[It[t],t<4?9-3*t:-1]:[s===void 0?1:10**(9-s),s]}function Di(t){let s=t[ir];return s===void 0?1:Q(s,ir)}function Mi(t,s,r,a){let i=a?O:It[s+1];if(i){let o=It[s];if(i%((t=yt(ir,t,1,i/o-(a?0:1),1))*o))throw new RangeError(yr(ir,t))}else t=yt(ir,t,1,r?1e9:1,1);return t}function Sn(t){let s=t[si];if(s!==void 0){if(typeof s!="number"){if(hi(s)==="auto")return;throw new RangeError(yr(si,s))}s=yt(si,Math.floor(s),0,9,1)}return s}function Ot(t){return t===void 0?{}:Zt(t)}function Ii(t,s){return typeof t=="string"?{[s]:t}:Zt(t)}function F(t){if(t!==void 0){if(U(t))return Object.assign(Object.create(null),t);throw new TypeError(Fl)}}function ea(t,s){return t&&Object.assign(Object.create(null),t,{overflow:ap[s]})}function Si(t,s,r=9,a=0,i){let o=s[t];if(o===void 0)return i?a:void 0;if(o=hi(o),o==="auto")return i?a:null;let e=ei[o];if(e===void 0&&(e=Bc[o]),e===void 0)throw new RangeError(Ll(t,o,ei));return yt(t,e,a,r,1,wr),e}function ps(t,s,r,a=0){let i=r[t];if(i===void 0)return a;let o=hi(i),e=s[o];if(e===void 0)throw new RangeError(Ll(t,o,s));return e}function An(t,s){if(s>t)throw new RangeError(kc)}function V(t){return{branding:Ea,epochNanoseconds:t}}function z(t,s,r){return{branding:Ut,calendar:r,timeZone:s,epochNanoseconds:t}}function $(t,s=t.calendar){return{branding:xs,calendar:s,...ct(nu,t)}}function Z(t,s=t.calendar){return{branding:ws,calendar:s,...ct(Uo,t)}}function ds(t,s=t.calendar){return{branding:Ns,calendar:s,...ct(Uo,t)}}function Ur(t,s=t.calendar){return{branding:Us,calendar:s,...ct(Uo,t)}}function bt(t){return{branding:va,...ct(eu,t)}}function I(t){return{branding:Fa,sign:Xt(t),...ct(jo,t)}}function Kn(t){return yn(t.epochNanoseconds)}function na(t){return yi(t.epochNanoseconds,St)[0]}function qn(t){return fn(t.epochNanoseconds,gs)}function vn(t){return fn(t.epochNanoseconds)}function En(t){return t.epochNanoseconds}function W(t){return typeof t=="string"?t:K(t.id)}function Es(t,s){return t===s||W(t)===W(s)}function Fn(t,s,r,a,i){let o=ls(a),[e,n]=((h,y)=>{let f=y((h=Ii(h,li))[lu]),g=up(h);return g=cn(li,g),[g,f]})(i,t);if(er(Math.max(e,o),n))return ke(a,e);if(!n)throw new RangeError(Ma);let[d,l,u]=ma(s,r,n),c=to(u),p=Ta(u),m=so(u),T=p(l,d,a),P=m(l,d,T,e);return er(e,n)?ke(P,e):((h,y,f,g,E,S,M)=>{let A=Xt(h),[G,k]=Ai(g,ko(f,h),f,A,E,S,M),Js=Ki(y,G,k);return h[R[f]]+Js*A})(P,c(T),e,l,d,c,p)}function ke(t,s){return Pt(N(t),It[s],1)}function Ai(t,s,r,a,i,o,e){let n=R[r],d={...s,[n]:s[n]+a},l=e(t,i,s),u=e(t,i,d);return[o(l),o(u)]}function Ki(t,s,r){let a=Pt(Tt(s,r));if(!a)throw new RangeError(gr);return Pt(Tt(s,t))/a}function $n(t,s){let[r,a,i]=oa(s,5,1);return V(la(t.epochNanoseconds,r,a,i,1))}function Zn(t,s,r){let{epochNanoseconds:a,timeZone:i,calendar:o}=s,[e,n,d]=oa(r);if(e===0&&n===1)return s;let l=t(i);if(e===6)a=((u,c,p,m)=>{let T=rt(p,c),[P,h]=u(T),y=p.epochNanoseconds,f=ut(c,P),g=ut(c,h);if(hn(y,f,g))throw new RangeError(gr);return _n(Ki(y,f,g),m)?g:f})(Gn,l,s,d);else{let u=l.getOffsetNanosecondsFor(a);a=Ts(l,Un(Jt(a,u),e,n,d),u,2,0,1)}return z(a,i,o)}function jn(t,s){return $(Un(t,...oa(s)),t.calendar)}function Ln(t,s){let[r,a,i]=oa(s,5);var o;return bt((o=i,qi(t,Tr(r,a),o)[0]))}function kn(t,s){let r=t(s.timeZone),a=rt(s,r),[i,o]=Gn(a),e=Pt(Tt(ut(r,i),ut(r,o)),Sa,1);if(e<=0)throw new RangeError(gr);return e}function Nn(t,s){let{timeZone:r,calendar:a}=s,i=((o,e,n)=>ut(e,o(rt(n,e))))(Wn,t(r),s);return z(i,r,a)}function Un(t,s,r,a){return Vn(t,Tr(s,r),a)}function Vn(t,s,r){let[a,i]=qi(t,s,r);return jt({...Ps(t,i),...a})}function qi(t,s,r){return sa(Bt(zt(t),s,r))}function Vr(t){return Bt(t,Ia,7)}function Tr(t,s){return It[t]*s}function Gn(t){let s=Wn(t);return[s,Ps(s,1)]}function Wn(t){return Jc(6,t)}function ac(t,s,r){let a=Math.min(ls(t),6);return $s(ua(N(t,a),s,r),a)}function da(t,s,r,a,i,o,e,n,d,l){if(a===0&&i===1)return t;let u=er(a,n)?Pa(n)&&a<6&&r>=6?oc:ic:ec,[c,p,m]=u(t,s,r,a,i,o,e,n,d,l);return m&&a!==7&&(c=((T,P,h,y,f,g,E,S)=>{let M=Xt(T);for(let A=y+1;A<=h;A++){if(A===7&&h!==7)continue;let G=ko(A,T);G[R[A]]+=M;let k=Pt(Tt(E(S(f,g,G)),P));if(k&&Math.sign(k)!==M)break;T=G}return T})(c,p,r,Math.max(6,a),e,n,d,l)),c}function la(t,s,r,a,i){if(s===6){let o=((e)=>e[0]+e[1]/O)(t);return[Bt(o,r,a),0]}return ua(t,Tr(s,r),a,i)}function ua(t,s,r,a){let[i,o]=t;a&&o<0&&(o+=O,i-=1);let[e,n]=Ft(Bt(o,s,r),O);return fi(i+e,n)}function Bt(t,s,r){return _n(t/s,r)*s}function _n(t,s){return Tp[s](t)}function ic(t,s,r,a,i,o){let e=Xt(t),n=N(t),d=la(n,a,i,o),l=Tt(n,d),u=Math.sign(d[0]-n[0])===e,c=$s(d,Math.min(r,6));return[{...t,...c},Ds(s,l),u]}function oc(t,s,r,a,i,o,e,n,d,l){let u=Xt(t),c=Pt(N(t,5)),p=Tr(a,i),m=Bt(c,p,o),[T,P]=Ai(e,{...t,...Lo},6,u,n,d,l),h=m-Pt(Tt(T,P)),y=0;h&&Math.sign(h)!==u?s=Ms(T,m):(y+=u,m=Bt(h,p,o),s=Ms(P,m));let f=fa(m);return[{...t,...f,days:t.days+y},s,Boolean(y)]}function ec(t,s,r,a,i,o,e,n,d,l){let u=Xt(t),c=R[a],p=ko(a,t);a===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});let m=Jr(t[c],i)*i;p[c]=m;let[T,P]=Ai(e,p,a,i*u,n,d,l),h=m+Ki(s,T,P)*u*i,y=Bt(h,i,o),f=Math.sign(y-h)===u;return p[c]=y,[p,f?P:T,f]}function vi(t,s,r,a){let[i,o,e,n]=((l)=>{let u=Hi(l=Ot(l));return[l.timeZone,...u]})(a),d=i!==void 0;return((l,u,c,p,m,T)=>{c=ua(c,m,p,1);let P=u.getOffsetNanosecondsFor(c);return ki(Jt(c,P),T)+(l?ms(Vr(P)):"Z")})(d,s(d?t(i):Cs),r.epochNanoseconds,o,e,n)}function Ei(t,s,r){let[a,i,o,e,n,d]=((l)=>{l=Ot(l);let u=Wo(l),c=Sn(l),p=mp(l),m=Rr(l,4),T=Cr(l,4);return[u,pp(l),p,m,...In(T,c)]})(r);return((l,u,c,p,m,T,P,h,y,f)=>{p=ua(p,y,h,1);let g=l(c).getOffsetNanosecondsFor(p);return ki(Jt(p,g),f)+ms(Vr(g),P)+((E,S)=>S!==1?"["+(S===2?"!":"")+W(E)+"]":"")(c,T)+Ni(u,m)})(t,s.calendar,s.timeZone,s.epochNanoseconds,a,i,o,e,n,d)}function Fi(t,s){let[r,a,i,o]=((l)=>(l=Ot(l),[Wo(l),...Hi(l)]))(s);return e=t.calendar,n=r,d=o,ki(Vn(t,i,a),d)+Ni(e,n);var e,n,d}function $i(t,s){return r=t.calendar,a=t,i=bi(s),Gr(a)+Ni(r,i);var r,a,i}function Zi(t,s){return zn(t.calendar,Bn,t,bi(s))}function ji(t,s){return zn(t.calendar,nc,t,bi(s))}function Li(t,s){let[r,a,i]=Mn(s);return o=i,Jn(qi(t,a,r)[0],o);var o}function ca(t,s){let[r,a,i]=Mn(s,3);return a>1&&(t={...t,...ac(t,a,r)}),((o,e)=>{let{sign:n}=o,d=n===-1?at(o):o,{hours:l,minutes:u}=d,[c,p]=yi(N(d,3),wt,_t);id(c);let m=Ui(p,e),T=e>=0||!n||m;return(n<0?"-":"")+"P"+Ne({Y:ns(d.years),M:ns(d.months),W:ns(d.weeks),D:ns(d.days)})+(l||u||c||T?"T"+Ne({H:ns(l),M:ns(u),S:ns(c,T)+m}):"")})(t,i)}function zn(t,s,r,a){let i=W(t),o=a>1||a===0&&i!==x;return a===1?i===x?s(r):Gr(r):o?Gr(r)+Xn(i,a===2):s(r)}function Ne(t){let s=[];for(let r in t){let a=t[r];a&&s.push(a,r)}return s.join("")}function ki(t,s){return Gr(t)+"T"+Jn(t,s)}function Gr(t){return Bn(t)+"-"+gt(t.isoDay)}function Bn(t){let{isoYear:s}=t;return(s<0||s>9999?Qn(s)+Lr(6,Math.abs(s)):Lr(4,s))+"-"+gt(t.isoMonth)}function nc(t){return gt(t.isoMonth)+"-"+gt(t.isoDay)}function Jn(t,s){let r=[gt(t.isoHour),gt(t.isoMinute)];return s!==-1&&r.push(gt(t.isoSecond)+((a,i,o,e)=>Ui(a*St+i*gs+o,e))(t.isoMillisecond,t.isoMicrosecond,t.isoNanosecond,s)),r.join(":")}function ms(t,s=0){if(s===1)return"";let[r,a]=Ft(Math.abs(t),Sa),[i,o]=Ft(a,Ia),[e,n]=Ft(o,wt);return Qn(t)+gt(r)+":"+gt(i)+(e||n?":"+gt(e)+Ui(n):"")}function Ni(t,s){if(s!==1){let r=W(t);if(s>1||s===0&&r!==x)return Xn(r,s===2)}return""}function Xn(t,s){return"["+(s?"!":"")+"u-ca="+t+"]"}function Ui(t,s){let r=Lr(9,t);return r=s===void 0?r.replace(fp,""):r.slice(0,s),r?"."+r:""}function Qn(t){return t<0?"-":"+"}function ns(t,s){return t||s?t.toLocaleString("fullwide",{useGrouping:0}):""}function dc(t,s){let{epochNanoseconds:r}=t,a=(s.getOffsetNanosecondsFor?s:s(t.timeZone)).getOffsetNanosecondsFor(r),i=Jt(r,a);return{calendar:t.calendar,...i,offsetNanoseconds:a}}function Yn(t,s){let r=rt(s,t);return{calendar:s.calendar,...ct(nu,r),offset:ms(r.offsetNanoseconds),timeZone:s.timeZone}}function Ts(t,s,r,a=0,i=0,o,e){if(r!==void 0&&a===1&&(a===1||e))return xi(s,r);let n=t.getPossibleInstantsFor(s);if(r!==void 0&&a!==3){let d=((l,u,c,p)=>{let m=Y(u);p&&(c=Vr(c));for(let T of l){let P=Pt(Tt(T,m));if(p&&(P=Vr(P)),P===c)return T}})(n,s,r,o);if(d!==void 0)return d;if(a===0)throw new RangeError(Ec)}return e?Y(s):ut(t,s,i,n)}function ut(t,s,r=0,a=t.getPossibleInstantsFor(s)){if(a.length===1)return a[0];if(r===1)throw new RangeError(Fc);if(a.length)return a[r===3?1:0];let i=Y(s),o=((n,d)=>{let l=n.getOffsetNanosecondsFor(Ms(d,-O));return Gi(n.getOffsetNanosecondsFor(Ms(d,O))-l)})(t,i),e=o*(r===2?-1:1);return(a=t.getPossibleInstantsFor(Jt(i,e)))[r===2?0:a.length-1]}function Vi(t){if(Math.abs(t)>=O)throw new RangeError(qc);return t}function Gi(t){if(t>O)throw new RangeError(vc);return t}function Wi(t,s,r){return V(ht(Ds(s.epochNanoseconds,((a)=>{if(od(a))throw new RangeError(jc);return N(a,5)})(t?at(r):r))))}function _i(t,s,r,a,i,o=Object.create(null)){let e=s(a.timeZone),n=t(a.calendar);return{...a,...Qi(e,n,a,r?at(i):i,o)}}function zi(t,s,r,a,i=Object.create(null)){let{calendar:o}=r;return $(Yi(t(o),r,s?at(a):a,i),o)}function Bi(t,s,r,a,i){let{calendar:o}=r;return Z(pa(t(o),r,s?at(a):a,i),o)}function Ji(t,s,r,a,i=Object.create(null)){let o=r.calendar,e=t(o),n=or(e,r);s&&(a=ha(a)),a.sign<0&&(n=e.dateAdd(n,{..._,months:1}),n=Ps(n,-1));let d=e.dateAdd(n,a,i);return ds(or(e,d),o)}function Xi(t,s,r){return bt(td(s,t?at(r):r)[0])}function Qi(t,s,r,a,i){let o=N(a,5),e=r.epochNanoseconds;if(od(a)){let n=rt(r,t);e=Ds(ut(t,{...pa(s,n,{...a,...Lo},i),...ct(Dt,n)}),o)}else e=Ds(e,o),C(i);return{epochNanoseconds:ht(e)}}function Yi(t,s,r,a){let[i,o]=td(s,r);return jt({...pa(t,s,{...r,...Lo,days:r.days+o},a),...i})}function pa(t,s,r,a){if(r.years||r.months||r.weeks)return t.dateAdd(s,r,a);C(a);let i=r.days+N(r,5)[0];return i?Gt(Ps(s,i)):s}function or(t,s,r=1){return Ps(s,r-t.day(s))}function td(t,s){let[r,a]=N(s,5),[i,o]=sa(zt(t)+a);return[i,r+o]}function Ps(t,s){return s?{...t,...ra(st(t)+s*dt)}:t}function ma(t,s,r){let a=t(r.calendar);return Pa(r)?[r,a,s(r.timeZone)]:[{...r,...xt},a]}function to(t){return t?En:Y}function Ta(t){return t?w(Qi,t):Yi}function so(t){return t?w(uc,t):cc}function Pa(t){return t&&t.epochNanoseconds}function er(t,s){return t<=6-(Pa(s)?1:0)}function ro(t,s,r,a,i,o,e){let n=t(Ot(e).relativeTo),d=Math.max(ls(i),ls(o));if(er(d,n))return I(Fs(((P,h,y,f)=>{let g=Ds(N(P),N(h),f?-1:1);if(!Number.isFinite(g[0]))throw new RangeError(Da);return{..._,...$s(g,y)}})(i,o,d,a)));if(!n)throw new RangeError(Ma);a&&(o=at(o));let[l,u,c]=ma(s,r,n),p=Ta(c),m=so(c),T=p(u,l,i);return I(m(u,l,p(u,T,o),d))}function sd(t,s,r,a,i){let o=ls(a),[e,n,d,l,u]=((M,A,G)=>{M=Ii(M,zr);let k=Go(M),Js=G(M[lu]),Xs=Di(M),_u=Rr(M,7),es=Cr(M);if(k===void 0&&es===void 0)throw new RangeError(Lc);return es==null&&(es=0),k==null&&(k=Math.max(es,A)),An(k,es),Xs=Mi(Xs,es,1),[k,es,Xs,_u,Js]})(i,o,t),c=Math.max(o,e);if(!Pa(u)&&c<=6)return I(Fs(((M,A,G,k,Js)=>{let Xs=la(N(M),G,k,Js);return{..._,...$s(Xs,A)}})(a,e,n,d,l)));if(!u)throw new RangeError(Ma);let[p,m,T]=ma(s,r,u),P=to(T),h=Ta(T),y=so(T),f=h(m,p,a),g=y(m,p,f,e),E=a.sign,S=Xt(g);if(E&&S&&E!==S)throw new RangeError(gr);return S&&(g=da(g,P(f),e,n,d,l,m,p,P,h)),I(g)}function rd(t){return t.sign===-1?ha(t):t}function ha(t){return I(at(t))}function at(t){let s={};for(let r of R)s[r]=-1*t[r]||0;return s}function ad(t){return!t.sign}function Xt(t,s=R){let r=0;for(let a of s){let i=Math.sign(t[a]);if(i){if(r&&r!==i)throw new RangeError(Zc);r=i}}return r}function Fs(t){for(let s of zc)yt(s,t[s],-Be,Be,1);return id(Pt(N(t),wt)),t}function id(t){if(!Number.isSafeInteger(t))throw new RangeError($c)}function N(t,s=6){return on(t,s,R)}function $s(t,s=6){let[r,a]=t,i=Xr(a,s,R);if(i[R[s]]+=r*(O/It[s]),!Number.isFinite(i[R[s]]))throw new RangeError(Da);return i}function fa(t,s=5){return Xr(t,s,R)}function od(t){return Boolean(Xt(t,ou))}function ls(t){let s=9;for(;s>0&&!t[R[s]];s--);return s}function lc(t,s){return[t,s]}function Ue(t){let s=Math.floor(t/Zr)*Zr;return[s,s+Zr]}function ed(t){let s=Qt(t=kr(t));if(!s)throw new RangeError(nt(t));let r;if(s.m)r=0;else{if(!s.offset)throw new RangeError(nt(t));r=Zs(s.offset)}return s.timeZone&&eo(s.timeZone,1),V(xi(aa(s),r))}function nd(t){let s=Qt(K(t));if(!s)throw new RangeError(nt(t));if(s.timeZone)return hd(s,s.offset?Zs(s.offset):void 0);if(s.m)throw new RangeError(nt(t));return yd(s)}function dd(t,s){let r=Qt(K(t));if(!r||!r.timeZone)throw new RangeError(nt(t));let{offset:a}=r,i=a?Zs(a):void 0,[,o,e]=mr(s);return hd(r,i,o,e)}function Zs(t){let s=eo(t);if(s===void 0)throw new RangeError(nt(t));return s}function ld(t){let s=Qt(K(t));if(!s||s.m)throw new RangeError(nt(t));return $(fd(s))}function ya(t){let s=Qt(K(t));if(!s||s.m)throw new RangeError(nt(t));return Z(s.p?fd(s):yd(s))}function ud(t,s){let r=io(K(s));if(r)return ao(r),ds(wi(cs(r)));let a=ya(s);return ds(or(t(a.calendar),a))}function ao(t){if(t.calendar!==x)throw new RangeError($t(t.calendar))}function cd(t,s){let r=oo(K(s));if(r)return ao(r),Ur(cs(r));let a=ya(s),{calendar:i}=a,o=t(i),[e,n,d]=o.h(a),[l,u]=o.I(e,n),[c,p]=o.N(l,u,d);return Ur(Gt(o.P(c,p,d)),i)}function pd(t){let s,r=((a)=>{let i=Cp.exec(a);return i?(ga(i[10]),xd(i)):void 0})(K(t));if(!r){if(r=Qt(t),!r)throw new RangeError(nt(t));if(!r.p)throw new RangeError(nt(t));if(r.m)throw new RangeError($t("Z"));ao(r)}if((s=io(t))&&Le(s))throw new RangeError(nt(t));if((s=oo(t))&&Le(s))throw new RangeError(nt(t));return bt(ia(r,1))}function md(t){let s=((r)=>{let a=bp.exec(r);return a?((i)=>{function o(u,c,p){let m=0,T=0;if(p&&([m,d]=Ft(d,It[p])),u!==void 0){if(n)throw new RangeError($t(u));T=((P)=>{let h=parseInt(P);if(!Number.isFinite(h))throw new RangeError($t(P));return h})(u),e=1,c&&(d=no(c)*(It[p]/wt),n=1)}return m+T}let e=0,n=0,d=0,l={...Ks(R,[o(i[2]),o(i[3]),o(i[4]),o(i[5]),o(i[6],i[7],5),o(i[8],i[9],4),o(i[10],i[11],3)]),...Xr(d,2,R)};if(!e)throw new RangeError(Zl(R));return lo(i[1])<0&&(l=at(l)),l})(a):void 0})(K(t));if(!s)throw new RangeError(nt(t));return I(Fs(s))}function Td(t){let s=Qt(t)||io(t)||oo(t);return s?s.calendar:t}function Pd(t){let s=Qt(t);return s&&(s.timeZone||s.m&&Cs||s.offset)||t}function hd(t,s,r=0,a=0){let i=wa(t.timeZone),o=$a(i);return z(Ts(o,aa(t),s,r,a,!o.v,t.m),i,Pr(t.calendar))}function fd(t){return gd(jt(aa(t)))}function yd(t){return gd(Gt(cs(t)))}function gd(t){return{...t,calendar:Pr(t.calendar)}}function Qt(t){let s=xp.exec(t);return s?((r)=>{let a=r[10],i=(a||"").toUpperCase()==="Z";return{isoYear:wd(r),isoMonth:parseInt(r[4]),isoDay:parseInt(r[5]),...xd(r.slice(5)),...ga(r[16]),p:Boolean(r[6]),m:i,offset:i?void 0:a}})(s):void 0}function io(t){let s=gp.exec(t);return s?((r)=>({isoYear:wd(r),isoMonth:parseInt(r[4]),isoDay:1,...ga(r[5])}))(s):void 0}function oo(t){let s=wp.exec(t);return s?((r)=>({isoYear:As,isoMonth:parseInt(r[1]),isoDay:parseInt(r[2]),...ga(r[3])}))(s):void 0}function eo(t,s){let r=Rp.exec(t);return r?((a,i)=>{let o=a[4]||a[5];if(i&&o)throw new RangeError($t(o));return Vi((Hs(a[2])*Sa+Hs(a[3])*Ia+Hs(a[4])*wt+no(a[5]||""))*lo(a[1]))})(r,s):void 0}function wd(t){let s=lo(t[1]),r=parseInt(t[2]||t[3]);if(s<0&&!r)throw new RangeError($t(-0));return s*r}function xd(t){let s=Hs(t[3]);return{...sa(no(t[4]||""))[0],isoHour:Hs(t[1]),isoMinute:Hs(t[2]),isoSecond:s===60?59:s}}function ga(t){let s,r,a=[];if(t.replace(Op,(i,o,e)=>{let n=Boolean(o),[d,l]=e.split("=").reverse();if(l){if(l==="u-ca")a.push(d),s||(s=n);else if(n||/[A-Z]/.test(l))throw new RangeError($t(i))}else{if(r)throw new RangeError($t(i));r=d}return""}),a.length>1&&s)throw new RangeError($t(t));return{timeZone:r,calendar:a[0]||x}}function no(t){return parseInt(t.padEnd(9,"0"))}function js(t){return new RegExp(`^${t}$`,"i")}function lo(t){return t&&t!=="+"?-1:1}function Hs(t){return t===void 0?0:parseInt(t)}function Cd(t){return wa(K(t))}function wa(t){let s=uo(t);return typeof s=="number"?ms(s):s?((r)=>{if(Dp.test(r))throw new RangeError(Kc);return r.toLowerCase().split("/").map((a,i)=>(a.length<=3||/\d/.test(a))&&!/etc|yap/.test(a)?a.toUpperCase():a.replace(/baja|dumont|[a-z]+/g,(o,e)=>o.length<=2&&!i||o==="in"||o==="chat"?o.toUpperCase():o.length>2||!e?Ze(o).replace(/island|noronha|murdo|rivadavia|urville/,Ze):o)).join("/")})(t):Cs}function Ve(t){let s=uo(t);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:Cs}function uo(t){let s=eo(t=t.toUpperCase(),1);return s!==void 0?s:t!==Cs?Hp(t):void 0}function co(t,s){return tt(t.epochNanoseconds,s.epochNanoseconds)}function po(t,s){return tt(t.epochNanoseconds,s.epochNanoseconds)}function Rd(t,s,r,a,i,o){let e=t(Ot(o).relativeTo),n=Math.max(ls(a),ls(i));if(rn(R,a,i))return 0;if(er(n,e))return tt(N(a),N(i));if(!e)throw new RangeError(Ma);let[d,l,u]=ma(s,r,e),c=to(u),p=Ta(u);return tt(c(p(l,d,a)),c(p(l,d,i)))}function mo(t,s){return hs(t,s)||xa(t,s)}function hs(t,s){return Vt(st(t),st(s))}function xa(t,s){return Vt(zt(t),zt(s))}function Od(t,s){return!co(t,s)}function bd(t,s){return!po(t,s)&&!!Ca(t.timeZone,s.timeZone)&&Es(t.calendar,s.calendar)}function Hd(t,s){return!mo(t,s)&&Es(t.calendar,s.calendar)}function Dd(t,s){return!hs(t,s)&&Es(t.calendar,s.calendar)}function Md(t,s){return!hs(t,s)&&Es(t.calendar,s.calendar)}function Id(t,s){return!hs(t,s)&&Es(t.calendar,s.calendar)}function Sd(t,s){return!xa(t,s)}function Ca(t,s){if(t===s)return 1;let r=W(t),a=W(s);if(r===a)return 1;try{return Ve(r)===Ve(a)}catch(i){}}function To(t,s,r,a){let i=vs(t,F(a),3,5),o=Ra(s.epochNanoseconds,r.epochNanoseconds,...i);return I(t?at(o):o)}function Po(t,s,r,a,i,o){let e=ba(a.calendar,i.calendar),n=F(o),[d,l,u,c]=vs(r,n,5),p=a.epochNanoseconds,m=i.epochNanoseconds,T=tt(m,p),P;if(T)if(d<6)P=Ra(p,m,d,l,u,c);else{let h=s(((f,g)=>{if(!Ca(f,g))throw new RangeError(Vl);return f})(a.timeZone,i.timeZone)),y=t(e);P=Kd(y,h,a,i,T,d,n),P=da(P,m,d,l,u,c,y,a,En,w(Qi,h))}else P=_;return I(r?at(P):P)}function ho(t,s,r,a,i){let o=ba(r.calendar,a.calendar),e=F(i),[n,d,l,u]=vs(s,e,6),c=Y(r),p=Y(a),m=tt(p,c),T;if(m)if(n<=6)T=Ra(c,p,n,d,l,u);else{let P=t(o);T=qd(P,r,a,m,n,e),T=da(T,p,n,d,l,u,P,r,Y,Yi)}else T=_;return I(s?at(T):T)}function fo(t,s,r,a,i){let o=ba(r.calendar,a.calendar),e=F(i);return Ad(s,()=>t(o),r,a,...vs(s,e,6,9,6),e)}function yo(t,s,r,a,i){let o=ba(r.calendar,a.calendar),e=F(i),n=vs(s,e,9,9,8),d=t(o);return Ad(s,()=>d,or(d,r),or(d,a),...n,e)}function Ad(t,s,r,a,i,o,e,n,d){let l=Y(r),u=Y(a),c;if(tt(u,l))if(i===6)c=Ra(l,u,i,o,e,n);else{let p=s();c=p.dateUntil(r,a,i,d),o===6&&e===1||(c=da(c,u,i,o,e,n,p,r,Y,pa))}else c=_;return I(t?at(c):c)}function go(t,s,r,a){let i=F(a),[o,e,n,d]=vs(t,i,5,5),l=Bt(wo(s,r),Tr(e,n),d),u={..._,...fa(l,o)};return I(t?at(u):u)}function uc(t,s,r,a,i,o){let e=tt(a.epochNanoseconds,r.epochNanoseconds);return e?i<6?vd(r.epochNanoseconds,a.epochNanoseconds,i):Kd(s,t,r,a,e,i,o):_}function cc(t,s,r,a,i){let o=Y(s),e=Y(r),n=tt(e,o);return n?a<=6?vd(o,e,a):qd(t,s,r,n,a,i):_}function Kd(t,s,r,a,i,o,e){let[n,d,l]=((p,m,T,P)=>{function h(){return A={...Ps(g,S++*-P),...f},G=ut(p,A),tt(E,G)===-P}let y=rt(m,p),f=ct(Dt,y),g=rt(T,p),E=T.epochNanoseconds,S=0,M=wo(y,g),A,G;if(Math.sign(M)===-P&&S++,h()&&(P===-1||h()))throw new RangeError(gr);let k=Pt(Tt(G,E));return[y,A,k]})(s,r,a,i);var u,c;return{...o===6?(u=n,c=d,{..._,days:Ed(u,c)}):t.dateUntil(n,d,o,e),...fa(l)}}function qd(t,s,r,a,i,o){let[e,n,d]=((l,u,c)=>{let p=u,m=wo(l,u);return Math.sign(m)===-c&&(p=Ps(u,-c),m+=O*c),[l,p,m]})(s,r,a);return{...t.dateUntil(e,n,i,o),...fa(d)}}function Ra(t,s,r,a,i,o){return{..._,...$s(la(Tt(t,s),a,i,o),r)}}function vd(t,s,r){return{..._,...$s(Tt(t,s),r)}}function Ed(t,s){return Oa(st(t),st(s))}function Oa(t,s){return Math.trunc((s-t)/dt)}function wo(t,s){return zt(s)-zt(t)}function ba(t,s){if(!Es(t,s))throw new RangeError(Eo);return t}function pc(t){function s(i){return((o,e)=>({...Fd(o,e),F:o.month,day:parseInt(o.day)}))(gi(r,i),a)}let r=Jo(t),a=Wr(t);return{id:t,O:mc(s),B:Tc(s)}}function mc(t){return lt((s)=>{let r=st(s);return t(r)},WeakMap)}function Tc(t){let s=t(0).year-tp;return lt((r)=>{let a,i=qs(r-s),o=[],e=[];do i+=400*dt;while((a=t(i)).year<=r);do i+=(1-a.day)*dt,a.year===r&&(o.push(i),e.push(a.F)),i-=dt;while((a=t(i)).year>=r);return{k:o.reverse(),C:_l(e.reverse())}})}function Fd(t,s){let r,a,i=$d(t);if(t.era){let o=ru[s];o!==void 0&&(r=s==="islamic"?"ah":t.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),r==="bc"||r==="b"?r="bce":r!=="ad"&&r!=="a"||(r="ce"),a=i,i=Nd(a,o[r]||0))}return{era:r,eraYear:a,year:i}}function $d(t){return parseInt(t.relatedYear||t.year)}function ai(t){let{year:s,F:r,day:a}=this.O(t),{C:i}=this.B(s);return[s,i[r]+1,a]}function nr(t,s=1,r=1){return this.B(t).k[s-1]+(r-1)*dt}function Er(t){let s=We(this,t),r=We(this,t-1),a=s.length;if(a>r.length){let i=Ud(this);if(i<0)return-i;for(let o=0;o<a;o++)if(s[o]!==r[o])return o+1}}function Fr(t){return Oa(nr.call(this,t),nr.call(this,t+1))}function Ge(t,s){let{k:r}=this.B(t),a=s+1,i=r;return a>r.length&&(a=1,i=this.B(t+1).k),Oa(r[s-1],i[a-1])}function $r(t){return this.B(t).k.length}function We(t,s){return Object.keys(t.B(s).C)}function Zd(t){return Pr(K(t))}function Pr(t){if((t=t.toLowerCase())!==x&&t!==Ka&&Wr(t)!==Wr(Jo(t).resolvedOptions().calendar))throw new RangeError(Ac(t));return t}function Wr(t){return t==="islamicc"&&(t="islamic"),t.split("-")[0]}function jd(t){return this.R(t)[0]}function Ld(t){return this.R(t)[1]}function xo(t){let[s]=this.h(t);return Oa(this.q(s),st(t))+1}function kd(t){let s=Ip.exec(t);if(!s)throw new RangeError(Ic(t));return[parseInt(s[1]),Boolean(s[2])]}function _r(t,s,r){return t+(s||r&&t>=r?1:0)}function ii(t,s){return t-(s&&t>=s?1:0)}function Nd(t,s){return(s+t)*(Math.sign(s)||1)||0}function oi(t){return ru[Vd(t)]}function Ud(t){return Gc[Vd(t)]}function Vd(t){return Wr(t.id||x)}function Gd(t,s,r,a){let i=Yt(r,a,Ht,[],Ql);if(i.timeZone!==void 0){let o=r.dateFromFields(i),e=fs(i),n=t(i.timeZone);return{epochNanoseconds:Ts(s(n),{...o,...e},i.offset!==void 0?Zs(i.offset):void 0),timeZone:n}}return{...r.dateFromFields(i),...xt}}function Wd(t,s,r,a,i,o){let e=Yt(r,i,Ht,Jl,Ql),n=t(e.timeZone),[d,l,u]=mr(o),c=r.dateFromFields(e,ea(o,d)),p=fs(e,d);return z(Ts(s(n),{...c,...p},e.offset!==void 0?Zs(e.offset):void 0,l,u),n,a)}function _d(t,s,r){let a=Yt(t,s,Ht,[],Nt),i=C(r);return $(jt({...t.dateFromFields(a,ea(r,i)),...fs(a,i)}))}function Co(t,s,r,a=[]){let i=Yt(t,s,Ht,a);return t.dateFromFields(i,r)}function Ro(t,s,r,a){let i=Yt(t,s,Zo,a);return t.yearMonthFromFields(i,r)}function Oo(t,s,r,a,i=[]){let o=Yt(t,r,Ht,i);return s&&o.month!==void 0&&o.monthCode===void 0&&o.year===void 0&&(o.year=As),t.monthDayFromFields(o,a)}function zd(t,s){let r=C(s);return bt(fs(Mt(t,ni,[],1),r))}function Bd(t){let s=Mt(t,jo);return I(Fs({..._,...s}))}function Yt(t,s,r,a=[],i=[]){return Mt(s,[...t.fields(r),...i].sort(),a)}function Mt(t,s,r,a=!r){let i={},o,e=0;for(let n of s){if(n===o)throw new RangeError(Rc(n));if(n==="constructor"||n==="__proto__")throw new RangeError(qo(n));let d=t[n];if(d!==void 0)e=1,Je[n]&&(d=Je[n](d,n)),i[n]=d;else if(r){if(r.includes(n))throw new TypeError(Ko(n));i[n]=su[n]}o=n}if(a&&!e)throw new TypeError(Zl(s));return i}function fs(t,s){return ia(qp({...su,...t}),s)}function Jd(t,s,r,a,i,o){let e=F(o),{calendar:n,timeZone:d}=r;return z(((l,u,c,p,m)=>{let T=hr(l,c,p,Ht,Xl,Bl),[P,h,y]=mr(m,2);return Ts(u,{...l.dateFromFields(T,ea(m,P)),...fs(T,P)},Zs(T.offset),h,y)})(t(n),s(d),a,i,e),d,n)}function Xd(t,s,r,a,i){let o=F(i);return $(((e,n,d,l)=>{let u=hr(e,n,d,Ht,Nt),c=C(l);return jt({...e.dateFromFields(u,ea(l,c)),...fs(u,c)})})(t(s.calendar),r,a,o))}function Qd(t,s,r,a,i){let o=F(i);return((e,n,d,l)=>{let u=hr(e,n,d,Ht);return e.dateFromFields(u,l)})(t(s.calendar),r,a,o)}function Yd(t,s,r,a,i){let o=F(i);return ds(((e,n,d,l)=>{let u=hr(e,n,d,Zo);return e.yearMonthFromFields(u,l)})(t(s.calendar),r,a,o))}function tl(t,s,r,a,i){let o=F(i);return((e,n,d,l)=>{let u=hr(e,n,d,Ht);return e.monthDayFromFields(u,l)})(t(s.calendar),r,a,o)}function sl(t,s,r){return bt(((a,i,o)=>{let e=C(o);return fs({...ct(ni,a),...Mt(i,ni)},e)})(t,s,r))}function rl(t,s){return I((r=t,a=s,Fs({...r,...Mt(a,jo)})));var r,a}function hr(t,s,r,a,i=[],o=[]){let e=[...t.fields(a),...i].sort(),n=Mt(s,e,o),d=Mt(r,e);return n=t.mergeFields(n,d),Mt(n,e,[])}function bo(t,s){let r=Yt(t,s,tu);return t.monthDayFromFields(r)}function Ho(t,s,r){let a=Yt(t,s,Yl);return t.yearMonthFromFields(a,r)}function al(t,s,r,a,i){s=ct(r=t.fields(r),s),a=Mt(a,i=t.fields(i),[]);let o=t.mergeFields(s,a);return o=Mt(o,[...r,...i].sort(),[]),t.dateFromFields(o)}function Qa(t,s){let{era:r,eraYear:a,year:i}=s,o=oi(t);if(r!==void 0||a!==void 0){if(r===void 0||a===void 0)throw new TypeError(bc);if(!o)throw new RangeError(Oc);let e=o[r];if(e===void 0)throw new RangeError(Dc(r));let n=Nd(a,e);if(i!==void 0&&i!==n)throw new RangeError(Hc);i=n}else if(i===void 0)throw new TypeError(Mc(o));return i}function Ya(t,s,r,a){let{month:i,monthCode:o}=s;if(o!==void 0){let e=((n,d,l,u)=>{let c=n.U(l),[p,m]=kd(d),T=_r(p,m,c);if(m){let P=Ud(n);if(P===void 0)throw new RangeError(rr);if(P>0){if(T>P)throw new RangeError(rr);if(c===void 0){if(u===1)throw new RangeError(rr);T--}}else{if(T!==-P)throw new RangeError(rr);if(c===void 0&&u===1)throw new RangeError(rr)}}return T})(t,o,r,a);if(i!==void 0&&i!==e)throw new RangeError(Nl);i=e,a=1}else if(i===void 0)throw new TypeError(Sc);return yt("month",i,1,t.L(r),a)}function _e(t,s,r,a,i){return et(s,"day",1,t.j(a,r),i)}function ti(t,s,r,a){let i=0,o=[];for(let e of r)s[e]!==void 0?i=1:o.push(e);if(Object.assign(t,s),i)for(let e of a||o)delete t[e]}function il(t){return V(ht(ta(Yr(t))))}function ol(t,s,r,a,i=x){return z(ht(ta(Yr(r))),s(a),t(i))}function el(t,s,r,a,i=0,o=0,e=0,n=0,d=0,l=0,u=x){return $(jt(aa(Ct(Q,Ks(qa,[s,r,a,i,o,e,n,d,l])))),t(u))}function nl(t,s,r,a,i=x){return Z(Gt(cs(Ct(Q,{isoYear:s,isoMonth:r,isoDay:a}))),t(i))}function dl(t,s,r,a=x,i=1){let o=Q(s),e=Q(r),n=t(a);return ds(wi(cs({isoYear:o,isoMonth:e,isoDay:Q(i)})),n)}function ll(t,s,r,a=x,i=As){let o=Q(s),e=Q(r),n=t(a);return Ur(Gt(cs({isoYear:Q(i),isoMonth:o,isoDay:e})),n)}function ul(t=0,s=0,r=0,a=0,i=0,o=0){return bt(ia(Ct(Q,Ks(Dt,[t,s,r,a,i,o])),1))}function cl(t=0,s=0,r=0,a=0,i=0,o=0,e=0,n=0,d=0,l=0){return I(Fs(Ct(Pn,Ks(R,[t,s,r,a,i,o,e,n,d,l]))))}function Do(t,s,r=x){return z(t.epochNanoseconds,s,r)}function pl(t){return V(t.epochNanoseconds)}function Mo(t,s){return $(rt(s,t))}function Io(t,s){return Z(rt(s,t))}function ml(t,s,r){return Ho(t(s.calendar),r)}function Tl(t,s,r){return bo(t(s.calendar),r)}function So(t,s){return bt(rt(s,t))}function Pl(t,s,r,a){let i=((o,e,n,d)=>{let l=Oi(d);return ut(o(e),n,l)})(t,r,s,a);return z(ht(i),r,s.calendar)}function hl(t,s,r){let a=t(s.calendar);return ds({...s,...Ho(a,r)})}function fl(t,s,r){return bo(t(s.calendar),r)}function yl(t,s,r,a,i){let o=t(i.timeZone),e=i.plainTime,n=e!==void 0?s(e):xt;return z(ut(r(o),{...a,...n}),o,a.calendar)}function gl(t,s=xt){return $(jt({...t,...s}))}function wl(t,s,r){return Ho(t(s.calendar),r)}function xl(t,s,r){return bo(t(s.calendar),r)}function Cl(t,s,r,a){return((i,o,e)=>al(i,o,Yl,Zt(e),xr))(t(s.calendar),r,a)}function Rl(t,s,r,a){return((i,o,e)=>al(i,o,tu,Zt(e),Aa))(t(s.calendar),r,a)}function Ol(t,s,r,a,i){let o=Zt(i),e=s(o.plainDate),n=t(o.timeZone);return z(ut(r(n),{...e,...a}),n,e.calendar)}function bl(t,s){return $(jt({...t,...s}))}function Hl(t){return V(ht(Is(t,wt)))}function Dl(t){return V(ht(Is(t,St)))}function Ml(t){return V(ht(ta(Yr(t),gs)))}function Il(t){return V(ht(ta(Yr(t))))}function Sl(t,s,r=xt){let a=s.timeZone,i=t(a),o={...rt(s,i),...r};return z(Ts(i,o,o.offsetNanoseconds,2),a,s.calendar)}function Al(t,s,r){let a=s.timeZone,i=t(a),o={...rt(s,i),...r},e=El(s.calendar,r.calendar);return z(Ts(i,o,o.offsetNanoseconds,2),a,e)}function Kl(t,s=xt){return $({...t,...s})}function ql(t,s){return $({...t,...s},El(t.calendar,s.calendar))}function Ha(t,s){return{...t,calendar:s}}function vl(t,s){return{...t,timeZone:s}}function El(t,s){if(t===s)return t;let r=W(t),a=W(s);if(r===a||r===x)return s;if(a===x)return t;throw new RangeError(Eo)}function Pc(t,s){return(r)=>r===x?t:r===Ka||r===Ss?Object.assign(Object.create(t),{id:r}):Object.assign(Object.create(s),Mp(r))}function ys(t,s,r){let a=new Set(r);return(i)=>(((o,e)=>{for(let n of e)if(n in o)return 1;return 0})(i=ci(a,i),t)||Object.assign(i,s),r&&(i.timeZone=Cs,["full","long"].includes(i.timeStyle)&&(i.timeStyle="medium")),i)}function Lt(t,s=Ao){let[r,,,a]=t;return(i,o=Bp,...e)=>{let n=s(a&&a(...e),i,o,r),d=n.resolvedOptions();return[n,...hc(t,d,e)]}}function Ao(t,s,r,a){if(r=a(r),t){if(r.timeZone!==void 0)throw new TypeError(Nc);r.timeZone=t}return new ts(s,r)}function hc(t,s,r){let[,a,i]=t;return r.map((o)=>(o.calendar&&((e,n,d)=>{if((d||e!==x)&&e!==n)throw new RangeError(Eo)})(W(o.calendar),s.calendar,i),a(o,s)))}function Ls(t){let s=fr();return Jt(s,t.getOffsetNanosecondsFor(s))}function fr(){return Is(Date.now(),St)}function kt(){return Qe||(Qe=new ts().resolvedOptions().timeZone)}var fc=(t,s)=>`Non-integer ${t}: ${s}`,yc=(t,s)=>`Non-positive ${t}: ${s}`,gc=(t,s)=>`Non-finite ${t}: ${s}`,wc=(t)=>`Cannot convert bigint to ${t}`,xc=(t)=>`Invalid bigint: ${t}`,Cc="Cannot convert Symbol to string",Fl="Invalid object",$l=(t,s,r,a,i)=>i?$l(t,i[s],i[r],i[a]):yr(t,s)+`; must be between ${r}-${a}`,yr=(t,s)=>`Invalid ${t}: ${s}`,Ko=(t)=>`Missing ${t}`,qo=(t)=>`Invalid field ${t}`,Rc=(t)=>`Duplicate field ${t}`,Zl=(t)=>"No valid fields: "+t.join(),jl="Invalid bag",Ll=(t,s,r)=>yr(t,s)+"; must be "+Object.keys(r).join(),kl="Cannot use valueOf",vo="Invalid calling context",Oc="Forbidden era/eraYear",bc="Mismatching era/eraYear",Hc="Mismatching year/eraYear",Dc=(t)=>`Invalid era: ${t}`,Mc=(t)=>"Missing year"+(t?"/era/eraYear":""),Ic=(t)=>`Invalid monthCode: ${t}`,Nl="Mismatching month/monthCode",Sc="Missing month/monthCode",ze="Cannot guess year",rr="Invalid leap month",Ul="Invalid protocol",gr="Invalid protocol results",Eo="Mismatching Calendars",Ac=(t)=>`Invalid Calendar: ${t}`,Vl="Mismatching TimeZones",Kc="Forbidden ICU TimeZone",qc="Out-of-bounds offset",vc="Out-of-bounds TimeZone gap",Ec="Invalid TimeZone offset",Fc="Ambiguous offset",Da="Out-of-bounds date",$c="Out-of-bounds duration",Zc="Cannot mix duration signs",Ma="Missing relativeTo",jc="Cannot use large units",Lc="Required smallestUnit or largestUnit",kc="smallestUnit > largestUnit",nt=(t)=>`Cannot parse: ${t}`,$t=(t)=>`Invalid substring: ${t}`,Gl=(t)=>`Cannot format ${t}`,Wl="Mismatching types for formatting",Nc="Cannot specify TimeZone",_l=w(ur,(t,s)=>s),ks=w(ur,(t,s,r)=>r),gt=w(Lr,2),ei={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},wr=Object.keys(ei),dt=86400000,zl=1000,gs=1000,St=1e6,wt=1e9,Ia=60000000000,Sa=3600000000000,O=86400000000000,It=[1,gs,St,wt,Ia,Sa,O],Nt=wr.slice(0,6),ni=cr(Nt),Bl=["offset"],Jl=["timeZone"],Xl=Nt.concat(Bl),Ql=Xl.concat(Jl),di=["era","eraYear"],Uc=di.concat(["year"]),Aa=["year"],Fo=["monthCode"],$o=["month"].concat(Fo),xr=["day"],Zo=$o.concat(Aa),Yl=Fo.concat(Aa),Ht=xr.concat(Zo),Vc=xr.concat($o),tu=xr.concat(Fo),su=ks(Nt,0),x="iso8601",Ka="gregory",Ss="japanese",ru={[Ka]:{bce:-1,ce:0},[Ss]:{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}},Gc={chinese:13,dangi:13,hebrew:-6},K=w(Qr,"string"),au=w(Qr,"boolean"),Wc=w(Qr,"number"),iu=w(Qr,"function"),R=wr.map((t)=>t+"s"),jo=cr(R),_c=R.slice(0,6),ou=R.slice(6),zc=ou.slice(1),Bc=_l(R),_=ks(R,0),Lo=ks(_c,0),ko=w(an,R),Dt=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],No=["isoDay","isoMonth","isoYear"],qa=Dt.concat(No),Uo=cr(No),eu=cr(Dt),nu=cr(qa),xt=ks(eu,0),Jc=w(an,qa),ts=Intl.DateTimeFormat,du="en-GB",Vo=1e8,Xc=Vo*dt,Qc=[Vo,0],Yc=[-Vo,0],dr=275760,lr=-271821,tp=1970,As=1972,Et=12,sp=qs(1868,9,8),rp=lt(rc,WeakMap),zr="smallestUnit",li="unit",ir="roundingIncrement",si="fractionalSecondDigits",lu="relativeTo",uu={constrain:0,reject:1},ap=Object.keys(uu),ip={compatible:0,reject:1,earlier:2,later:3},op={reject:0,use:1,prefer:2,ignore:3},ep={auto:0,never:1,critical:2,always:3},np={auto:0,never:1,critical:2},dp={auto:0,never:1},lp={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Cr=w(Si,zr),Go=w(Si,"largestUnit"),up=w(Si,li),cu=w(ps,"overflow",uu),pu=w(ps,"disambiguation",ip),cp=w(ps,"offset",op),Wo=w(ps,"calendarName",ep),pp=w(ps,"timeZoneName",np),mp=w(ps,"offset",dp),Rr=w(ps,"roundingMode",lp),Ns="PlainYearMonth",Us="PlainMonthDay",ws="PlainDate",xs="PlainDateTime",va="PlainTime",Ut="ZonedDateTime",Ea="Instant",Fa="Duration",Tp=[Math.floor,(t)=>vr(t)?Math.floor(t):Math.round(t),Math.ceil,(t)=>vr(t)?Math.ceil(t):Math.round(t),Math.trunc,(t)=>vr(t)?Math.trunc(t)||0:Math.round(t),(t)=>t<0?Math.floor(t):Math.ceil(t),(t)=>Math.sign(t)*Math.round(Math.abs(t))||0,(t)=>vr(t)?(t=Math.trunc(t)||0)+t%2:Math.round(t)],Cs="UTC",Zr=5184000,Pp=Nr(1847),hp=Nr(new Date().getUTCFullYear()+10),fp=/0+$/,rt=lt(dc,WeakMap),Be=4294967295,$a=lt((t)=>{let s=uo(t);return typeof s=="object"?new Tu(s):new mu(s||0)});class mu{constructor(t){this.v=t}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(t){return[xi(t,this.v)]}l(){}}class Tu{constructor(t){this.$=((s)=>{function r(d){let l=ri(d,e,n),[u,c]=Ue(l),p=i(u),m=i(c);return p===m?p:a(o(u,c),p,m,d)}function a(d,l,u,c){let p,m;for(;(c===void 0||(p=c<d[0]?l:c>=d[1]?u:void 0)===void 0)&&(m=d[1]-d[0]);){let T=d[0]+Math.floor(m/2);s(T)===u?d[1]=T:d[0]=T+1}return p}let i=lt(s),o=lt(lc),e=Pp,n=hp;return{G(d){let l=r(d-86400),u=r(d+86400),c=d-l,p=d-u;if(l===u)return[c];let m=r(c);return m===r(p)?[d-m]:l>u?[c,p]:[]},V:r,l(d,l){let u=ri(d,e,n),[c,p]=Ue(u),m=Zr*l,T=l<0?()=>p>e||(e=u,0):()=>c<n||(n=u,0);for(;T();){let P=i(c),h=i(p);if(P!==h){let y=o(c,p);a(y,P,h);let f=y[0];if((Vt(f,d)||1)===l)return f}c+=m,p+=m}}}})(((s)=>(r)=>{let a=gi(s,r*zl);return Nr($d(a),parseInt(a.month),parseInt(a.day),parseInt(a.hour),parseInt(a.minute),parseInt(a.second))-r})(t))}getOffsetNanosecondsFor(t){return this.$.V(yn(t))*wt}getPossibleInstantsFor(t){let[s,r]=[Nr((a=t).isoYear,a.isoMonth,a.isoDay,a.isoHour,a.isoMinute,a.isoSecond),a.isoMillisecond*St+a.isoMicrosecond*gs+a.isoNanosecond];var a;return this.$.G(s).map((i)=>ht(Ms(Is(i,wt),r)))}l(t,s){let[r,a]=gn(t),i=this.$.l(r+(s>0||a?1:0),s);if(i!==void 0)return Is(i,wt)}}var _o="([+\u2212-])",jr="(?:[.,](\\d{1,9}))?",Pu=`(?:(?:${_o}(\\d{6}))|(\\d{4}))-?(\\d{2})`,zo="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+jr+")?)?",Bo=_o+zo,yp=Pu+"-?(\\d{2})(?:[T ]"+zo+"(Z|"+Bo+")?)?",hu="\\[(!?)([^\\]]*)\\]",Za=`((?:${hu}){0,9})`,gp=js(Pu+Za),wp=js("(?:--)?(\\d{2})-?(\\d{2})"+Za),xp=js(yp+Za),Cp=js("T?"+zo+"(?:"+Bo+")?"+Za),Rp=js(Bo),Op=new RegExp(hu,"g"),bp=js(`${_o}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${jr}H)?(?:(\\d+)${jr}M)?(?:(\\d+)${jr}S)?)?`),Hp=lt((t)=>new ts(du,{timeZone:t,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Dp=/^(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$/,Mp=lt(pc),Jo=lt((t)=>new ts(du,{calendar:t,timeZone:Cs,era:"short",year:"numeric",month:"short",day:"numeric"})),Ip=/^M(\d{2})(L?)$/,Sp={era:kr,eraYear:Q,year:Q,month:je,monthCode:kr,day:je},Ap=ks(Nt,Q),Kp=ks(R,Pn),Je=Object.assign({},Sp,Ap,Kp,{offset:kr}),qp=w(sc,Nt,Dt),Xe={dateAdd(t,s,r){let a=C(r),i,{years:o,months:e,weeks:n,days:d}=s;if(d+=N(s,5)[0],o||e)i=((l,u,c,p,m)=>{let[T,P,h]=l.h(u);if(c){let[y,f]=l.I(T,P);T+=c,P=_r(y,f,l.U(T)),P=yt("month",P,1,l.L(T),m)}return p&&([T,P]=l._(T,P,p)),h=yt("day",h,1,l.j(T,P),m),l.q(T,P,h)})(this,t,o,e,a);else{if(!n&&!d)return t;i=st(t)}return i+=(7*n+d)*dt,Gt(ra(i))},dateUntil(t,s,r){if(r<=7){let d=0,l=Ed({...t,...xt},{...s,...xt});return r===7&&([d,l]=_t(l,7)),{..._,weeks:d,days:l}}let a=this.h(t),i=this.h(s),[o,e,n]=((d,l,u,c,p,m,T)=>{let P=p-l,h=m-u,y=T-c;if(P||h){let f=Math.sign(P||h),g=d.j(p,m),E=0;if(Math.sign(y)===-f){let S=g;[p,m]=d._(p,m,-f),P=p-l,h=m-u,g=d.j(p,m),E=f<0?-S:g}if(y=T-Math.min(c,g)+E,P){let[S,M]=d.I(l,u),[A,G]=d.I(p,m);if(h=A-S||Number(G)-Number(M),Math.sign(h)===-f){let k=f<0&&-d.L(p);P=(p-=f)-l,h=m-_r(S,M,d.U(p))+(k||d.L(p))}}}return[P,h,y]})(this,...a,...i);return r===8&&(e+=this.J(o,a[0]),o=0),{..._,years:o,months:e,days:n}},dateFromFields(t,s){let r=C(s),a=Qa(this,t),i=Ya(this,t,a,r),o=_e(this,t,i,a,r);return Z(Gt(this.P(a,i,o)),this.id||x)},yearMonthFromFields(t,s){let r=C(s),a=Qa(this,t),i=Ya(this,t,a,r);return ds(wi(this.P(a,i,1)),this.id||x)},monthDayFromFields(t,s){let r=C(s),a=!this.id,{monthCode:i,year:o,month:e}=t,n,d,l,u,c;if(i!==void 0){[n,d]=kd(i),c=Ye(t,"day");let p=this.N(n,d,c);if(!p)throw new RangeError(ze);if([l,u]=p,e!==void 0&&e!==u)throw new RangeError(Nl);a&&(u=yt("month",u,1,Et,1),c=yt("day",c,1,Ci(o!==void 0?o:l,u),r))}else{l=o===void 0&&a?As:Qa(this,t),u=Ya(this,t,l,r),c=_e(this,t,u,l,r);let p=this.U(l);d=u===p,n=ii(u,p);let m=this.N(n,d,c);if(!m)throw new RangeError(ze);[l,u]=m}return Ur(Gt(this.P(l,u,c)),this.id||x)},fields(t){return oi(this)&&t.includes("year")?[...t,...di]:t},mergeFields(t,s){let r=Object.assign(Object.create(null),t);return ti(r,s,$o),oi(this)&&(ti(r,s,Uc),this.id===Ss&&ti(r,s,Vc,di)),r},inLeapYear(t){let[s]=this.h(t);return this.K(s)},monthsInYear(t){let[s]=this.h(t);return this.L(s)},daysInMonth(t){let[s,r]=this.h(t);return this.j(s,r)},daysInYear(t){let[s]=this.h(t);return this.X(s)},dayOfYear:xo,era(t){return this.ee(t)[0]},eraYear(t){return this.ee(t)[1]},monthCode(t){let[s,r]=this.h(t),[a,i]=this.I(s,r);return((o,e)=>"M"+gt(o)+(e?"L":""))(a,i)},dayOfWeek:On,daysInWeek(){return 7}},vp={dayOfYear:xo,h:xn,q:qs},Ep=Object.assign({},vp,{weekOfYear:jd,yearOfWeek:Ld,R(t){function s(m){return(7-m<a?7:0)-m}function r(m){let T=Rn(p+m),P=m||1,h=s(ar(d+T*P,7));return u=(T+(h-l)*P)/7}let a=this.id?1:4,i=On(t),o=this.dayOfYear(t),e=ar(i-1,7),n=o-1,d=ar(e-n,7),l=s(d),u,c=Math.floor((n-l)/7)+1,p=t.isoYear;return c?c>r(0)&&(c=1,p++):(c=r(-1),p--),[c,p,u]}}),Fp={dayOfYear:xo,h:ai,q:nr,weekOfYear:jd,yearOfWeek:Ld,R(){return[]}},Vs=Pc(Object.assign({},Xe,Ep,{h:xn,ee(t){return this.id===Ka?bn(t):this.id===Ss?rp(t):[]},I:(t,s)=>[s,0],N(t,s){if(!s)return[As,t]},K:Ri,U(){},L:Cn,J:(t)=>t*Et,j:Ci,X:Rn,P:(t,s,r)=>({isoYear:t,isoMonth:s,isoDay:r}),q:qs,_:(t,s,r)=>(t+=Jr(r,Et),(s+=mi(r,Et))<1?(t--,s+=Et):s>Et&&(t++,s-=Et),[t,s]),year(t){return t.isoYear},month(t){return t.isoMonth},day:(t)=>t.isoDay}),Object.assign({},Xe,Fp,{h:ai,ee(t){let s=this.O(t);return[s.era,s.eraYear]},I(t,s){let r=Er.call(this,t);return[ii(s,r),r===s]},N(t,s,r){let[a,i,o]=ai.call(this,{isoYear:As,isoMonth:Et,isoDay:31}),e=Er.call(this,a),n=i===e;(Vt(t,ii(i,e))||Vt(Number(s),Number(n))||Vt(r,o))===1&&a--;for(let d=0;d<100;d++){let l=a-d,u=Er.call(this,l),c=_r(t,s,u);if(s===(c===u)&&r<=Ge.call(this,l,c))return[l,c]}},K(t){let s=Fr.call(this,t);return s>Fr.call(this,t-1)&&s>Fr.call(this,t+1)},U:Er,L:$r,J(t,s){let r=s+t,a=Math.sign(t),i=a<0?-1:0,o=0;for(let e=s;e!==r;e+=a)o+=$r.call(this,e+i);return o},j:Ge,X:Fr,P(t,s,r){return ra(nr.call(this,t,s,r))},q:nr,_(t,s,r){if(r){if(s+=r,!Number.isSafeInteger(s))throw new RangeError(Da);if(r<0)for(;s<1;)s+=$r.call(this,--t);else{let a;for(;s>(a=$r.call(this,t));)s-=a,t++}}return[t,s]},year(t){return this.O(t).year},month(t){let{year:s,F:r}=this.O(t),{C:a}=this.B(s);return a[r]+1},day(t){return this.O(t).day}})),Wt="numeric",Gs=["timeZoneName"],fu={month:Wt,day:Wt},Xo={year:Wt,month:Wt},Qo=Object.assign({},Xo,{day:Wt}),Yo={hour:Wt,minute:Wt,second:Wt},te=Object.assign({},Qo,Yo),$p=Object.assign({},te,{timeZoneName:"short"}),Zp=Object.keys(Xo),jp=Object.keys(fu),Lp=Object.keys(Qo),kp=Object.keys(Yo),se=["dateStyle"],Np=Zp.concat(se),Up=jp.concat(se),re=Lp.concat(se,["weekday"]),Or=kp.concat(["dayPeriod","timeStyle"]),ae=re.concat(Or),Vp=ae.concat(Gs),Gp=Gs.concat(Or),Wp=Gs.concat(re),_p=Gs.concat(["day","weekday"],Or),zp=Gs.concat(["year","weekday"],Or),Bp={},ie=[ys(ae,te),na],yu=[ys(Vp,$p),na,0,(t,s)=>{let r=W(t.timeZone);if(s&&W(s.timeZone)!==r)throw new RangeError(Vl);return r}],oe=[ys(ae,te,Gs),st],ee=[ys(re,Qo,Gp),st],ne=[ys(Or,Yo,Wp),(t)=>zt(t)/St],de=[ys(Np,Xo,_p),st,1],le=[ys(Up,fu,zp),st,1],Qe;function qt(t,s,r,a,i){function o(...d){if(!(this instanceof o))throw new TypeError(vo);Cu(this,s(...d))}function e(d,l){return Object.defineProperties(function(...u){return d.call(this,n(this),...u)},ui(l))}function n(d){let l=X(d);if(!l||l.branding!==t)throw new TypeError(vo);return l}return Object.defineProperties(o.prototype,{...tn(Ct(e,r)),...us(Ct(e,a)),...Br("Temporal."+t)}),Object.defineProperties(o,{...us(i),...ui(t)}),[o,(d)=>{let l=Object.create(o.prototype);return Cu(l,d),l},n]}function bu(t){return t=t.concat("id").sort(),(s)=>{if(!sn(s,t))throw new TypeError(Ul);return s}}function Bs(t){if(X(t)||t.calendar!==void 0||t.timeZone!==void 0)throw new TypeError(jl);return t}function ja(t,s){let r={};for(let a in t)r[a]=({o:i},o)=>{let e=X(o)||{},{branding:n}=e,d=n===ws||s.includes(n)?e:ot(o);return i[a](d)};return r}function pe(t){let s={};for(let r in t)s[r]=(a)=>{let{calendar:i}=a;return(o=i,typeof o=="string"?Vs(o):(e=o,Object.assign(Object.create(cm),{i:e})))[r](a);var o,e};return s}function os(){throw new TypeError(kl)}function Hr({calendar:t}){return typeof t=="string"?new xe(t):t}function gu(t,s){if(s=F(s),U(t)){let a=X(t);if(a&&a.branding===Us)return C(s),a;let i=Mu(t);return Oo(Wa(i||x),!i,t,s)}let r=cd(Vs,t);return C(s),r}function Hu(t,s,r){return a=s.call(t,it(V(r))),Vi(pr(a));var a}function La(t,s=Ku){let r=Object.keys(s).sort(),a={};for(let i of r)a[i]=w(s[i],t,iu(t[i]));return a}function b(t,s){return typeof t=="string"?$a(t):La(t,s)}function L(t){return b(t,ce)}function At(t){if(U(t)){let s=X(t);if(s)switch(s.branding){case Ea:return s;case Ut:return V(s.epochNanoseconds)}}return ed(t)}function wu(t,s,r){let a=s.l(At(r).epochNanoseconds,t);return a?it(V(a)):null}function D(t){return U(t)?(X(t)||{}).timeZone||fm(t):((s)=>wa(Pd(K(s))))(t)}function ss(t,s){if(U(t)){let r=X(t)||{};switch(r.branding){case va:return C(s),r;case xs:return C(s),bt(r);case Ut:return C(s),So(L,r)}return zd(t,s)}return C(s),pd(t)}function me(t){return t===void 0?void 0:ss(t)}function Ws(t,s){if(s=F(s),U(t)){let a=X(t);return a&&a.branding===Ns?(C(s),a):Ro(Va(Dr(t)),t,s)}let r=ud(Vs,t);return C(s),r}function rs(t,s){if(s=F(s),U(t)){let a=X(t)||{};switch(a.branding){case xs:return C(s),a;case ws:return C(s),$({...a,...xt});case Ut:return C(s),Mo(L,a)}return _d(Ga(Dr(t)),t,s)}let r=ld(t);return C(s),r}function ot(t,s){if(s=F(s),U(t)){let a=X(t)||{};switch(a.branding){case ws:return C(s),a;case xs:return C(s),Z(a);case Ut:return C(s),Io(L,a)}return Co(Ga(Dr(t)),t,s)}let r=ya(t);return C(s),r}function Du(t,s,r){return Rt(s.call(t,v(Z(r,t))))}function vt(t){return(s)=>typeof s=="string"?Vs(s):((r,a)=>{let i=Object.keys(a).sort(),o={};for(let e of i)o[e]=w(a[e],r,r[e]);return o})(s,t)}function q(t){if(U(t)){let s=X(t);return s&&s.branding===Fa?s:Bd(t)}return md(t)}function br(t){if(t!==void 0){if(U(t)){let s=X(t)||{};switch(s.branding){case Ut:case ws:return s;case xs:return Z(s)}let r=Dr(t);return{...Gd(D,b,Ga(r),t),calendar:r}}return nd(t)}}function Dr(t){return Mu(t)||x}function Mu(t){let{calendar:s}=t;if(s!==void 0)return J(s)}function J(t){return U(t)?(X(t)||{}).calendar||Km(t):((s)=>Pr(Td(K(s))))(t)}function _s(t,s){if(s=F(s),U(t)){let r=X(t);if(r&&r.branding===Ut)return mr(s),r;let a=Dr(t);return Wd(D,b,Ga(a),a,t,s)}return dd(t,s)}function xu(t){return Ct((s)=>(r)=>s(ue(r)),t)}function ue(t){return rt(t,L)}function Jp(){let t=ts.prototype,s=Object.getOwnPropertyDescriptors(t),r=Object.getOwnPropertyDescriptors(ts),a=function(i,o={}){if(!(this instanceof a))return new a(i,o);Ce.set(this,((e,n={})=>{let d=new ts(e,n),l=d.resolvedOptions(),u=l.locale,c=ct(Object.keys(n),l),p=lt(Yp),m=(...T)=>{let P,h=T.map((y,f)=>{let g=X(y),E=(g||{}).branding;if(f&&P&&P!==E)throw new TypeError(Wl);return P=E,g});return P?p(P)(u,c,...h):[d,...T]};return m.u=d,m})(i,o))};for(let i in s){let o=s[i],e=i.startsWith("format")&&Xp(i);typeof o.value=="function"?o.value=i==="constructor"?a:e||Qp(i):e&&(o.get=function(){return e.bind(this)})}return r.prototype.value=Object.create(t,s),Object.defineProperties(a,r),a}function Xp(t){return function(...s){let r=Ce.get(this),[a,...i]=r(...s);return a[t](...i)}}function Qp(t){return function(...s){return Ce.get(this).u[t](...s)}}function Yp(t){let s=tm[t];if(!s)throw new TypeError(Gl(t));return Lt(s,lt(Ao))}var tm={Instant:ie,PlainDateTime:oe,PlainDate:ee,PlainTime:ne,PlainYearMonth:de,PlainMonthDay:le},sm=Lt(ie),rm=Lt(yu),am=Lt(oe),im=Lt(ee),om=Lt(ne),em=Lt(de),nm=Lt(le),Te={era:ln,eraYear:Ti,year:pr,month:Rt,daysInMonth:Rt,daysInYear:Rt,inLeapYear:au,monthsInYear:Rt},Na={monthCode:K},Pe={day:Rt},Iu={dayOfWeek:Rt,dayOfYear:Rt,weekOfYear:un,yearOfWeek:Ti,daysInWeek:Rt},Su=Object.assign({},Te,Na,Pe,Iu),ka=new WeakMap,X=ka.get.bind(ka),Cu=ka.set.bind(ka),dm={...ja(Te,[Ns]),...ja(Iu,[]),...ja(Na,[Ns,Us]),...ja(Pe,[Us])},he=pe(Su),lm=pe({...Te,...Na}),um=pe({...Na,...Pe}),Mr={calendarId:(t)=>W(t.calendar)},cm=Ct((t,s)=>function(r){let{i:a}=this;return t(a[s](v(Z(r,a))))},Su),pm=ur((t)=>(s)=>s[t],R.concat("sign")),fe=ur((t,s)=>(r)=>r[Dt[s]],Nt),Au={epochSeconds:Kn,epochMilliseconds:na,epochMicroseconds:qn,epochNanoseconds:vn},Ir=w(ci,new Set(["branding"])),[mm,zs,Tm]=qt(Us,w(ll,J),{...Mr,...um},{getISOFields:Ir,getCalendar:Hr,with(t,s,r){return zs(tl(Im,t,this,Bs(s),r))},equals:(t,s)=>Id(t,gu(s)),toPlainDate(t,s){return v(Rl(Sr,t,this,s))},toLocaleString(t,s,r){let[a,i]=nm(s,r,t);return a.format(i)},toString:ji,toJSON:(t)=>ji(t),valueOf:os},{from:(t,s)=>zs(gu(t,s))}),Ku={getOffsetNanosecondsFor:Hu,getPossibleInstantsFor(t,s,r){let a=[...s.call(t,B($(r,x)))].map((o)=>hm(o).epochNanoseconds),i=a.length;return i>1&&(a.sort(tt),Gi(Pt(Tt(a[0],a[i-1])))),a}},ce={getOffsetNanosecondsFor:Hu},[Pm,it,hm]=qt(Ea,il,Au,{add:(t,s)=>it(Wi(0,t,q(s))),subtract:(t,s)=>it(Wi(1,t,q(s))),until:(t,s,r)=>H(To(0,t,At(s),r)),since:(t,s,r)=>H(To(1,t,At(s),r)),round:(t,s)=>it($n(t,s)),equals:(t,s)=>Od(t,At(s)),toZonedDateTime(t,s){let r=Zt(s);return j(Do(t,D(r.timeZone),J(r.calendar)))},toZonedDateTimeISO:(t,s)=>j(Do(t,D(s))),toLocaleString(t,s,r){let[a,i]=sm(s,r,t);return a.format(i)},toString:(t,s)=>vi(D,L,t,s),toJSON:(t)=>vi(D,L,t),valueOf:os},{from:(t)=>it(At(t)),fromEpochSeconds:(t)=>it(Hl(t)),fromEpochMilliseconds:(t)=>it(Dl(t)),fromEpochMicroseconds:(t)=>it(Ml(t)),fromEpochNanoseconds:(t)=>it(Il(t)),compare:(t,s)=>co(At(t),At(s))}),[Ua,PT]=qt("TimeZone",(t)=>{let s=Cd(t);return{branding:"TimeZone",id:s,o:$a(s)}},{id:(t)=>t.id},{getPossibleInstantsFor:({o:t},s)=>t.getPossibleInstantsFor(rs(s)).map((r)=>it(V(r))),getOffsetNanosecondsFor:({o:t},s)=>t.getOffsetNanosecondsFor(At(s).epochNanoseconds),getOffsetStringFor(t,s){let r=At(s).epochNanoseconds,a=La(this,ce).getOffsetNanosecondsFor(r);return ms(a)},getPlainDateTimeFor(t,s,r=x){let a=At(s).epochNanoseconds,i=La(this,ce).getOffsetNanosecondsFor(a);return B($(Jt(a,i),J(r)))},getInstantFor(t,s,r){let a=rs(s),i=Oi(r),o=La(this);return it(V(ut(o,a,i)))},getNextTransition:({o:t},s)=>wu(1,t,s),getPreviousTransition:({o:t},s)=>wu(-1,t,s),equals(t,s){return!!Ca(this,D(s))},toString:(t)=>t.id,toJSON:(t)=>t.id},{from(t){let s=D(t);return typeof s=="string"?new Ua(s):s}}),fm=bu(Object.keys(Ku)),[ym,as]=qt(va,ul,fe,{getISOFields:Ir,with(t,s,r){return as(sl(this,Bs(s),r))},add:(t,s)=>as(Xi(0,t,q(s))),subtract:(t,s)=>as(Xi(1,t,q(s))),until:(t,s,r)=>H(go(0,t,ss(s),r)),since:(t,s,r)=>H(go(1,t,ss(s),r)),round:(t,s)=>as(Ln(t,s)),equals:(t,s)=>Sd(t,ss(s)),toZonedDateTime:(t,s)=>j(Ol(D,ot,b,t,s)),toPlainDateTime:(t,s)=>B(bl(t,ot(s))),toLocaleString(t,s,r){let[a,i]=om(s,r,t);return a.format(i)},toString:Li,toJSON:(t)=>Li(t),valueOf:os},{from:(t,s)=>as(ss(t,s)),compare:(t,s)=>xa(ss(t),ss(s))}),[gm,is,wm]=qt(Ns,w(dl,J),{...Mr,...lm},{getISOFields:Ir,getCalendar:Hr,with(t,s,r){return is(Yd(Mm,t,this,Bs(s),r))},add:(t,s,r)=>is(Ji(Ru,0,t,q(s),r)),subtract:(t,s,r)=>is(Ji(Ru,1,t,q(s),r)),until:(t,s,r)=>H(yo(Ou,0,t,Ws(s),r)),since:(t,s,r)=>H(yo(Ou,1,t,Ws(s),r)),equals:(t,s)=>Md(t,Ws(s)),toPlainDate(t,s){return v(Cl(Sr,t,this,s))},toLocaleString(t,s,r){let[a,i]=em(s,r,t);return a.format(i)},toString:Zi,toJSON:(t)=>Zi(t),valueOf:os},{from:(t,s)=>is(Ws(t,s)),compare:(t,s)=>hs(Ws(t),Ws(s))}),[xm,B]=qt(xs,w(el,J),{...Mr,...he,...fe},{getISOFields:Ir,getCalendar:Hr,with(t,s,r){return B(Xd(Sr,t,this,Bs(s),r))},withCalendar:(t,s)=>B(Ha(t,J(s))),withPlainDate:(t,s)=>B(ql(t,ot(s))),withPlainTime:(t,s)=>B(Kl(t,me(s))),add:(t,s,r)=>B(zi(Rs,0,t,q(s),r)),subtract:(t,s,r)=>B(zi(Rs,1,t,q(s),r)),until:(t,s,r)=>H(ho(Kt,0,t,rs(s),r)),since:(t,s,r)=>H(ho(Kt,1,t,rs(s),r)),round:(t,s)=>B(jn(t,s)),equals:(t,s)=>Hd(t,rs(s)),toZonedDateTime:(t,s,r)=>j(Pl(b,t,D(s),r)),toPlainDate:(t)=>v(Z(t)),toPlainTime:(t)=>as(bt(t)),toPlainYearMonth(t){return is(hl(Va,t,this))},toPlainMonthDay(t){return zs(fl(Wa,t,this))},toLocaleString(t,s,r){let[a,i]=am(s,r,t);return a.format(i)},toString:Fi,toJSON:(t)=>Fi(t),valueOf:os},{from:(t,s)=>B(rs(t,s)),compare:(t,s)=>mo(rs(t),rs(s))}),[Cm,v,qu]=qt(ws,w(nl,J),{...Mr,...he},{getISOFields:Ir,getCalendar:Hr,with(t,s,r){return v(Qd(Sr,t,this,Bs(s),r))},withCalendar:(t,s)=>v(Ha(t,J(s))),add:(t,s,r)=>v(Bi(Rs,0,t,q(s),r)),subtract:(t,s,r)=>v(Bi(Rs,1,t,q(s),r)),until:(t,s,r)=>H(fo(Kt,0,t,ot(s),r)),since:(t,s,r)=>H(fo(Kt,1,t,ot(s),r)),equals:(t,s)=>Dd(t,ot(s)),toZonedDateTime(t,s){let r=!U(s)||s instanceof Ua?{timeZone:s}:s;return j(yl(D,ss,b,t,r))},toPlainDateTime:(t,s)=>B(gl(t,me(s))),toPlainYearMonth(t){return is(wl(Va,t,this))},toPlainMonthDay(t){return zs(xl(Wa,t,this))},toLocaleString(t,s,r){let[a,i]=im(s,r,t);return a.format(i)},toString:$i,toJSON:(t)=>$i(t),valueOf:os},{from:(t,s)=>v(ot(t,s)),compare:(t,s)=>hs(ot(t),ot(s))}),ye={fields(t,s,r){return[...s.call(t,r)]}},vu=Object.assign({dateFromFields(t,s,r,a){return qu(s.call(t,Object.assign(Object.create(null),r),a))}},ye),Eu=Object.assign({yearMonthFromFields(t,s,r,a){return wm(s.call(t,Object.assign(Object.create(null),r),a))}},ye),Fu=Object.assign({monthDayFromFields(t,s,r,a){return Tm(s.call(t,Object.assign(Object.create(null),r),a))}},ye),ge={mergeFields(t,s,r,a){return Zt(s.call(t,Object.assign(Object.create(null),r),Object.assign(Object.create(null),a)))}},Rm=Object.assign({},vu,ge),Om=Object.assign({},Eu,ge),bm=Object.assign({},Fu,ge),we={dateAdd(t,s,r,a,i){return qu(s.call(t,v(Z(r,t)),H(I(a)),i))}},$u=Object.assign({},we,{dateUntil(t,s,r,a,i,o){return Am(s.call(t,v(Z(r,t)),v(Z(a,t)),Object.assign(Object.create(null),o,{largestUnit:wr[i]})))}}),Hm=Object.assign({},we,{day:Du}),Dm=Object.assign({},$u,{day:Du}),Va=vt(Eu),Ga=vt(vu),Wa=vt(Fu),Mm=vt(Om),Sr=vt(Rm),Im=vt(bm),Rs=vt(we),Kt=vt($u),Ru=vt(Hm),Ou=vt(Dm),[Sm,H,Am]=qt(Fa,cl,{...pm,blank:ad},{with:(t,s)=>H(rl(t,s)),negated:(t)=>H(ha(t)),abs:(t)=>H(rd(t)),add:(t,s,r)=>H(ro(br,Kt,b,0,t,q(s),r)),subtract:(t,s,r)=>H(ro(br,Kt,b,1,t,q(s),r)),round:(t,s)=>H(sd(br,Kt,b,t,s)),total:(t,s)=>Fn(br,Kt,b,t,s),toLocaleString(t,s,r){return Intl.DurationFormat?new Intl.DurationFormat(s,r).format(this):ca(t)},toString:ca,toJSON:(t)=>ca(t),valueOf:os},{from:(t)=>H(q(t)),compare:(t,s,r)=>Rd(br,Rs,b,q(t),q(s),r)}),Zu={toString:(t)=>t.id,toJSON:(t)=>t.id,...dm,dateAdd:({id:t,o:s},r,a,i)=>v(Z(s.dateAdd(ot(r),q(a),i),t)),dateUntil:({o:t},s,r,a)=>H(I(t.dateUntil(ot(s),ot(r),Dn(a)))),dateFromFields:({id:t,o:s},r,a)=>v(Co(s,r,a,dn(t))),yearMonthFromFields:({id:t,o:s},r,a)=>is(Ro(s,r,a,en(t))),monthDayFromFields:({id:t,o:s},r,a)=>zs(Oo(s,0,r,a,nn(t))),fields({o:t},s){let r=new Set(Ht),a=[];for(let i of s){if(K(i),!r.has(i))throw new RangeError(qo(i));r.delete(i),a.push(i)}return t.fields(a)},mergeFields:({o:t},s,r)=>t.mergeFields(pi(Pi(s)),pi(Pi(r)))},[xe]=qt("Calendar",(t)=>{let s=Zd(t);return{branding:"Calendar",id:s,o:Vs(s)}},{id:(t)=>t.id},Zu,{from(t){let s=J(t);return typeof s=="string"?new xe(s):s}}),Km=bu(Object.keys(Zu).slice(4)),[qm,j]=qt(Ut,w(ol,J,D),{...Au,...Mr,...xu(he),...xu(fe),offset:(t)=>ms(ue(t).offsetNanoseconds),offsetNanoseconds:(t)=>ue(t).offsetNanoseconds,timeZoneId:(t)=>W(t.timeZone),hoursInDay:(t)=>kn(b,t)},{getISOFields:(t)=>Yn(L,t),getCalendar:Hr,getTimeZone:({timeZone:t})=>typeof t=="string"?new Ua(t):t,with(t,s,r){return j(Jd(Sr,b,t,this,Bs(s),r))},withCalendar:(t,s)=>j(Ha(t,J(s))),withTimeZone:(t,s)=>j(vl(t,D(s))),withPlainDate:(t,s)=>j(Al(b,t,ot(s))),withPlainTime:(t,s)=>j(Sl(b,t,me(s))),add:(t,s,r)=>j(_i(Rs,b,0,t,q(s),r)),subtract:(t,s,r)=>j(_i(Rs,b,1,t,q(s),r)),until:(t,s,r)=>H(I(Po(Kt,b,0,t,_s(s),r))),since:(t,s,r)=>H(I(Po(Kt,b,1,t,_s(s),r))),round:(t,s)=>j(Zn(b,t,s)),startOfDay:(t)=>j(Nn(b,t)),equals:(t,s)=>bd(t,_s(s)),toInstant:(t)=>it(pl(t)),toPlainDateTime:(t)=>B(Mo(L,t)),toPlainDate:(t)=>v(Io(L,t)),toPlainTime:(t)=>as(So(L,t)),toPlainYearMonth(t){return is(ml(Va,t,this))},toPlainMonthDay(t){return zs(Tl(Wa,t,this))},toLocaleString(t,s,r={}){let[a,i]=rm(s,r,t);return a.format(i)},toString:(t,s)=>Ei(L,t,s),toJSON:(t)=>Ei(L,t),valueOf:os},{from:(t,s)=>j(_s(t,s)),compare:(t,s)=>po(_s(t),_s(s))}),vm=Object.defineProperties({},{...Br("Temporal.Now"),...us({timeZoneId:()=>kt(),instant:()=>it(V(fr())),zonedDateTime:(t,s=kt())=>j(z(fr(),D(s),J(t))),zonedDateTimeISO:(t=kt())=>j(z(fr(),D(t),x)),plainDateTime:(t,s=kt())=>B($(Ls(L(D(s))),J(t))),plainDateTimeISO:(t=kt())=>B($(Ls(L(D(t))),x)),plainDate:(t,s=kt())=>v(Z(Ls(L(D(s))),J(t))),plainDateISO:(t=kt())=>v(Z(Ls(L(D(t))),x)),plainTimeISO:(t=kt())=>as(bt(Ls(L(D(t)))))})}),Ar=Object.defineProperties({},{...Br("Temporal"),...us({PlainYearMonth:gm,PlainMonthDay:mm,PlainDate:Cm,PlainTime:ym,PlainDateTime:xm,ZonedDateTime:qm,Instant:Pm,Calendar:xe,TimeZone:Ua,Duration:Sm,Now:vm})}),Em=Jp(),Ce=new WeakMap,Fm=Object.defineProperties(Object.create(Intl),us({DateTimeFormat:Em}));class za extends _a{provider;static _name="AuthenticationServiceContainer";constructor(t){super();this.provider=t}async getSession(t,s){let r=await this.provider.adapter.findSession({token:t,userAgent:s}),a=null;if(r?.user)a=await this.provider.extendSession(r.user),r.user.extension=a;return r}async generateMagicLink(t){}async upsertSession(t){await this.provider.adapter.findSession({token:"",userAgent:""})}async authenticate(t){try{let s=await this.provider.adapter.findUserByEmailAddress(t,!1),r=await this.createOrUpdateSession({email:t,id:s.id});return new tr().ctx().setCookie("access_token",r.token,{expires:r.expiresAt}),!0}catch(s){console.log(s)}return!1}async createOrUpdateSession(t){let s=this.provider,r=new tr,a=r.headers.get("User-Agent"),i=new Bun.CryptoHasher("sha256");i.update(`${t.email}${a}`);let o=i.digest("hex"),e=await s.adapter.findSession({token:o,userAgent:r.headers.get("User-Agent")});if(!e){let n=t.id;if(!n){let{id:d}=await s.adapter.findUserByEmailAddress(t.email,!1);n=d}e=await s.adapter.createSession({token:o,userId:n,userAgent:r.headers.get("User-Agent"),expiresAt:new Date(Ar.Now.instant().add({hours:s.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(Ar.Now.instant().add({hours:s.sessionAbsoluteExpiresInHours}).toString())})}else e=await s.adapter.updateSession({token:o,expiresAt:new Date(Ar.Now.instant().add({hours:s.sessionExpiresInHours}).toString())});return e}async createMagicLinkToken(t){let s=za.use()?.provider,r=await s.adapter.findUserByEmailAddress(t,!1);if(r){await s.adapter.deleteMagicLinkToken(t);let a=await s.generateMagicLinkToken(t),i=(parseInt($m(4).toString("hex"),16)%1e6).toString().padStart(6,"0");return await s.adapter.createMagicLinkToken({email:t,token:a,pin:i}),{user:r,email:t,pin:i,token:a}}}}class ju extends mt{async run(t){let s=Os.getStore(),r=s.req.cookies.get("access_token"),a=s.req.headers.get("access_token"),i=r||a;if(!i)throw new sr;let o=s.user;if(!o){let e=await za.use().getSession(i,s.req.headers.get("User-Agent"));if(!e)throw new sr;o=e?.user,s.setUser(o)}return{}}}class Lu extends mt{async run(...t){let[s="public",r="864000",...a]=t,i=`${s}, max-age=${r}${a.length>0?", ":""}${a.join(", ")}`;if(t.length===0)i="public, max-age=864000, stale-while-revalidate=300, stale-if-error=600";if(t.length===1&&t[0]==="public")i="public, max-age=864000, stale-while-revalidate=300, stale-if-error=600";if(t.length===1&&t[0]==="private")i="private, max-age=0, stale-while-revalidate=300, stale-if-error=600";if(this.req.rawRequest.method==="GET")this.req.ctx().setHeaders("Cache-Control",i);return{}}}var Zm={"Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Authorization, X-Requested-With","Access-Control-Allow-Credentials":"true"};class ku extends mt{config={origins:{"":{"Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Authorization, X-Requested-With","Access-Control-Allow-Credentials":"true"}}};run(){let t=this.req,s=t.rawRequest.headers.get("Origin");if(this.config.origins[s]){t.ctx().setHeaders("Access-Control-Allow-Origin",s);let r={...Zm,...this.config.origins[s]};for(let[a,i]of Object.entries(r))t.ctx().setHeaders(a,i)}return{}}}class Re extends _a{service;static _name="RateLimiterServiceContainer";constructor(t){super();this.service=t}}class Nu extends ft{constructor(){super("Rate limit exceeded");this.payload={api:{status:429,data:{error:{message:"Rate limit exceeded"}},headers:{"Content-Type":"application/json"}},view:{error:{message:"Rate limit exceeded"},status:429}}}}class Uu extends mt{async run(t=1000){let s=this.req.headers.get("x-forwarded-for"),r=Re.use().service.driver;if(r.consume.call(r,s,this.req.routePath)>t)throw new Nu;return{}}}class Vu extends mt{async run(){let t=this.req.cookies.get("csrf_token");if(!t)throw new Oe;if(!["POST","PUT","PATCH","DELETE"].includes(this.req.rawRequest.method))return{};if(!Bun.CSRF.verify(t,{secret:process.env.SECRET}))throw new Oe;return{}}}class Oe extends ft{constructor(){super("Invalid CSRF token");this.name="InvalidCSRFTokenError"}payload={api:{status:403,data:{error:"Invalid CSRF token"}},view:{}}}class Gu{policiesList={};constructor(){let t=this.register();for(let s of t){let r=new s;this.policiesList[s.name]=r}}register(){return[]}}class Wu{all(t,s){return!0}}export{tc as getCookies,Qs as ViewRouter,Ys as ValidationError,Kr as ResourceController,ft as RequestBreakerError,Uu as RateLimitMiddleware,Gu as PoliciesServiceProvider,Wu as Policies,Ee as MiddlewareServiceProvider,mt as Middleware,$e as InsufficientPermissionsError,tr as HttpRequest,ku as CorsMiddleware,Ba as Controller,Lu as CacheMiddleware,Vu as CSRFMiddleware,Fe as AuthorizationError,ju as AuthenticationMiddleware,sr as AuthenticationError,Ja as ApiRouter};export{Ba as G,be as H,Ja as I,Qs as J,Ys as K,Os as L,tr as M,Ee as N,Fe as O,$e as P,Ar as Q,za as R,Re as S};
3
3
 
4
- //# debugId=F43ACB929E6F6DE064756E2164756E21
4
+ //# debugId=DA490DA625BE3C2C64756E2164756E21