gemi 0.4.92 → 0.4.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/App.d.ts +2 -24
- package/dist/app/App.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bin/index.js +73 -31
- package/dist/broadcasting/index.js +1 -1
- package/dist/{chunk-8ee09f1f74206a04.js → chunk-035e233acf299392.js} +2 -2
- package/dist/{chunk-2c5ecf8dc0a97aba.js → chunk-04f04986e53516f0.js} +1 -1
- package/dist/{chunk-6b58f7c76c2a738c.js → chunk-0f0add364d3ea615.js} +1 -1
- package/dist/chunk-0fd23409fff0376b.js +2 -0
- package/dist/{chunk-07ad6201a5864cd0.js → chunk-1770e9abf10029e0.js} +1 -1
- package/dist/chunk-2573b2361de4a370.js +2 -0
- package/dist/{chunk-b13ef9b23e30af91.js → chunk-2f8839f406606d63.js} +1 -1
- package/dist/{chunk-7d5fe4acabfee228.js → chunk-33abc8f4f7df6791.js} +2 -2
- package/dist/chunk-494de321e3423d54.js +2 -0
- package/dist/chunk-496c32676431beab.js +18 -0
- package/dist/chunk-6286081da32e2feb.js +2 -0
- package/dist/{chunk-24a86f8f5ddc0cbd.js → chunk-7ce930fe69575c87.js} +1 -1
- package/dist/{chunk-9dc5c9b7a885d0bc.js → chunk-8fec55214eb03a61.js} +2 -2
- package/dist/chunk-9a9d43e4b919c267.js +2 -0
- package/dist/chunk-b6fb088270ea6584.js +3 -0
- package/dist/chunk-c459f3e37965c22f.js +2 -0
- package/dist/{chunk-0ba2cc302113ab40.js → chunk-cfb8c5b12b0e5378.js} +2 -2
- package/dist/chunk-cfbe2cbcadcb1ac1.js +2 -0
- package/dist/{chunk-542b3c90f0ff4ded.js → chunk-d09948245f5b426d.js} +1 -1
- package/dist/chunk-d7525516b1305ba3.js +6 -0
- package/dist/{chunk-332553172e3ab961.js → chunk-dfb863d471bf3b18.js} +2 -2
- package/dist/{chunk-28694e5e949df0ff.js → chunk-e1929f0f7003fbdf.js} +2 -2
- package/dist/chunk-e76c7e3bf2d698af.js +2 -0
- package/dist/{chunk-880cfc21ce7cc2c6.js → chunk-eabfa03c809e14df.js} +2 -2
- package/dist/{chunk-43b1a27bc037bc09.js → chunk-ef791082443c0cbd.js} +1 -1
- package/dist/{chunk-6a2141dd4169ce0e.js → chunk-f10ba402aaacfc12.js} +2 -2
- package/dist/client/ClientRouterContext.d.ts.map +1 -1
- package/dist/client/index.js +3 -0
- package/dist/email/index.js +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/http/I18nServiceContainer.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/kernel/Kernel.d.ts +5 -4
- package/dist/kernel/Kernel.d.ts.map +1 -1
- package/dist/kernel/context.d.ts +2 -2
- package/dist/kernel/context.d.ts.map +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/server/index.js +5 -5
- package/dist/services/ServiceProvider.d.ts +1 -1
- package/dist/services/ServiceProvider.d.ts.map +1 -1
- package/dist/services/index.js +1 -10
- package/dist/services/router/ViewRouterServiceContainer.d.ts +12 -0
- package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -0
- package/dist/services/router/ViewRouterServiceProvider.d.ts +13 -0
- package/dist/services/router/ViewRouterServiceProvider.d.ts.map +1 -0
- package/dist/services/router/createComponentTree.d.ts +4 -0
- package/dist/services/router/createComponentTree.d.ts.map +1 -0
- package/dist/services/router/createComponentTree.test.d.ts +2 -0
- package/dist/services/router/createComponentTree.test.d.ts.map +1 -0
- package/dist/services/router/createFlatViewRoutes.d.ts +14 -0
- package/dist/services/router/createFlatViewRoutes.d.ts.map +1 -0
- package/dist/services/router/createFlatViewRoutes.test.d.ts +2 -0
- package/dist/services/router/createFlatViewRoutes.test.d.ts.map +1 -0
- package/dist/services/router/createRouteManifest.d.ts +3 -0
- package/dist/services/router/createRouteManifest.d.ts.map +1 -0
- package/dist/services/router/createRouteManifest.test.d.ts +2 -0
- package/dist/services/router/createRouteManifest.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/app/Plugin.d.ts +0 -10
- package/dist/app/Plugin.d.ts.map +0 -1
- package/dist/app/createComponentTree.d.ts +0 -4
- package/dist/app/createComponentTree.d.ts.map +0 -1
- package/dist/app/createFlatViewRoutes.d.ts +0 -10
- package/dist/app/createFlatViewRoutes.d.ts.map +0 -1
- package/dist/app/createRouteManifest.d.ts +0 -3
- package/dist/app/createRouteManifest.d.ts.map +0 -1
- package/dist/chunk-156c827bf8d5029c.js +0 -5
- package/dist/chunk-53b7d6267c9172bc.js +0 -2
- package/dist/chunk-63884944ac5ce0f0.js +0 -2
- package/dist/chunk-83938f41a5342f87.js +0 -2
- package/dist/chunk-9475c6ed18013dc8.js +0 -2
- package/dist/chunk-9d5c096c43928b37.js +0 -1
- package/dist/chunk-a1ef3b11adc01140.js +0 -6
- package/dist/chunk-ad396345e8e74292.js +0 -2
- package/dist/chunk-e1a4203ece554bc3.js +0 -2
- package/dist/chunk-e4a19367b5596f21.js +0 -2
- package/dist/chunk-fe8cfc6e6c3ce826.js +0 -16
- package/dist/server/generateEtag.d.ts +0 -2
- package/dist/server/generateEtag.d.ts.map +0 -1
package/dist/kernel/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as xu,b as Qi,c as Gi,d as Lu,e as wc,g as os,h as Rs,i as Fa,j as Gu,k as Iu,m as qu,n as Uu} from"../http/index.js";import{o as _i} from"../facades/index.js";import{p as Yu,q as zu,r as Bu,s as Ku,t as Xu} from"../services/index.js";import"../chunk-2c5ecf8dc0a97aba.js";import{A as jt,z as Cc} from"../chunk-9475c6ed18013dc8.js";import"../chunk-24a86f8f5ddc0cbd.js";import"../chunk-332553172e3ab961.js";import{E as _u,F as Qu} from"../chunk-7d5fe4acabfee228.js";import"../chunk-0ba2cc302113ab40.js";import"../chunk-28694e5e949df0ff.js";import"../chunk-fe8cfc6e6c3ce826.js";import"../chunk-156c827bf8d5029c.js";import"../chunk-6a2141dd4169ce0e.js";import"../chunk-9d5c096c43928b37.js";import"../chunk-880cfc21ce7cc2c6.js";import"../chunk-9dc5c9b7a885d0bc.js";import"../chunk-b13ef9b23e30af91.js";var xa=function(a,s,t,i,o){function r(...d){if(!(this instanceof r))throw new TypeError(Cr);gu(this,s(...d))}function c(d,f){return Object.defineProperties(function(...u){return d.call(this,l(this),...u)},ro(f))}function l(d){const f=k(d);if(!f||f.branding!==a)throw new TypeError(Cr);return f}return Object.defineProperties(r.prototype,{...Qc(ya(c,t)),...us(ya(c,i)),...qt("Temporal."+a)}),Object.defineProperties(r,{...us(o),...ro(a)}),[r,(d)=>{const f=Object.create(r.prototype);return gu(f,d),f},l]},bu=function(a){return a=a.concat("id").sort(),(s)=>{if(!Yc(s,a))throw new TypeError(Ef);return s}},Xs=function(a){if(k(a)||a.calendar!==void 0||a.timeZone!==void 0)throw new TypeError(xf);return a},Ai=function(a,s){const t={};for(let i in a)t[i]=({o},r)=>{const c=k(r)||{},{branding:l}=c,d=l===Ds||s.includes(l)?c:ra(r);return o[i](d)};return t},lc=function(a){const s={};for(let t in a)s[t]=(i)=>{const{calendar:o}=i;return(r=o,typeof r=="string"?Us(r):(c=r,Object.assign(Object.create(fh),{i:c})))[t](i);var r,c};return s},is=function(){throw new TypeError(If)},vt=function({calendar:a}){return typeof a=="string"?new Tc(a):a},pu=function(a,s){if(s=H(s),G(a)){const i=k(a);if(i&&i.branding===qs)return w(s),i;const o=Du(a);return yr(zi(o||S),!o,a,s)}const t=td(Us,a);return w(s),t},Ou=function(a,s,t){return i=s.call(a,oa(q(t))),Jo(ft(i));var i},Ei=function(a,s=nu){const t=Object.keys(s).sort(),i={};for(let o of t)i[o]=D(s[o],a,Xf(a[o]));return i},F=function(a,s){return typeof a=="string"?Li(a):Ei(a,s)},J=function(a){return F(a,cc)},Ca=function(a){if(G(a)){const s=k(a);if(s)switch(s.branding){case Zi:return s;case za:return q(s.epochNanoseconds)}}return kl(a)};var mu=function(a,s,t){const i=s.l(Ca(t).epochNanoseconds,a);return i?oa(q(i)):null},M=function(a){return G(a)?(k(a)||{}).timeZone||Ph(a):((s)=>Pi(cd(L(s))))(a)},ea=function(a,s){if(G(a)){const t=k(a)||{};switch(t.branding){case Ci:return w(s),t;case Ss:return w(s),wa(t);case za:return w(s),Fr(J,t)}return $d(a,s)}return w(s),id(a)},dc=function(a){return a===void 0?void 0:ea(a)},Ys=function(a,s){if(s=H(s),G(a)){const i=k(a);return i&&i.branding===Gs?(w(s),i):Or($i(nt(a)),a,s)}const t=sd(Us,a);return w(s),t},as=function(a,s){if(s=H(s),G(a)){const i=k(a)||{};switch(i.branding){case Ss:return w(s),i;case Ds:return w(s),W({...i,...Oa});case za:return w(s),vr(J,i)}return Nd(Ji(nt(a)),a,s)}const t=ad(a);return w(s),t},ra=function(a,s){if(s=H(s),G(a)){const i=k(a)||{};switch(i.branding){case Ds:return w(s),i;case Ss:return w(s),N(i);case za:return w(s),nr(J,i)}return br(Ji(nt(a)),a,s)}const t=hi(a);return w(s),t},yu=function(a,s,t){return Da(s.call(a,A(N(t,a))))},La=function(a){return(s)=>typeof s=="string"?Us(s):((t,i)=>{const o=Object.keys(i).sort(),r={};for(let c of o)r[c]=D(i[c],t,t[c]);return r})(s,a)},I=function(a){if(G(a)){const s=k(a);return s&&s.branding===xi?s:Jd(a)}return od(a)},wt=function(a){if(a!==void 0){if(G(a)){const s=k(a)||{};switch(s.branding){case za:case Ds:return s;case Ss:return N(s)}const t=nt(a);return{...Hd(M,F,Ji(t),a),calendar:t}}return Vl(a)}},nt=function(a){return Du(a)||S},Du=function(a){const{calendar:s}=a;if(s!==void 0)return X(s)},X=function(a){return G(a)?(k(a)||{}).calendar||Zh(a):((s)=>mt(rd(L(s))))(a)},Bs=function(a,s){if(s=H(s),G(a)){const t=k(a);if(t&&t.branding===za)return ut(s),t;const i=nt(a);return Wd(M,F,Ji(i),i,a,s)}return el(a,s)},hu=function(a){return ya((s)=>(t)=>s(rc(t)),a)},rc=function(a){return ta(a,J)},Bm=function(){const a=Va.prototype,s=Object.getOwnPropertyDescriptors(a),t=Object.getOwnPropertyDescriptors(Va),i=function(o,r={}){if(!(this instanceof i))return new i(o,r);bc.set(this,((c,l={})=>{const d=new Va(c,l),f=d.resolvedOptions(),u=f.locale,p=pa(Object.keys(l),f),m=fa(km),h=(...g)=>{let P;const T=g.map((O,b)=>{const y=k(O),E=(y||{}).branding;if(b&&P&&P!==E)throw new TypeError(Nf);return P=E,y});return P?m(P)(u,p,...T):[d,...g]};return h.u=d,h})(o,r))};for(let o in s){const r=s[o],c=o.startsWith("format")&&Km(o);typeof r.value=="function"?r.value=o==="constructor"?i:c||Xm(o):c&&(r.get=function(){return c.bind(this)})}return t.prototype.value=Object.create(a,s),Object.defineProperties(i,t),i},Km=function(a){return function(...s){const t=bc.get(this),[i,...o]=t(...s);return i[a](...o)}},Xm=function(a){return function(...s){return bc.get(this).u[a](...s)}},km=function(a){const s=Vm[a];if(!s)throw new TypeError(Wf(a));return Na(s,fa(Rr))};var ca=function(a,s,t,i,o){return Pa(s,Uc(a,s),t,i,o)},Pa=function(a,s,t,i,o,r){const c=ki(s,t,i);if(o&&s!==c)throw new RangeError(Cf(a,s,t,i,r));return c},Uc=function(a,s){const t=a[s];if(t===void 0)throw new TypeError(Mr(s));return t},G=function(a){return a!==null&&/object|function/.test(typeof a)},fa=function(a,s=Map){const t=new s;return(i,...o)=>{if(t.has(i))return t.get(i);const r=a(i,...o);return t.set(i,r),r}},ro=function(a){return us({name:a},1)},us=function(a,s){return ya((t)=>({value:t,configurable:1,writable:!s}),a)},Qc=function(a){return ya((s)=>({get:s,configurable:1}),a)},qt=function(a){return{[Symbol.toStringTag]:{value:a,configurable:1}}},Is=function(a,s){const t={};let i=a.length;for(let o of s)t[a[--i]]=o;return t},ya=function(a,s,t){const i={};for(let o in s)i[o]=a(s[o],o,t);return i},lt=function(a,s,t){const i={};for(let o=0;o<s.length;o++){const r=s[o];i[r]=a(r,o,t)}return i},eu=function(a,s,t){const i={};for(let o=0;o<a.length;o++)i[s[o]]=t[a[o]];return i},pa=function(a,s){const t={};for(let i of a)t[i]=s[i];return t},co=function(a,s){const t={};for(let i in s)a.has(i)||(t[i]=s[i]);return t},lo=function(a){a={...a};const s=Object.keys(a);for(let t of s)a[t]===void 0&&delete a[t];return a},Yc=function(a,s){for(let t of s)if(!(t in a))return 0;return 1},Bc=function(a,s,t){for(let i of a)if(s[i]!==t[i])return 0;return 1},Kc=function(a,s,t){const i={...t};for(let o=0;o<s;o++)i[a[o]]=0;return i},D=function(a,...s){return(...t)=>a(...s,...t)},Zc=function(a){return a[0].toUpperCase()+a.substring(1)},dt=function(a){return a.slice().sort()},Et=function(a,s){return String(s).padStart(a,"0")},_a=function(a,s){return Math.sign(a-s)},ki=function(a,s,t){return Math.min(Math.max(a,s),t)},Aa=function(a,s){return[Math.floor(a/s),at(a,s)]},at=function(a,s){return(a%s+s)%s},Ua=function(a,s){return[Ut(a,s),fo(a,s)]},Ut=function(a,s){return Math.trunc(a/s)||0},fo=function(a,s){return a%s||0},Ct=function(a){return Math.abs(a%1)===0.5},Xc=function(a,s,t){let i=0,o=0;for(let l=0;l<=s;l++){const d=a[t[l]],f=Ma[l],u=n/f,[p,m]=Ua(d,u);i+=m*f,o+=p}const[r,c]=Ua(i,n);return[o+r,c]},Qt=function(a,s,t){const i={};for(let o=s;o>=0;o--){const r=Ma[o];i[t[o]]=Ut(a,r),a=fo(a,r)}return i},kc=function(a){return a===S?Ri:[]},Vc=function(a){return a===S?Ot:[]},ec=function(a){return a===S?["year","day"]:[]},al=function(a){if(a!==void 0)return L(a)},sl=function(a){if(a!==void 0)return Da(a)},uo=function(a){if(a!==void 0)return ft(a)},Da=function(a){return ol(ft(a))},ft=function(a){return il(qp(a))},po=function(a){if(a==null)throw new TypeError("Cannot be null or undefined");return a},tl=function(a,s){if(s==null)throw new RangeError(Mr(a));return s},Ha=function(a){if(!G(a))throw new TypeError(jf);return a},Yt=function(a,s,t=a){if(typeof s!==a)throw new TypeError(Pt(t,s));return s},il=function(a,s="number"){if(!Number.isInteger(a))throw new RangeError(Pp(s,a));return a||0},ol=function(a,s="number"){if(a<=0)throw new RangeError(Tp(s,a));return a},mo=function(a){if(typeof a=="symbol")throw new TypeError(Dp);return String(a)},Ht=function(a,s){return G(a)?String(a):L(a,s)},Bt=function(a){if(typeof a=="string")return BigInt(a);if(typeof a!="bigint")throw new TypeError(yp(a));return a},rl=function(a,s="number"){if(typeof a=="bigint")throw new TypeError(Op(s));if(a=Number(a),!Number.isFinite(a))throw new RangeError(bp(s,a));return a},V=function(a,s){return Math.trunc(rl(a,s))||0},cl=function(a,s){return il(rl(a,s),s)},xc=function(a,s){return ol(V(a,s),s)},ho=function(a,s){let[t,i]=Ua(s,n),o=a+t;const r=Math.sign(o);return r&&r===-Math.sign(i)&&(o-=r,i+=r*n),[o,i]},js=function(a,s,t=1){return ho(a[0]+s[0]*t,a[1]+s[1]*t)},Cs=function(a,s){return ho(a[0],a[1]+s)},ma=function(a,s){return js(s,a,-1)},aa=function(a,s){return _a(a[0],s[0])||_a(a[1],s[1])},ll=function(a,s,t){return aa(a,s)===-1||aa(a,t)===1},Kt=function(a,s=1){const t=BigInt(n/s);return[Number(a/t),Number(a%t)*s]},Zs=function(a,s=1){const t=n/s,[i,o]=Ua(a,t);return[i,o*s]},dl=function(a,s=1){const[t,i]=a,o=Math.floor(i/s),r=n/s;return BigInt(t)*BigInt(r)+BigInt(o)},ha=function(a,s=1,t){const[i,o]=a,[r,c]=Ua(o,s);return i*(n/s)+(r+(t?c/s:0))},go=function(a,s,t=Aa){const[i,o]=a,[r,c]=t(o,s);return[i*(n/s)+r,c]},Po=function(a,s){const t=a.formatToParts(s),i={};for(let o of t)i[o.type]=o.value;return i},To=function(a){return ca(a,"isoYear",ct,rt,1),a.isoYear===ct?ca(a,"isoMonth",4,12,1):a.isoYear===rt&&ca(a,"isoMonth",1,9,1),a},Ga=function(a){return Wa({...a,...Oa,isoHour:12}),a},Wa=function(a){const s=ca(a,"isoYear",ct,rt,1),t=s===ct?1:s===rt?-1:0;return t&&ga(e({...a,isoDay:a.isoDay+t,isoNanosecond:a.isoNanosecond-t})),a},ga=function(a){if(!a||ll(a,kp,Xp))throw new RangeError(wi);return a},Qa=function(a){return Xc(a,5,na)[1]},Xt=function(a){const[s,t]=Aa(a,n);return[Qt(t,5,na),s]},fl=function(a){return ul(a)[0]},ul=function(a){return go(a,ba)},sa=function(a){return As(a.isoYear,a.isoMonth,a.isoDay,a.isoHour,a.isoMinute,a.isoSecond,a.isoMillisecond)},e=function(a){const s=sa(a);if(s!==void 0){const[t,i]=Ua(s,da);return[t,i*ja+(a.isoMicrosecond||0)*ys+(a.isoNanosecond||0)]}},bo=function(a,s){const[t,i]=Xt(Qa(a)-s);return ga(e({...a,isoDay:a.isoDay+i,...t}))},Wt=function(...a){return As(...a)/Jf},As=function(...a){const[s,t]=pl(...a),i=s.valueOf();if(!isNaN(i))return i-t*da},pl=function(a,s=1,t=1,i=0,o=0,r=0,c=0){const l=a===ct?1:a===rt?-1:0,d=new Date;return d.setUTCHours(i,o,r,c),d.setUTCFullYear(a,s-1,t+l),[d,l]},Ba=function(a,s){let[t,i]=Cs(a,s);i<0&&(i+=n,t-=1);const[o,r]=Aa(i,ja),[c,l]=Aa(r,ys);return kt(t*da+o,c,l)},kt=function(a,s=0,t=0){const i=Math.ceil(Math.max(0,Math.abs(a)-Kp)/da)*Math.sign(a),o=new Date(a-i*da);return Is(ji,[o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate()+i,o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds(),s,t])},ml=function(a){return[a.isoYear,a.isoMonth,a.isoDay]},hl=function(){return Ia},Oo=function(a,s){switch(s){case 2:return yo(a)?29:28;case 4:case 6:case 9:case 11:return 30}return 31},gl=function(a){return yo(a)?366:365},yo=function(a){return a%4==0&&(a%100!=0||a%400==0)},Pl=function(a){const[s,t]=pl(a.isoYear,a.isoMonth,a.isoDay);return at(s.getUTCDay()-t,7)||7},Tl=function({isoYear:a}){return a<1?["bce",1-a]:["ce",a]},ap=function(a){const s=sa(a);if(s<ep)return Tl(a);const t=Po(Ur(xs),s),{era:i,eraYear:o}=Md(t,xs);return[i,o]},Vt=function(a){return ps(a),et(a,1),a},ps=function(a){return bl(a,1),a},Lc=function(a){return Bc(Wr,a,bl(a))},bl=function(a,s){const{isoYear:t}=a,i=ca(a,"isoMonth",1,hl(),s);return{isoYear:t,isoMonth:i,isoDay:ca(a,"isoDay",1,Oo(t,i),s)}},et=function(a,s){return Is(na,[ca(a,"isoHour",0,23,s),ca(a,"isoMinute",0,59,s),ca(a,"isoSecond",0,59,s),ca(a,"isoMillisecond",0,999,s),ca(a,"isoMicrosecond",0,999,s),ca(a,"isoNanosecond",0,999,s)])},w=function(a){return a===void 0?0:iu(Ha(a))},ut=function(a,s=0){a=Sa(a);const t=ou(a),i=fm(a,s);return[iu(a),i,t]},Do=function(a){return ou(Sa(a))},Ol=function(a){return a=Sa(a),Jr(a,9,6,1)},Es=function(a,s,t,i=9,o=0,r=4){s=Sa(s);let c=Jr(s,i,o),l=vo(s),d=Dt(s,r);const f=yt(s,i,o,1);return c==null?c=Math.max(t,f):wl(c,f),l=no(l,f,1),a&&(d=((u)=>u<4?(u+2)%4:u)(d)),[c,f,l,d]},ai=function(a,s=6,t){let i=vo(a=Fo(a,Gt));const o=Dt(a,7);let r=yt(a,s);return r=tl(Gt,r),i=no(i,r,void 0,t),[r,i,o]},So=function(a){return zr(Sa(a))},yl=function(a,s){return wo(Sa(a),s)},wo=function(a,s=4){const t=Sl(a);return[Dt(a,4),...Dl(yt(a,s),t)]},Dl=function(a,s){return a!=null?[Ma[a],a<4?9-3*a:-1]:[s===void 0?1:10**(9-s),s]},vo=function(a){const s=a[st];return s===void 0?1:V(s,st)},no=function(a,s,t,i){const o=i?n:Ma[s+1];if(o){const r=Ma[s];if(o%((a=Pa(st,a,1,o/r-(i?0:1),1))*r))throw new RangeError(Pt(st,a))}else a=Pa(st,a,1,t?1e9:1,1);return a},Sl=function(a){let s=a[Xi];if(s!==void 0){if(typeof s!="number"){if(mo(s)==="auto")return;throw new RangeError(Pt(Xi,s))}s=Pa(Xi,Math.floor(s),0,9,1)}return s},Sa=function(a){return a===void 0?{}:Ha(a)},Fo=function(a,s){return typeof a=="string"?{[s]:a}:Ha(a)},H=function(a){if(a!==void 0){if(G(a))return Object.assign(Object.create(null),a);throw new TypeError(jf)}},si=function(a,s){return a&&Object.assign(Object.create(null),a,{overflow:sm[s]})},Ro=function(a,s,t=9,i=0,o){let r=s[a];if(r===void 0)return o?i:void 0;if(r=mo(r),r==="auto")return o?i:null;let c=so[r];if(c===void 0&&(c=Yp[r]),c===void 0)throw new RangeError(Lf(a,r,so));return Pa(a,c,i,t,1,bt),c},ms=function(a,s,t,i=0){const o=t[a];if(o===void 0)return i;const r=mo(o),c=s[r];if(c===void 0)throw new RangeError(Lf(a,r,s));return c},wl=function(a,s){if(s>a)throw new RangeError($p)},q=function(a){return{branding:Zi,epochNanoseconds:a}},B=function(a,s,t){return{branding:za,calendar:t,timeZone:s,epochNanoseconds:a}},W=function(a,s=a.calendar){return{branding:Ss,calendar:s,...pa(ef,a)}},N=function(a,s=a.calendar){return{branding:Ds,calendar:s,...pa(Nr,a)}},ds=function(a,s=a.calendar){return{branding:Gs,calendar:s,...pa(Nr,a)}},Nt=function(a,s=a.calendar){return{branding:qs,calendar:s,...pa(Nr,a)}},wa=function(a){return{branding:Ci,...pa(Vf,a)}},C=function(a){return{branding:xi,sign:Ka(a),...pa(Ar,a)}},vl=function(a){return fl(a.epochNanoseconds)},ti=function(a){return go(a.epochNanoseconds,ja)[0]},nl=function(a){return dl(a.epochNanoseconds,ys)},Fl=function(a){return dl(a.epochNanoseconds)},Rl=function(a){return a.epochNanoseconds},Q=function(a){return typeof a=="string"?a:L(a.id)},Hs=function(a,s){return a===s||Q(a)===Q(s)},Ml=function(a,s,t,i,o){const r=fs(i),[c,l]=((T,O)=>{const b=O((T=Fo(T,oo))[su]);let y=dm(T);return y=tl(oo,y),[y,b]})(o,a);if(it(Math.max(c,r),l))return Ic(i,c);if(!l)throw new RangeError(vi);const[d,f,u]=di(s,t,l),p=Xo(u),m=fi(u),h=ko(u),g=m(f,d,i),P=h(f,d,g,c);return it(c,l)?Ic(P,c):((T,O,b,y,E,Z,j)=>{const x=Ka(T),[U,z]=Mo(y,Hr(b,T),b,x,E,Z,j),ks=jo(O,U,z);return T[v[b]]+ks*x})(P,p(g),c,f,d,p,m)},Ic=function(a,s){return ha(_(a),Ma[s],1)},Mo=function(a,s,t,i,o,r,c){const l=v[t],d={...s,[l]:s[l]+i},f=c(a,o,s),u=c(a,o,d);return[r(f),r(u)]},jo=function(a,s,t){const i=ha(ma(s,t));if(!i)throw new RangeError(Tt);return ha(ma(s,a))/i},jl=function(a,s){const[t,i,o]=ai(s,5,1);return q(oi(a.epochNanoseconds,t,i,o,1))},Cl=function(a,s,t){let{epochNanoseconds:i,timeZone:o,calendar:r}=s;const[c,l,d]=ai(t);if(c===0&&l===1)return s;const f=a(o);if(c===6)i=((u,p,m,h)=>{const g=ta(m,p),[P,T]=u(g),O=m.epochNanoseconds,b=ua(p,P),y=ua(p,T);if(ll(O,b,y))throw new RangeError(Tt);return Nl(jo(O,b,y),h)?y:b})(Hl,f,s,d);else{const u=f.getOffsetNanosecondsFor(i);i=gs(f,Al(Ba(i,u),c,l,d),u,2,0,1)}return B(i,o,r)},Zl=function(a,s){return W(Al(a,...ai(s)),a.calendar)},xl=function(a,s){const[t,i,o]=ai(s,5);var r;return wa((r=o,Co(a,pt(t,i),r)[0]))},Ll=function(a,s){const t=a(s.timeZone),i=ta(s,t),[o,r]=Hl(i),c=ha(ma(ua(t,o),ua(t,r)),Fi,1);if(c<=0)throw new RangeError(Tt);return c},Il=function(a,s){const{timeZone:t,calendar:i}=s,o=((r,c,l)=>ua(c,r(ta(l,c))))(Wl,a(t),s);return B(o,t,i)},Al=function(a,s,t,i){return El(a,pt(s,t),i)},El=function(a,s,t){const[i,o]=Co(a,s,t);return Wa({...Ps(a,o),...i})},Co=function(a,s,t){return Xt(Ya(Qa(a),s,t))},$t=function(a){return Ya(a,ni,7)},pt=function(a,s){return Ma[a]*s},Hl=function(a){const s=Wl(a);return[s,Ps(s,1)]},Wl=function(a){return Bp(6,a)},sp=function(a,s,t){const i=Math.min(fs(a),6);return Ns(ri(_(a,i),s,t),i)},ii=function(a,s,t,i,o,r,c,l,d,f){if(i===0&&o===1)return a;const u=it(i,l)?ui(l)&&i<6&&t>=6?ip:tp:op;let[p,m,h]=u(a,s,t,i,o,r,c,l,d,f);return h&&i!==7&&(p=((g,P,T,O,b,y,E,Z)=>{const j=Ka(g);for(let x=O+1;x<=T;x++){if(x===7&&T!==7)continue;const U=Hr(x,g);U[v[x]]+=j;const z=ha(ma(E(Z(b,y,U)),P));if(z&&Math.sign(z)!==j)break;g=U}return g})(p,m,t,Math.max(6,i),c,l,d,f)),p},oi=function(a,s,t,i,o){if(s===6){const r=((c)=>c[0]+c[1]/n)(a);return[Ya(r,t,i),0]}return ri(a,pt(s,t),i,o)},ri=function(a,s,t,i){let[o,r]=a;i&&r<0&&(r+=n,o-=1);const[c,l]=Aa(Ya(r,s,t),n);return ho(o+c,l)},Ya=function(a,s,t){return Nl(a/s,t)*s},Nl=function(a,s){return mm[s](a)},tp=function(a,s,t,i,o,r){const c=Ka(a),l=_(a),d=oi(l,i,o,r),f=ma(l,d),u=Math.sign(d[0]-l[0])===c,p=Ns(d,Math.min(t,6));return[{...a,...p},js(s,f),u]},ip=function(a,s,t,i,o,r,c,l,d,f){const u=Ka(a),p=ha(_(a,5)),m=pt(i,o);let h=Ya(p,m,r);const[g,P]=Mo(c,{...a,...Er},6,u,l,d,f),T=h-ha(ma(g,P));let O=0;T&&Math.sign(T)!==u?s=Cs(g,h):(O+=u,h=Ya(T,m,r),s=Cs(P,h));const b=mi(h);return[{...a,...b,days:a.days+O},s,Boolean(O)]},op=function(a,s,t,i,o,r,c,l,d,f){const u=Ka(a),p=v[i],m=Hr(i,a);i===7&&(a={...a,weeks:a.weeks+Math.trunc(a.days/7)});const h=Ut(a[p],o)*o;m[p]=h;const[g,P]=Mo(c,m,i,o*u,l,d,f),T=h+jo(s,g,P)*u*o,O=Ya(T,o,r),b=Math.sign(O-T)===u;return m[p]=O,[m,b?P:g,b]},Zo=function(a,s,t,i){const[o,r,c,l]=((f)=>{const u=wo(f=Sa(f));return[f.timeZone,...u]})(i),d=o!==void 0;return((f,u,p,m,h,g)=>{p=ri(p,h,m,1);const P=u.getOffsetNanosecondsFor(p);return Wo(Ba(p,P),g)+(f?hs($t(P)):"Z")})(d,s(d?a(o):ws),t.epochNanoseconds,r,c,l)},xo=function(a,s,t){const[i,o,r,c,l,d]=((f)=>{f=Sa(f);const u=zr(f),p=Sl(f),m=pm(f),h=Dt(f,4),g=yt(f,4);return[u,um(f),m,h,...Dl(g,p)]})(t);return((f,u,p,m,h,g,P,T,O,b)=>{m=ri(m,O,T,1);const y=f(p).getOffsetNanosecondsFor(m);return Wo(Ba(m,y),b)+hs($t(y),P)+((E,Z)=>Z!==1?"["+(Z===2?"!":"")+Q(E)+"]":"")(p,g)+No(u,h)})(a,s.calendar,s.timeZone,s.epochNanoseconds,i,o,r,c,l,d)},Lo=function(a,s){const[t,i,o,r]=((f)=>(f=Sa(f),[zr(f),...wo(f)]))(s);return c=a.calendar,l=t,d=r,Wo(El(a,o,i),d)+No(c,l);var c,l,d},Io=function(a,s){return t=a.calendar,i=a,o=So(s),Jt(i)+No(t,o);var t,i,o},Ao=function(a,s){return $l(a.calendar,Jl,a,So(s))},Eo=function(a,s){return $l(a.calendar,rp,a,So(s))},Ho=function(a,s){const[t,i,o]=yl(s);return r=o,zl(Co(a,i,t)[0],r);var r},ci=function(a,s){const[t,i,o]=yl(s,3);return i>1&&(a={...a,...sp(a,i,t)}),((r,c)=>{const{sign:l}=r,d=l===-1?ia(r):r,{hours:f,minutes:u}=d,[p,m]=go(_(d,3),ba,Ua);Kl(p);const h=$o(m,c),g=c>=0||!l||h;return(l<0?"-":"")+"P"+Ac({Y:ls(d.years),M:ls(d.months),W:ls(d.weeks),D:ls(d.days)})+(f||u||p||g?"T"+Ac({H:ls(f),M:ls(u),S:ls(p,g)+h}):"")})(a,o)},$l=function(a,s,t,i){const o=Q(a),r=i>1||i===0&&o!==S;return i===1?o===S?s(t):Jt(t):r?Jt(t)+_l(o,i===2):s(t)},Ac=function(a){const s=[];for(let t in a){const i=a[t];i&&s.push(i,t)}return s.join("")},Wo=function(a,s){return Jt(a)+"T"+zl(a,s)},Jt=function(a){return Jl(a)+"-"+Ta(a.isoDay)},Jl=function(a){const{isoYear:s}=a;return(s<0||s>9999?Gl(s)+Et(6,Math.abs(s)):Et(4,s))+"-"+Ta(a.isoMonth)},rp=function(a){return Ta(a.isoMonth)+"-"+Ta(a.isoDay)},zl=function(a,s){const t=[Ta(a.isoHour),Ta(a.isoMinute)];return s!==-1&&t.push(Ta(a.isoSecond)+((i,o,r,c)=>$o(i*ja+o*ys+r,c))(a.isoMillisecond,a.isoMicrosecond,a.isoNanosecond,s)),t.join(":")},hs=function(a,s=0){if(s===1)return"";const[t,i]=Aa(Math.abs(a),Fi),[o,r]=Aa(i,ni),[c,l]=Aa(r,ba);return Gl(a)+Ta(t)+":"+Ta(o)+(c||l?":"+Ta(c)+$o(l):"")},No=function(a,s){if(s!==1){const t=Q(a);if(s>1||s===0&&t!==S)return _l(t,s===2)}return""},_l=function(a,s){return"["+(s?"!":"")+"u-ca="+a+"]"},$o=function(a,s){let t=Et(9,a);return t=s===void 0?t.replace(Pm,""):t.slice(0,s),t?"."+t:""},Gl=function(a){return a<0?"-":"+"},ls=function(a,s){return a||s?a.toLocaleString("fullwide",{useGrouping:0}):""},cp=function(a,s){const{epochNanoseconds:t}=a,i=(s.getOffsetNanosecondsFor?s:s(a.timeZone)).getOffsetNanosecondsFor(t),o=Ba(t,i);return{calendar:a.calendar,...o,offsetNanoseconds:i}},ql=function(a,s){const t=ta(s,a);return{calendar:s.calendar,...pa(ef,t),offset:hs(t.offsetNanoseconds),timeZone:s.timeZone}},gs=function(a,s,t,i=0,o=0,r,c){if(t!==void 0&&i===1&&(i===1||c))return bo(s,t);const l=a.getPossibleInstantsFor(s);if(t!==void 0&&i!==3){const d=((f,u,p,m)=>{const h=e(u);m&&(p=$t(p));for(let g of f){let P=ha(ma(g,h));if(m&&(P=$t(P)),P===p)return g}})(l,s,t,r);if(d!==void 0)return d;if(i===0)throw new RangeError(Ip)}return c?e(s):ua(a,s,o,l)},ua=function(a,s,t=0,i=a.getPossibleInstantsFor(s)){if(i.length===1)return i[0];if(t===1)throw new RangeError(Ap);if(i.length)return i[t===3?1:0];const o=e(s),r=((l,d)=>{const f=l.getOffsetNanosecondsFor(Cs(d,-n));return zo(l.getOffsetNanosecondsFor(Cs(d,n))-f)})(a,o),c=r*(t===2?-1:1);return(i=a.getPossibleInstantsFor(Ba(o,c)))[t===2?0:i.length-1]},Jo=function(a){if(Math.abs(a)>=n)throw new RangeError(xp);return a},zo=function(a){if(a>n)throw new RangeError(Lp);return a},_o=function(a,s,t){return q(ga(js(s.epochNanoseconds,((i)=>{if(Xl(i))throw new RangeError(Wp);return _(i,5)})(a?ia(t):t))))},Go=function(a,s,t,i,o,r=Object.create(null)){const c=s(i.timeZone),l=a(i.calendar);return{...i,...Bo(c,l,i,t?ia(o):o,r)}},qo=function(a,s,t,i,o=Object.create(null)){const{calendar:r}=t;return W(Ko(a(r),t,s?ia(i):i,o),r)},Uo=function(a,s,t,i,o){const{calendar:r}=t;return N(li(a(r),t,s?ia(i):i,o),r)},Qo=function(a,s,t,i,o=Object.create(null)){const r=t.calendar,c=a(r);let l=tt(c,t);s&&(i=pi(i)),i.sign<0&&(l=c.dateAdd(l,{...Y,months:1}),l=Ps(l,-1));const d=c.dateAdd(l,i,o);return ds(tt(c,d),r)},Yo=function(a,s,t){return wa(Ul(s,a?ia(t):t)[0])},Bo=function(a,s,t,i,o){const r=_(i,5);let c=t.epochNanoseconds;if(Xl(i)){const l=ta(t,a);c=js(ua(a,{...li(s,l,{...i,...Er},o),...pa(na,l)}),r)}else c=js(c,r),w(o);return{epochNanoseconds:ga(c)}},Ko=function(a,s,t,i){const[o,r]=Ul(s,t);return Wa({...li(a,s,{...t,...Er,days:t.days+r},i),...o})},li=function(a,s,t,i){if(t.years||t.months||t.weeks)return a.dateAdd(s,t,i);w(i);const o=t.days+_(t,5)[0];return o?Ga(Ps(s,o)):s},tt=function(a,s,t=1){return Ps(s,t-a.day(s))},Ul=function(a,s){const[t,i]=_(s,5),[o,r]=Xt(Qa(a)+i);return[o,t+r]},Ps=function(a,s){return s?{...a,...kt(sa(a)+s*da)}:a},di=function(a,s,t){const i=a(t.calendar);return ui(t)?[t,i,s(t.timeZone)]:[{...t,...Oa},i]},Xo=function(a){return a?Rl:e},fi=function(a){return a?D(Bo,a):Ko},ko=function(a){return a?D(dp,a):fp},ui=function(a){return a&&a.epochNanoseconds},it=function(a,s){return a<=6-(ui(s)?1:0)},Vo=function(a,s,t,i,o,r,c){const l=a(Sa(c).relativeTo),d=Math.max(fs(o),fs(r));if(it(d,l))return C(Ws(((P,T,O,b)=>{const y=js(_(P),_(T),b?-1:1);if(!Number.isFinite(y[0]))throw new RangeError(wi);return{...Y,...Ns(y,O)}})(o,r,d,i)));if(!l)throw new RangeError(vi);i&&(r=ia(r));const[f,u,p]=di(s,t,l),m=fi(p),h=ko(p),g=m(u,f,o);return C(h(u,f,m(u,g,r),d))},Ql=function(a,s,t,i,o){const r=fs(i),[c,l,d,f,u]=((j,x,U)=>{j=Fo(j,Gt);let z=Jr(j);const ks=U(j[su]);let Vs=vo(j);const Vu=Dt(j,7);let cs=yt(j);if(z===void 0&&cs===void 0)throw new RangeError(Np);return cs==null&&(cs=0),z==null&&(z=Math.max(cs,x)),wl(z,cs),Vs=no(Vs,cs,1),[z,cs,Vs,Vu,ks]})(o,r,a),p=Math.max(r,c);if(!ui(u)&&p<=6)return C(Ws(((j,x,U,z,ks)=>{const Vs=oi(_(j),U,z,ks);return{...Y,...Ns(Vs,x)}})(i,c,l,d,f)));if(!u)throw new RangeError(vi);const[m,h,g]=di(s,t,u),P=Xo(g),T=fi(g),O=ko(g),b=T(h,m,i);let y=O(h,m,b,c);const E=i.sign,Z=Ka(y);if(E&&Z&&E!==Z)throw new RangeError(Tt);return Z&&(y=ii(y,P(b),c,l,d,f,h,m,P,T)),C(y)},Yl=function(a){return a.sign===-1?pi(a):a},pi=function(a){return C(ia(a))},ia=function(a){const s={};for(let t of v)s[t]=-1*a[t]||0;return s},Bl=function(a){return!a.sign},Ka=function(a,s=v){let t=0;for(let i of s){const o=Math.sign(a[i]);if(o){if(t&&t!==o)throw new RangeError(Hp);t=o}}return t},Ws=function(a){for(let s of Qp)Pa(s,a[s],-zc,zc,1);return Kl(ha(_(a),ba)),a},Kl=function(a){if(!Number.isSafeInteger(a))throw new RangeError(Ep)},_=function(a,s=6){return Xc(a,s,v)},Ns=function(a,s=6){const[t,i]=a,o=Qt(i,s,v);if(o[v[s]]+=t*(n/Ma[s]),!Number.isFinite(o[v[s]]))throw new RangeError(wi);return o},mi=function(a,s=5){return Qt(a,s,v)},Xl=function(a){return Boolean(Ka(a,kf))},fs=function(a){let s=9;for(;s>0&&!a[v[s]];s--);return s},lp=function(a,s){return[a,s]},Ec=function(a){const s=Math.floor(a/It)*It;return[s,s+It]},kl=function(a){const s=Xa(a=Ht(a));if(!s)throw new RangeError(la(a));let t;if(s.m)t=0;else{if(!s.offset)throw new RangeError(la(a));t=$s(s.offset)}return s.timeZone&&tr(s.timeZone,1),q(bo(Vt(s),t))},Vl=function(a){const s=Xa(L(a));if(!s)throw new RangeError(la(a));if(s.timeZone)return ld(s,s.offset?$s(s.offset):void 0);if(s.m)throw new RangeError(la(a));return fd(s)},el=function(a,s){const t=Xa(L(a));if(!t||!t.timeZone)throw new RangeError(la(a));const{offset:i}=t,o=i?$s(i):void 0,[,r,c]=ut(s);return ld(t,o,r,c)},$s=function(a){const s=tr(a);if(s===void 0)throw new RangeError(la(a));return s},ad=function(a){const s=Xa(L(a));if(!s||s.m)throw new RangeError(la(a));return W(dd(s))},hi=function(a){const s=Xa(L(a));if(!s||s.m)throw new RangeError(la(a));return N(s.p?dd(s):fd(s))},sd=function(a,s){const t=ar(L(s));if(t)return eo(t),ds(To(ps(t)));const i=hi(s);return ds(tt(a(i.calendar),i))},eo=function(a){if(a.calendar!==S)throw new RangeError(Ea(a.calendar))},td=function(a,s){const t=sr(L(s));if(t)return eo(t),Nt(ps(t));const i=hi(s),{calendar:o}=i,r=a(o),[c,l,d]=r.h(i),[f,u]=r.I(c,l),[p,m]=r.N(f,u,d);return Nt(Ga(r.P(p,m,d)),o)},id=function(a){let s,t=((i)=>{const o=Dm.exec(i);return o?(gi(o[10]),md(o)):void 0})(L(a));if(!t){if(t=Xa(a),!t)throw new RangeError(la(a));if(!t.p)throw new RangeError(la(a));if(t.m)throw new RangeError(Ea("Z"));eo(t)}if((s=ar(a))&&Lc(s))throw new RangeError(la(a));if((s=sr(a))&&Lc(s))throw new RangeError(la(a));return wa(et(t,1))},od=function(a){const s=((t)=>{const i=vm.exec(t);return i?((o)=>{function r(u,p,m){let h=0,g=0;if(m&&([h,d]=Aa(d,Ma[m])),u!==void 0){if(l)throw new RangeError(Ea(u));g=((P)=>{const T=parseInt(P);if(!Number.isFinite(T))throw new RangeError(Ea(P));return T})(u),c=1,p&&(d=ir(p)*(Ma[m]/ba),l=1)}return h+g}let c=0,l=0,d=0,f={...Is(v,[r(o[2]),r(o[3]),r(o[4]),r(o[5]),r(o[6],o[7],5),r(o[8],o[9],4),r(o[10],o[11],3)]),...Qt(d,2,v)};if(!c)throw new RangeError(Zf(v));return or(o[1])<0&&(f=ia(f)),f})(i):void 0})(L(a));if(!s)throw new RangeError(la(a));return C(Ws(s))},rd=function(a){const s=Xa(a)||ar(a)||sr(a);return s?s.calendar:a},cd=function(a){const s=Xa(a);return s&&(s.timeZone||s.m&&ws||s.offset)||a},ld=function(a,s,t=0,i=0){const o=Pi(a.timeZone),r=Li(o);return B(gs(r,Vt(a),s,t,i,!r.v,a.m),o,mt(a.calendar))},dd=function(a){return ud(Wa(Vt(a)))},fd=function(a){return ud(Ga(ps(a)))},ud=function(a){return{...a,calendar:mt(a.calendar)}},Xa=function(a){const s=ym.exec(a);return s?((t)=>{const i=t[10],o=(i||"").toUpperCase()==="Z";return{isoYear:pd(t),isoMonth:parseInt(t[4]),isoDay:parseInt(t[5]),...md(t.slice(5)),...gi(t[16]),p:Boolean(t[6]),m:o,offset:o?void 0:i}})(s):void 0},ar=function(a){const s=bm.exec(a);return s?((t)=>({isoYear:pd(t),isoMonth:parseInt(t[4]),isoDay:1,...gi(t[5])}))(s):void 0},sr=function(a){const s=Om.exec(a);return s?((t)=>({isoYear:Ls,isoMonth:parseInt(t[1]),isoDay:parseInt(t[2]),...gi(t[3])}))(s):void 0},tr=function(a,s){const t=Sm.exec(a);return t?((i,o)=>{const r=i[4]||i[5];if(o&&r)throw new RangeError(Ea(r));return Jo((Ms(i[2])*Fi+Ms(i[3])*ni+Ms(i[4])*ba+ir(i[5]||""))*or(i[1]))})(t,s):void 0},pd=function(a){const s=or(a[1]),t=parseInt(a[2]||a[3]);if(s<0&&!t)throw new RangeError(Ea(-0));return s*t},md=function(a){const s=Ms(a[3]);return{...Xt(ir(a[4]||""))[0],isoHour:Ms(a[1]),isoMinute:Ms(a[2]),isoSecond:s===60?59:s}},gi=function(a){let s,t;const i=[];if(a.replace(wm,(o,r,c)=>{const l=Boolean(r),[d,f]=c.split("=").reverse();if(f){if(f==="u-ca")i.push(d),s||(s=l);else if(l||/[A-Z]/.test(f))throw new RangeError(Ea(o))}else{if(t)throw new RangeError(Ea(o));t=d}return""}),i.length>1&&s)throw new RangeError(Ea(a));return{timeZone:t,calendar:i[0]||S}},ir=function(a){return parseInt(a.padEnd(9,"0"))},Js=function(a){return new RegExp(`^${a}\$`,"i")},or=function(a){return a&&a!=="+"?-1:1},Ms=function(a){return a===void 0?0:parseInt(a)},hd=function(a){return Pi(L(a))},Pi=function(a){const s=rr(a);return typeof s=="number"?hs(s):s?((t)=>{if(Fm.test(t))throw new RangeError(Zp);return t.toLowerCase().split("/").map((i,o)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(r,c)=>r.length<=2&&!o||r==="in"||r==="chat"?r.toUpperCase():r.length>2||!c?Zc(r).replace(/island|noronha|murdo|rivadavia|urville/,Zc):r)).join("/")})(a):ws},Hc=function(a){const s=rr(a);return typeof s=="number"?s:s?s.resolvedOptions().timeZone:ws},rr=function(a){const s=tr(a=a.toUpperCase(),1);return s!==void 0?s:a!==ws?nm(a):void 0},cr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},lr=function(a,s){return aa(a.epochNanoseconds,s.epochNanoseconds)},gd=function(a,s,t,i,o,r){const c=a(Sa(r).relativeTo),l=Math.max(fs(i),fs(o));if(Bc(v,i,o))return 0;if(it(l,c))return aa(_(i),_(o));if(!c)throw new RangeError(vi);const[d,f,u]=di(s,t,c),p=Xo(u),m=fi(u);return aa(p(m(f,d,i)),p(m(f,d,o)))},dr=function(a,s){return Ts(a,s)||Ti(a,s)},Ts=function(a,s){return _a(sa(a),sa(s))},Ti=function(a,s){return _a(Qa(a),Qa(s))},Pd=function(a,s){return!cr(a,s)},Td=function(a,s){return!lr(a,s)&&!!bi(a.timeZone,s.timeZone)&&Hs(a.calendar,s.calendar)},bd=function(a,s){return!dr(a,s)&&Hs(a.calendar,s.calendar)},Od=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},yd=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},Dd=function(a,s){return!Ts(a,s)&&Hs(a.calendar,s.calendar)},Sd=function(a,s){return!Ti(a,s)},bi=function(a,s){if(a===s)return 1;const t=Q(a),i=Q(s);if(t===i)return 1;try{return Hc(t)===Hc(i)}catch(o){}},fr=function(a,s,t,i){const o=Es(a,H(i),3,5),r=Oi(s.epochNanoseconds,t.epochNanoseconds,...o);return C(a?ia(r):r)},ur=function(a,s,t,i,o,r){const c=Di(i.calendar,o.calendar),l=H(r),[d,f,u,p]=Es(t,l,5),m=i.epochNanoseconds,h=o.epochNanoseconds,g=aa(h,m);let P;if(g)if(d<6)P=Oi(m,h,d,f,u,p);else{const T=s(((b,y)=>{if(!bi(b,y))throw new RangeError(Hf);return b})(i.timeZone,o.timeZone)),O=a(c);P=vd(O,T,i,o,g,d,l),P=ii(P,h,d,f,u,p,O,i,Rl,D(Bo,T))}else P=Y;return C(t?ia(P):P)},pr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o),[l,d,f,u]=Es(s,c,6),p=e(t),m=e(i),h=aa(m,p);let g;if(h)if(l<=6)g=Oi(p,m,l,d,f,u);else{const P=a(r);g=nd(P,t,i,h,l,c),g=ii(g,m,l,d,f,u,P,t,e,Ko)}else g=Y;return C(s?ia(g):g)},mr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o);return wd(s,()=>a(r),t,i,...Es(s,c,6,9,6),c)},hr=function(a,s,t,i,o){const r=Di(t.calendar,i.calendar),c=H(o),l=Es(s,c,9,9,8),d=a(r);return wd(s,()=>d,tt(d,t),tt(d,i),...l,c)},wd=function(a,s,t,i,o,r,c,l,d){const f=e(t),u=e(i);let p;if(aa(u,f))if(o===6)p=Oi(f,u,o,r,c,l);else{const m=s();p=m.dateUntil(t,i,o,d),r===6&&c===1||(p=ii(p,u,o,r,c,l,m,t,e,li))}else p=Y;return C(a?ia(p):p)},gr=function(a,s,t,i){const o=H(i),[r,c,l,d]=Es(a,o,5,5),f=Ya(Pr(s,t),pt(c,l),d),u={...Y,...mi(f,r)};return C(a?ia(u):u)},dp=function(a,s,t,i,o,r){const c=aa(i.epochNanoseconds,t.epochNanoseconds);return c?o<6?Fd(t.epochNanoseconds,i.epochNanoseconds,o):vd(s,a,t,i,c,o,r):Y},fp=function(a,s,t,i,o){const r=e(s),c=e(t),l=aa(c,r);return l?i<=6?Fd(r,c,i):nd(a,s,t,l,i,o):Y},vd=function(a,s,t,i,o,r,c){const[l,d,f]=((m,h,g,P)=>{function T(){return x={...Ps(y,Z++*-P),...b},U=ua(m,x),aa(E,U)===-P}const O=ta(h,m),b=pa(na,O),y=ta(g,m),E=g.epochNanoseconds;let Z=0;const j=Pr(O,y);let x,U;if(Math.sign(j)===-P&&Z++,T()&&(P===-1||T()))throw new RangeError(Tt);const z=ha(ma(U,E));return[O,x,z]})(s,t,i,o);var u,p;return{...r===6?(u=l,p=d,{...Y,days:Rd(u,p)}):a.dateUntil(l,d,r,c),...mi(f)}},nd=function(a,s,t,i,o,r){const[c,l,d]=((f,u,p)=>{let m=u,h=Pr(f,u);return Math.sign(h)===-p&&(m=Ps(u,-p),h+=n*p),[f,m,h]})(s,t,i);return{...a.dateUntil(c,l,o,r),...mi(d)}},Oi=function(a,s,t,i,o,r){return{...Y,...Ns(oi(ma(a,s),i,o,r),t)}},Fd=function(a,s,t){return{...Y,...Ns(ma(a,s),t)}},Rd=function(a,s){return yi(sa(a),sa(s))},yi=function(a,s){return Math.trunc((s-a)/da)},Pr=function(a,s){return Qa(s)-Qa(a)},Di=function(a,s){if(!Hs(a,s))throw new RangeError(Zr);return a},up=function(a){function s(o){return((r,c)=>({...Md(r,c),F:r.month,day:parseInt(r.day)}))(Po(t,o),i)}const t=Ur(a),i=zt(a);return{id:a,O:pp(s),B:mp(s)}},pp=function(a){return fa((s)=>{const t=sa(s);return a(t)},WeakMap)},mp=function(a){const s=a(0).year-Vp;return fa((t)=>{let i,o=As(t-s);const r=[],c=[];do o+=400*da;while((i=a(o)).year<=t);do o+=(1-i.day)*da,i.year===t&&(r.push(o),c.push(i.F)),o-=da;while((i=a(o)).year>=t);return{k:r.reverse(),C:$f(c.reverse())}})},Md=function(a,s){let t,i,o=jd(a);if(a.era){const r=Bf[s];r!==void 0&&(t=s==="islamic"?"ah":a.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),t==="bc"||t==="b"?t="bce":t!=="ad"&&t!=="a"||(t="ce"),i=o,o=Id(i,r[t]||0))}return{era:t,eraYear:i,year:o}},jd=function(a){return parseInt(a.relatedYear||a.year)},Vi=function(a){const{year:s,F:t,day:i}=this.O(a),{C:o}=this.B(s);return[s,o[t]+1,i]},ot=function(a,s=1,t=1){return this.B(a).k[s-1]+(t-1)*da},Zt=function(a){const s=Nc(this,a),t=Nc(this,a-1),i=s.length;if(i>t.length){const o=Ad(this);if(o<0)return-o;for(let r=0;r<i;r++)if(s[r]!==t[r])return r+1}},xt=function(a){return yi(ot.call(this,a),ot.call(this,a+1))},Wc=function(a,s){const{k:t}=this.B(a);let i=s+1,o=t;return i>t.length&&(i=1,o=this.B(a+1).k),yi(t[s-1],o[i-1])},Lt=function(a){return this.B(a).k.length},Nc=function(a,s){return Object.keys(a.B(s).C)},Cd=function(a){return mt(L(a))},mt=function(a){if((a=a.toLowerCase())!==S&&a!==Mi&&zt(a)!==zt(Ur(a).resolvedOptions().calendar))throw new RangeError(Cp(a));return a},zt=function(a){return a==="islamicc"&&(a="islamic"),a.split("-")[0]},Zd=function(a){return this.R(a)[0]},xd=function(a){return this.R(a)[1]},Tr=function(a){const[s]=this.h(a);return yi(this.q(s),sa(a))+1},Ld=function(a){const s=Mm.exec(a);if(!s)throw new RangeError(Mp(a));return[parseInt(s[1]),Boolean(s[2])]},_t=function(a,s,t){return a+(s||t&&a>=t?1:0)},ei=function(a,s){return a-(s&&a>=s?1:0)},Id=function(a,s){return(s+a)*(Math.sign(s)||1)||0},ao=function(a){return Bf[Ed(a)]},Ad=function(a){return Gp[Ed(a)]},Ed=function(a){return zt(a.id||S)},Hd=function(a,s,t,i){const o=ka(t,i,va,[],qf);if(o.timeZone!==void 0){const r=t.dateFromFields(o),c=bs(o),l=a(o.timeZone);return{epochNanoseconds:gs(s(l),{...r,...c},o.offset!==void 0?$s(o.offset):void 0),timeZone:l}}return{...t.dateFromFields(o),...Oa}},Wd=function(a,s,t,i,o,r){const c=ka(t,o,va,_f,qf),l=a(c.timeZone),[d,f,u]=ut(r),p=t.dateFromFields(c,si(r,d)),m=bs(c,d);return B(gs(s(l),{...p,...m},c.offset!==void 0?$s(c.offset):void 0,f,u),l,i)},Nd=function(a,s,t){const i=ka(a,s,va,[],Ja),o=w(t);return W(Wa({...a.dateFromFields(i,si(t,o)),...bs(i,o)}))},br=function(a,s,t,i=[]){const o=ka(a,s,va,i);return a.dateFromFields(o,t)},Or=function(a,s,t,i){const o=ka(a,s,Ir,i);return a.yearMonthFromFields(o,t)},yr=function(a,s,t,i,o=[]){const r=ka(a,t,va,o);return s&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=Ls),a.monthDayFromFields(r,i)},$d=function(a,s){const t=w(s);return wa(bs(Ra(a,to,[],1),t))},Jd=function(a){const s=Ra(a,Ar);return C(Ws({...Y,...s}))},ka=function(a,s,t,i=[],o=[]){return Ra(s,[...a.fields(t),...o].sort(),i)},Ra=function(a,s,t,i=!t){const o={};let r,c=0;for(let l of s){if(l===r)throw new RangeError(Sp(l));if(l==="constructor"||l==="__proto__")throw new RangeError(jr(l));let d=a[l];if(d!==void 0)c=1,_c[l]&&(d=_c[l](d,l)),o[l]=d;else if(t){if(t.includes(l))throw new TypeError(Mr(l));o[l]=Yf[l]}r=l}if(i&&!c)throw new TypeError(Zf(s));return o},bs=function(a,s){return et(xm({...Yf,...a}),s)},zd=function(a,s,t,i,o,r){const c=H(r),{calendar:l,timeZone:d}=t;return B(((f,u,p,m,h)=>{const g=ht(f,p,m,va,Gf,zf),[P,T,O]=ut(h,2);return gs(u,{...f.dateFromFields(g,si(h,P)),...bs(g,P)},$s(g.offset),T,O)})(a(l),s(d),i,o,c),d,l)},_d=function(a,s,t,i,o){const r=H(o);return W(((c,l,d,f)=>{const u=ht(c,l,d,va,Ja),p=w(f);return Wa({...c.dateFromFields(u,si(f,p)),...bs(u,p)})})(a(s.calendar),t,i,r))},Gd=function(a,s,t,i,o){const r=H(o);return((c,l,d,f)=>{const u=ht(c,l,d,va);return c.dateFromFields(u,f)})(a(s.calendar),t,i,r)},qd=function(a,s,t,i,o){const r=H(o);return ds(((c,l,d,f)=>{const u=ht(c,l,d,Ir);return c.yearMonthFromFields(u,f)})(a(s.calendar),t,i,r))},Ud=function(a,s,t,i,o){const r=H(o);return((c,l,d,f)=>{const u=ht(c,l,d,va);return c.monthDayFromFields(u,f)})(a(s.calendar),t,i,r)},Qd=function(a,s,t){return wa(((i,o,r)=>{const c=w(r);return bs({...pa(to,i),...Ra(o,to)},c)})(a,s,t))},Yd=function(a,s){return C((t=a,i=s,Ws({...t,...Ra(i,Ar)})));var t,i},ht=function(a,s,t,i,o=[],r=[]){const c=[...a.fields(i),...o].sort();let l=Ra(s,c,r);const d=Ra(t,c);return l=a.mergeFields(l,d),Ra(l,c,[])},Dr=function(a,s){const t=ka(a,s,Qf);return a.monthDayFromFields(t)},Sr=function(a,s,t){const i=ka(a,s,Uf);return a.yearMonthFromFields(i,t)},Bd=function(a,s,t,i,o){s=pa(t=a.fields(t),s),i=Ra(i,o=a.fields(o),[]);let r=a.mergeFields(s,i);return r=Ra(r,[...t,...o].sort(),[]),a.dateFromFields(r)},Yi=function(a,s){let{era:t,eraYear:i,year:o}=s;const r=ao(a);if(t!==void 0||i!==void 0){if(t===void 0||i===void 0)throw new TypeError(vp);if(!r)throw new RangeError(wp);const c=r[t];if(c===void 0)throw new RangeError(Fp(t));const l=Id(i,c);if(o!==void 0&&o!==l)throw new RangeError(np);o=l}else if(o===void 0)throw new TypeError(Rp(r));return o},Bi=function(a,s,t,i){let{month:o,monthCode:r}=s;if(r!==void 0){const c=((l,d,f,u)=>{const p=l.U(f),[m,h]=Ld(d);let g=_t(m,h,p);if(h){const P=Ad(l);if(P===void 0)throw new RangeError(es);if(P>0){if(g>P)throw new RangeError(es);if(p===void 0){if(u===1)throw new RangeError(es);g--}}else{if(g!==-P)throw new RangeError(es);if(p===void 0&&u===1)throw new RangeError(es)}}return g})(a,r,t,i);if(o!==void 0&&o!==c)throw new RangeError(Af);o=c,i=1}else if(o===void 0)throw new TypeError(jp);return Pa("month",o,1,a.L(t),i)},$c=function(a,s,t,i,o){return ca(s,"day",1,a.j(i,t),o)},Ki=function(a,s,t,i){let o=0;const r=[];for(let c of t)s[c]!==void 0?o=1:r.push(c);if(Object.assign(a,s),o)for(let c of i||r)delete a[c]},Kd=function(a){return q(ga(Kt(Bt(a))))},Xd=function(a,s,t,i,o=S){return B(ga(Kt(Bt(t))),s(i),a(o))},kd=function(a,s,t,i,o=0,r=0,c=0,l=0,d=0,f=0,u=S){return W(Wa(Vt(ya(V,Is(ji,[s,t,i,o,r,c,l,d,f])))),a(u))},Vd=function(a,s,t,i,o=S){return N(Ga(ps(ya(V,{isoYear:s,isoMonth:t,isoDay:i}))),a(o))},ed=function(a,s,t,i=S,o=1){const r=V(s),c=V(t),l=a(i);return ds(To(ps({isoYear:r,isoMonth:c,isoDay:V(o)})),l)},af=function(a,s,t,i=S,o=Ls){const r=V(s),c=V(t),l=a(i);return Nt(Ga(ps({isoYear:V(o),isoMonth:r,isoDay:c})),l)},sf=function(a=0,s=0,t=0,i=0,o=0,r=0){return wa(et(ya(V,Is(na,[a,s,t,i,o,r])),1))},tf=function(a=0,s=0,t=0,i=0,o=0,r=0,c=0,l=0,d=0,f=0){return C(Ws(ya(cl,Is(v,[a,s,t,i,o,r,c,l,d,f]))))},wr=function(a,s,t=S){return B(a.epochNanoseconds,s,t)},of=function(a){return q(a.epochNanoseconds)},vr=function(a,s){return W(ta(s,a))},nr=function(a,s){return N(ta(s,a))},rf=function(a,s,t){return Sr(a(s.calendar),t)},cf=function(a,s,t){return Dr(a(s.calendar),t)},Fr=function(a,s){return wa(ta(s,a))},lf=function(a,s,t,i){const o=((r,c,l,d)=>{const f=Do(d);return ua(r(c),l,f)})(a,t,s,i);return B(ga(o),t,s.calendar)},df=function(a,s,t){const i=a(s.calendar);return ds({...s,...Sr(i,t)})},ff=function(a,s,t){return Dr(a(s.calendar),t)},uf=function(a,s,t,i,o){const r=a(o.timeZone),c=o.plainTime,l=c!==void 0?s(c):Oa;return B(ua(t(r),{...i,...l}),r,i.calendar)},pf=function(a,s=Oa){return W(Wa({...a,...s}))},mf=function(a,s,t){return Sr(a(s.calendar),t)},hf=function(a,s,t){return Dr(a(s.calendar),t)},gf=function(a,s,t,i){return((o,r,c)=>Bd(o,r,Uf,Ha(c),Ot))(a(s.calendar),t,i)},Pf=function(a,s,t,i){return((o,r,c)=>Bd(o,r,Qf,Ha(c),Ri))(a(s.calendar),t,i)},Tf=function(a,s,t,i,o){const r=Ha(o),c=s(r.plainDate),l=a(r.timeZone);return B(ua(t(l),{...c,...i}),l,c.calendar)},bf=function(a,s){return W(Wa({...a,...s}))},Of=function(a){return q(ga(Zs(a,ba)))},yf=function(a){return q(ga(Zs(a,ja)))},Df=function(a){return q(ga(Kt(Bt(a),ys)))},Sf=function(a){return q(ga(Kt(Bt(a))))},wf=function(a,s,t=Oa){const i=s.timeZone,o=a(i),r={...ta(s,o),...t};return B(gs(o,r,r.offsetNanoseconds,2),i,s.calendar)},vf=function(a,s,t){const i=s.timeZone,o=a(i),r={...ta(s,o),...t},c=Mf(s.calendar,t.calendar);return B(gs(o,r,r.offsetNanoseconds,2),i,c)},nf=function(a,s=Oa){return W({...a,...s})},Ff=function(a,s){return W({...a,...s},Mf(a.calendar,s.calendar))},Si=function(a,s){return{...a,calendar:s}},Rf=function(a,s){return{...a,timeZone:s}},Mf=function(a,s){if(a===s)return a;const t=Q(a),i=Q(s);if(t===i||t===S)return s;if(i===S)return a;throw new RangeError(Zr)},hp=function(a,s){return(t)=>t===S?a:t===Mi||t===xs?Object.assign(Object.create(a),{id:t}):Object.assign(Object.create(s),Rm(t))},Os=function(a,s,t){const i=new Set(t);return(o)=>(((r,c)=>{for(let l of c)if(l in r)return 1;return 0})(o=co(i,o),a)||Object.assign(o,s),t&&(o.timeZone=ws,["full","long"].includes(o.timeStyle)&&(o.timeStyle="medium")),o)},Na=function(a,s=Rr){const[t,,,i]=a;return(o,r=Ym,...c)=>{const l=s(i&&i(...c),o,r,t),d=l.resolvedOptions();return[l,...gp(a,d,c)]}},Rr=function(a,s,t,i){if(t=i(t),a){if(t.timeZone!==void 0)throw new TypeError(Jp);t.timeZone=a}return new Va(s,t)},gp=function(a,s,t){const[,i,o]=a;return t.map((r)=>(r.calendar&&((c,l,d)=>{if((d||c!==S)&&c!==l)throw new RangeError(Zr)})(Q(r.calendar),s.calendar,o),i(r,s)))},zs=function(a){const s=gt();return Ba(s,a.getOffsetNanosecondsFor(s))},gt=function(){return Zs(Date.now(),ja)},$a=function(){return qc||(qc=new Va().resolvedOptions().timeZone)},Pp=(a,s)=>`Non-integer ${a}: ${s}`,Tp=(a,s)=>`Non-positive ${a}: ${s}`,bp=(a,s)=>`Non-finite ${a}: ${s}`,Op=(a)=>`Cannot convert bigint to ${a}`,yp=(a)=>`Invalid bigint: ${a}`,Dp="Cannot convert Symbol to string",jf="Invalid object",Cf=(a,s,t,i,o)=>o?Cf(a,o[s],o[t],o[i]):Pt(a,s)+`; must be between ${t}-${i}`,Pt=(a,s)=>`Invalid ${a}: ${s}`,Mr=(a)=>`Missing ${a}`,jr=(a)=>`Invalid field ${a}`,Sp=(a)=>`Duplicate field ${a}`,Zf=(a)=>"No valid fields: "+a.join(),xf="Invalid bag",Lf=(a,s,t)=>Pt(a,s)+"; must be "+Object.keys(t).join(),If="Cannot use valueOf",Cr="Invalid calling context",wp="Forbidden era/eraYear",vp="Mismatching era/eraYear",np="Mismatching year/eraYear",Fp=(a)=>`Invalid era: ${a}`,Rp=(a)=>"Missing year"+(a?"/era/eraYear":""),Mp=(a)=>`Invalid monthCode: ${a}`,Af="Mismatching month/monthCode",jp="Missing month/monthCode",Jc="Cannot guess year",es="Invalid leap month",Ef="Invalid protocol",Tt="Invalid protocol results",Zr="Mismatching Calendars",Cp=(a)=>`Invalid Calendar: ${a}`,Hf="Mismatching TimeZones",Zp="Forbidden ICU TimeZone",xp="Out-of-bounds offset",Lp="Out-of-bounds TimeZone gap",Ip="Invalid TimeZone offset",Ap="Ambiguous offset",wi="Out-of-bounds date",Ep="Out-of-bounds duration",Hp="Cannot mix duration signs",vi="Missing relativeTo",Wp="Cannot use large units",Np="Required smallestUnit or largestUnit",$p="smallestUnit > largestUnit",la=(a)=>`Cannot parse: ${a}`,Ea=(a)=>`Invalid substring: ${a}`,Wf=(a)=>`Cannot format ${a}`,Nf="Mismatching types for formatting",Jp="Cannot specify TimeZone",$f=D(lt,(a,s)=>s),_s=D(lt,(a,s,t)=>t),Ta=D(Et,2),so={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},bt=Object.keys(so),da=86400000,Jf=1000,ys=1000,ja=1e6,ba=1e9,ni=60000000000,Fi=3600000000000,n=86400000000000,Ma=[1,ys,ja,ba,ni,Fi,n],Ja=bt.slice(0,6),to=dt(Ja),zf=["offset"],_f=["timeZone"],Gf=Ja.concat(zf),qf=Gf.concat(_f),io=["era","eraYear"],zp=io.concat(["year"]),Ri=["year"],xr=["monthCode"],Lr=["month"].concat(xr),Ot=["day"],Ir=Lr.concat(Ri),Uf=xr.concat(Ri),va=Ot.concat(Ir),_p=Ot.concat(Lr),Qf=Ot.concat(xr),Yf=_s(Ja,0),S="iso8601",Mi="gregory",xs="japanese",Bf={[Mi]:{bce:-1,ce:0},[xs]:{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}},Gp={chinese:13,dangi:13,hebrew:-6},L=D(Yt,"string"),Kf=D(Yt,"boolean"),qp=D(Yt,"number"),Xf=D(Yt,"function"),v=bt.map((a)=>a+"s"),Ar=dt(v),Up=v.slice(0,6),kf=v.slice(6),Qp=kf.slice(1),Yp=$f(v),Y=_s(v,0),Er=_s(Up,0),Hr=D(Kc,v),na=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Wr=["isoDay","isoMonth","isoYear"],ji=na.concat(Wr),Nr=dt(Wr),Vf=dt(na),ef=dt(ji),Oa=_s(Vf,0),Bp=D(Kc,ji),Va=Intl.DateTimeFormat,au="en-GB",$r=1e8,Kp=$r*da,Xp=[$r,0],kp=[-$r,0],rt=275760,ct=-271821,Vp=1970,Ls=1972,Ia=12,ep=As(1868,9,8),am=fa(ap,WeakMap),Gt="smallestUnit",oo="unit",st="roundingIncrement",Xi="fractionalSecondDigits",su="relativeTo",tu={constrain:0,reject:1},sm=Object.keys(tu),tm={compatible:0,reject:1,earlier:2,later:3},im={reject:0,use:1,prefer:2,ignore:3},om={auto:0,never:1,critical:2,always:3},rm={auto:0,never:1,critical:2},cm={auto:0,never:1},lm={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},yt=D(Ro,Gt),Jr=D(Ro,"largestUnit"),dm=D(Ro,oo),iu=D(ms,"overflow",tu),ou=D(ms,"disambiguation",tm),fm=D(ms,"offset",im),zr=D(ms,"calendarName",om),um=D(ms,"timeZoneName",rm),pm=D(ms,"offset",cm),Dt=D(ms,"roundingMode",lm),Gs="PlainYearMonth",qs="PlainMonthDay",Ds="PlainDate",Ss="PlainDateTime",Ci="PlainTime",za="ZonedDateTime",Zi="Instant",xi="Duration",mm=[Math.floor,(a)=>Ct(a)?Math.floor(a):Math.round(a),Math.ceil,(a)=>Ct(a)?Math.ceil(a):Math.round(a),Math.trunc,(a)=>Ct(a)?Math.trunc(a)||0:Math.round(a),(a)=>a<0?Math.floor(a):Math.ceil(a),(a)=>Math.sign(a)*Math.round(Math.abs(a))||0,(a)=>Ct(a)?(a=Math.trunc(a)||0)+a%2:Math.round(a)],ws="UTC",It=5184000,hm=Wt(1847),gm=Wt((new Date()).getUTCFullYear()+10),Pm=/0+$/,ta=fa(cp,WeakMap),zc=4294967295,Li=fa((a)=>{const s=rr(a);return typeof s=="object"?new cu(s):new ru(s||0)});class ru{constructor(a){this.v=a}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(a){return[bo(a,this.v)]}l(){}}class cu{constructor(a){this.$=((s)=>{function t(d){const f=ki(d,c,l),[u,p]=Ec(f),m=o(u),h=o(p);return m===h?m:i(r(u,p),m,h,d)}function i(d,f,u,p){let m,h;for(;(p===void 0||(m=p<d[0]?f:p>=d[1]?u:void 0)===void 0)&&(h=d[1]-d[0]);){const g=d[0]+Math.floor(h/2);s(g)===u?d[1]=g:d[0]=g+1}return m}const o=fa(s),r=fa(lp);let c=hm,l=gm;return{G(d){const f=t(d-86400),u=t(d+86400),p=d-f,m=d-u;if(f===u)return[p];const h=t(p);return h===t(m)?[d-h]:f>u?[p,m]:[]},V:t,l(d,f){const u=ki(d,c,l);let[p,m]=Ec(u);const h=It*f,g=f<0?()=>m>c||(c=u,0):()=>p<l||(l=u,0);for(;g();){const P=o(p),T=o(m);if(P!==T){const O=r(p,m);i(O,P,T);const b=O[0];if((_a(b,d)||1)===f)return b}p+=h,m+=h}}}})(((s)=>(t)=>{const i=Po(s,t*Jf);return Wt(jd(i),parseInt(i.month),parseInt(i.day),parseInt(i.hour),parseInt(i.minute),parseInt(i.second))-t})(a))}getOffsetNanosecondsFor(a){return this.$.V(fl(a))*ba}getPossibleInstantsFor(a){const[s,t]=[Wt((i=a).isoYear,i.isoMonth,i.isoDay,i.isoHour,i.isoMinute,i.isoSecond),i.isoMillisecond*ja+i.isoMicrosecond*ys+i.isoNanosecond];var i;return this.$.G(s).map((o)=>ga(Cs(Zs(o,ba),t)))}l(a,s){const[t,i]=ul(a),o=this.$.l(t+(s>0||i?1:0),s);if(o!==void 0)return Zs(o,ba)}}var _r="([+\u2212-])",At="(?:[.,](\\d{1,9}))?",lu=`(?:(?:${_r}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Gr="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+At+")?)?",qr=_r+Gr,Tm=lu+"-?(\\d{2})(?:[T ]"+Gr+"(Z|"+qr+")?)?",du="\\[(!?)([^\\]]*)\\]",Ii=`((?:${du}){0,9})`,bm=Js(lu+Ii),Om=Js("(?:--)?(\\d{2})-?(\\d{2})"+Ii),ym=Js(Tm+Ii),Dm=Js("T?"+Gr+"(?:"+qr+")?"+Ii),Sm=Js(qr),wm=new RegExp(du,"g"),vm=Js(`${_r}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${At}H)?(?:(\\d+)${At}M)?(?:(\\d+)${At}S)?)?`),nm=fa((a)=>new Va(au,{timeZone:a,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Fm=/^(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$/,Rm=fa(up),Ur=fa((a)=>new Va(au,{calendar:a,timeZone:ws,era:"short",year:"numeric",month:"short",day:"numeric"})),Mm=/^M(\d{2})(L?)$/,jm={era:Ht,eraYear:V,year:V,month:xc,monthCode:Ht,day:xc},Cm=_s(Ja,V),Zm=_s(v,cl),_c=Object.assign({},jm,Cm,Zm,{offset:Ht}),xm=D(eu,Ja,na),Gc={dateAdd(a,s,t){const i=w(t);let o,{years:r,months:c,weeks:l,days:d}=s;if(d+=_(s,5)[0],r||c)o=((f,u,p,m,h)=>{let[g,P,T]=f.h(u);if(p){const[O,b]=f.I(g,P);g+=p,P=_t(O,b,f.U(g)),P=Pa("month",P,1,f.L(g),h)}return m&&([g,P]=f._(g,P,m)),T=Pa("day",T,1,f.j(g,P),h),f.q(g,P,T)})(this,a,r,c,i);else{if(!l&&!d)return a;o=sa(a)}return o+=(7*l+d)*da,Ga(kt(o))},dateUntil(a,s,t){if(t<=7){let d=0,f=Rd({...a,...Oa},{...s,...Oa});return t===7&&([d,f]=Ua(f,7)),{...Y,weeks:d,days:f}}const i=this.h(a),o=this.h(s);let[r,c,l]=((d,f,u,p,m,h,g)=>{let P=m-f,T=h-u,O=g-p;if(P||T){const b=Math.sign(P||T);let y=d.j(m,h),E=0;if(Math.sign(O)===-b){const Z=y;[m,h]=d._(m,h,-b),P=m-f,T=h-u,y=d.j(m,h),E=b<0?-Z:y}if(O=g-Math.min(p,y)+E,P){const[Z,j]=d.I(f,u),[x,U]=d.I(m,h);if(T=x-Z||Number(U)-Number(j),Math.sign(T)===-b){const z=b<0&&-d.L(m);P=(m-=b)-f,T=h-_t(Z,j,d.U(m))+(z||d.L(m))}}}return[P,T,O]})(this,...i,...o);return t===8&&(c+=this.J(r,i[0]),r=0),{...Y,years:r,months:c,days:l}},dateFromFields(a,s){const t=w(s),i=Yi(this,a),o=Bi(this,a,i,t),r=$c(this,a,o,i,t);return N(Ga(this.P(i,o,r)),this.id||S)},yearMonthFromFields(a,s){const t=w(s),i=Yi(this,a),o=Bi(this,a,i,t);return ds(To(this.P(i,o,1)),this.id||S)},monthDayFromFields(a,s){const t=w(s),i=!this.id,{monthCode:o,year:r,month:c}=a;let l,d,f,u,p;if(o!==void 0){[l,d]=Ld(o),p=Uc(a,"day");const m=this.N(l,d,p);if(!m)throw new RangeError(Jc);if([f,u]=m,c!==void 0&&c!==u)throw new RangeError(Af);i&&(u=Pa("month",u,1,Ia,1),p=Pa("day",p,1,Oo(r!==void 0?r:f,u),t))}else{f=r===void 0&&i?Ls:Yi(this,a),u=Bi(this,a,f,t),p=$c(this,a,u,f,t);const m=this.U(f);d=u===m,l=ei(u,m);const h=this.N(l,d,p);if(!h)throw new RangeError(Jc);[f,u]=h}return Nt(Ga(this.P(f,u,p)),this.id||S)},fields(a){return ao(this)&&a.includes("year")?[...a,...io]:a},mergeFields(a,s){const t=Object.assign(Object.create(null),a);return Ki(t,s,Lr),ao(this)&&(Ki(t,s,zp),this.id===xs&&Ki(t,s,_p,io)),t},inLeapYear(a){const[s]=this.h(a);return this.K(s)},monthsInYear(a){const[s]=this.h(a);return this.L(s)},daysInMonth(a){const[s,t]=this.h(a);return this.j(s,t)},daysInYear(a){const[s]=this.h(a);return this.X(s)},dayOfYear:Tr,era(a){return this.ee(a)[0]},eraYear(a){return this.ee(a)[1]},monthCode(a){const[s,t]=this.h(a),[i,o]=this.I(s,t);return((r,c)=>"M"+Ta(r)+(c?"L":""))(i,o)},dayOfWeek:Pl,daysInWeek(){return 7}},Lm={dayOfYear:Tr,h:ml,q:As},Im=Object.assign({},Lm,{weekOfYear:Zd,yearOfWeek:xd,R(a){function s(h){return(7-h<i?7:0)-h}function t(h){const g=gl(m+h),P=h||1,T=s(at(d+g*P,7));return u=(g+(T-f)*P)/7}const i=this.id?1:4,o=Pl(a),r=this.dayOfYear(a),c=at(o-1,7),l=r-1,d=at(c-l,7),f=s(d);let u,p=Math.floor((l-f)/7)+1,m=a.isoYear;return p?p>t(0)&&(p=1,m++):(p=t(-1),m--),[p,m,u]}}),Am={dayOfYear:Tr,h:Vi,q:ot,weekOfYear:Zd,yearOfWeek:xd,R(){return[]}},Us=hp(Object.assign({},Gc,Im,{h:ml,ee(a){return this.id===Mi?Tl(a):this.id===xs?am(a):[]},I:(a,s)=>[s,0],N(a,s){if(!s)return[Ls,a]},K:yo,U(){},L:hl,J:(a)=>a*Ia,j:Oo,X:gl,P:(a,s,t)=>({isoYear:a,isoMonth:s,isoDay:t}),q:As,_:(a,s,t)=>(a+=Ut(t,Ia),(s+=fo(t,Ia))<1?(a--,s+=Ia):s>Ia&&(a++,s-=Ia),[a,s]),year(a){return a.isoYear},month(a){return a.isoMonth},day:(a)=>a.isoDay}),Object.assign({},Gc,Am,{h:Vi,ee(a){const s=this.O(a);return[s.era,s.eraYear]},I(a,s){const t=Zt.call(this,a);return[ei(s,t),t===s]},N(a,s,t){let[i,o,r]=Vi.call(this,{isoYear:Ls,isoMonth:Ia,isoDay:31});const c=Zt.call(this,i),l=o===c;(_a(a,ei(o,c))||_a(Number(s),Number(l))||_a(t,r))===1&&i--;for(let d=0;d<100;d++){const f=i-d,u=Zt.call(this,f),p=_t(a,s,u);if(s===(p===u)&&t<=Wc.call(this,f,p))return[f,p]}},K(a){const s=xt.call(this,a);return s>xt.call(this,a-1)&&s>xt.call(this,a+1)},U:Zt,L:Lt,J(a,s){const t=s+a,i=Math.sign(a),o=i<0?-1:0;let r=0;for(let c=s;c!==t;c+=i)r+=Lt.call(this,c+o);return r},j:Wc,X:xt,P(a,s,t){return kt(ot.call(this,a,s,t))},q:ot,_(a,s,t){if(t){if(s+=t,!Number.isSafeInteger(s))throw new RangeError(wi);if(t<0)for(;s<1;)s+=Lt.call(this,--a);else{let i;for(;s>(i=Lt.call(this,a));)s-=i,a++}}return[a,s]},year(a){return this.O(a).year},month(a){const{year:s,F:t}=this.O(a),{C:i}=this.B(s);return i[t]+1},day(a){return this.O(a).day}})),qa="numeric",Qs=["timeZoneName"],fu={month:qa,day:qa},Qr={year:qa,month:qa},Yr=Object.assign({},Qr,{day:qa}),Br={hour:qa,minute:qa,second:qa},Kr=Object.assign({},Yr,Br),Em=Object.assign({},Kr,{timeZoneName:"short"}),Hm=Object.keys(Qr),Wm=Object.keys(fu),Nm=Object.keys(Yr),$m=Object.keys(Br),Xr=["dateStyle"],Jm=Hm.concat(Xr),zm=Wm.concat(Xr),kr=Nm.concat(Xr,["weekday"]),St=$m.concat(["dayPeriod","timeStyle"]),Vr=kr.concat(St),_m=Vr.concat(Qs),Gm=Qs.concat(St),qm=Qs.concat(kr),Um=Qs.concat(["day","weekday"],St),Qm=Qs.concat(["year","weekday"],St),Ym={},er=[Os(Vr,Kr),ti],uu=[Os(_m,Em),ti,0,(a,s)=>{const t=Q(a.timeZone);if(s&&Q(s.timeZone)!==t)throw new RangeError(Hf);return t}],ac=[Os(Vr,Kr,Qs),sa],sc=[Os(kr,Yr,Gm),sa],tc=[Os(St,Br,qm),(a)=>Qa(a)/ja],ic=[Os(Jm,Qr,Um),sa,1],oc=[Os(zm,fu,Qm),sa,1],qc;var Vm={Instant:er,PlainDateTime:ac,PlainDate:sc,PlainTime:tc,PlainYearMonth:ic,PlainMonthDay:oc},em=Na(er),ah=Na(uu),sh=Na(ac),th=Na(sc),ih=Na(tc),oh=Na(ic),rh=Na(oc),fc={era:al,eraYear:uo,year:ft,month:Da,daysInMonth:Da,daysInYear:Da,inLeapYear:Kf,monthsInYear:Da},Wi={monthCode:L},uc={day:Da},Su={dayOfWeek:Da,dayOfYear:Da,weekOfYear:sl,yearOfWeek:uo,daysInWeek:Da},wu=Object.assign({},fc,Wi,uc,Su),Hi=new WeakMap,k=Hi.get.bind(Hi),gu=Hi.set.bind(Hi),ch={...Ai(fc,[Gs]),...Ai(Su,[]),...Ai(Wi,[Gs,qs]),...Ai(uc,[qs])},pc=lc(wu),lh=lc({...fc,...Wi}),dh=lc({...Wi,...uc}),Ft={calendarId:(a)=>Q(a.calendar)},fh=ya((a,s)=>function(t){const{i}=this;return a(i[s](A(N(t,i))))},wu),uh=lt((a)=>(s)=>s[a],v.concat("sign")),mc=lt((a,s)=>(t)=>t[na[s]],Ja),vu={epochSeconds:vl,epochMilliseconds:ti,epochMicroseconds:nl,epochNanoseconds:Fl},Rt=D(co,new Set(["branding"])),[ph,Ks,mh]=xa(qs,D(af,X),{...Ft,...dh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return Ks(Ud(Mh,a,this,Xs(s),t))},equals:(a,s)=>Dd(a,pu(s)),toPlainDate(a,s){return A(Pf(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=rh(s,t,a);return i.format(o)},toString:Eo,toJSON:(a)=>Eo(a),valueOf:is},{from:(a,s)=>Ks(pu(a,s))}),nu={getOffsetNanosecondsFor:Ou,getPossibleInstantsFor(a,s,t){const i=[...s.call(a,K(W(t,S)))].map((r)=>gh(r).epochNanoseconds),o=i.length;return o>1&&(i.sort(aa),zo(ha(ma(i[0],i[o-1])))),i}},cc={getOffsetNanosecondsFor:Ou},[hh,oa,gh]=xa(Zi,Kd,vu,{add:(a,s)=>oa(_o(0,a,I(s))),subtract:(a,s)=>oa(_o(1,a,I(s))),until:(a,s,t)=>R(fr(0,a,Ca(s),t)),since:(a,s,t)=>R(fr(1,a,Ca(s),t)),round:(a,s)=>oa(jl(a,s)),equals:(a,s)=>Pd(a,Ca(s)),toZonedDateTime(a,s){const t=Ha(s);return $(wr(a,M(t.timeZone),X(t.calendar)))},toZonedDateTimeISO:(a,s)=>$(wr(a,M(s))),toLocaleString(a,s,t){const[i,o]=em(s,t,a);return i.format(o)},toString:(a,s)=>Zo(M,J,a,s),toJSON:(a)=>Zo(M,J,a),valueOf:is},{from:(a)=>oa(Ca(a)),fromEpochSeconds:(a)=>oa(Of(a)),fromEpochMilliseconds:(a)=>oa(yf(a)),fromEpochMicroseconds:(a)=>oa(Df(a)),fromEpochNanoseconds:(a)=>oa(Sf(a)),compare:(a,s)=>cr(Ca(a),Ca(s))}),[Ni,Jh]=xa("TimeZone",(a)=>{const s=hd(a);return{branding:"TimeZone",id:s,o:Li(s)}},{id:(a)=>a.id},{getPossibleInstantsFor:({o:a},s)=>a.getPossibleInstantsFor(as(s)).map((t)=>oa(q(t))),getOffsetNanosecondsFor:({o:a},s)=>a.getOffsetNanosecondsFor(Ca(s).epochNanoseconds),getOffsetStringFor(a,s){const t=Ca(s).epochNanoseconds,i=Ei(this,cc).getOffsetNanosecondsFor(t);return hs(i)},getPlainDateTimeFor(a,s,t=S){const i=Ca(s).epochNanoseconds,o=Ei(this,cc).getOffsetNanosecondsFor(i);return K(W(Ba(i,o),X(t)))},getInstantFor(a,s,t){const i=as(s),o=Do(t),r=Ei(this);return oa(q(ua(r,i,o)))},getNextTransition:({o:a},s)=>mu(1,a,s),getPreviousTransition:({o:a},s)=>mu(-1,a,s),equals(a,s){return!!bi(this,M(s))},toString:(a)=>a.id,toJSON:(a)=>a.id},{from(a){const s=M(a);return typeof s=="string"?new Ni(s):s}}),Ph=bu(Object.keys(nu)),[Th,ss]=xa(Ci,sf,mc,{getISOFields:Rt,with(a,s,t){return ss(Qd(this,Xs(s),t))},add:(a,s)=>ss(Yo(0,a,I(s))),subtract:(a,s)=>ss(Yo(1,a,I(s))),until:(a,s,t)=>R(gr(0,a,ea(s),t)),since:(a,s,t)=>R(gr(1,a,ea(s),t)),round:(a,s)=>ss(xl(a,s)),equals:(a,s)=>Sd(a,ea(s)),toZonedDateTime:(a,s)=>$(Tf(M,ra,F,a,s)),toPlainDateTime:(a,s)=>K(bf(a,ra(s))),toLocaleString(a,s,t){const[i,o]=ih(s,t,a);return i.format(o)},toString:Ho,toJSON:(a)=>Ho(a),valueOf:is},{from:(a,s)=>ss(ea(a,s)),compare:(a,s)=>Ti(ea(a),ea(s))}),[bh,ts,Oh]=xa(Gs,D(ed,X),{...Ft,...lh},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return ts(qd(Rh,a,this,Xs(s),t))},add:(a,s,t)=>ts(Qo(Pu,0,a,I(s),t)),subtract:(a,s,t)=>ts(Qo(Pu,1,a,I(s),t)),until:(a,s,t)=>R(hr(Tu,0,a,Ys(s),t)),since:(a,s,t)=>R(hr(Tu,1,a,Ys(s),t)),equals:(a,s)=>yd(a,Ys(s)),toPlainDate(a,s){return A(gf(Mt,a,this,s))},toLocaleString(a,s,t){const[i,o]=oh(s,t,a);return i.format(o)},toString:Ao,toJSON:(a)=>Ao(a),valueOf:is},{from:(a,s)=>ts(Ys(a,s)),compare:(a,s)=>Ts(Ys(a),Ys(s))}),[yh,K]=xa(Ss,D(kd,X),{...Ft,...pc,...mc},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return K(_d(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>K(Si(a,X(s))),withPlainDate:(a,s)=>K(Ff(a,ra(s))),withPlainTime:(a,s)=>K(nf(a,dc(s))),add:(a,s,t)=>K(qo(vs,0,a,I(s),t)),subtract:(a,s,t)=>K(qo(vs,1,a,I(s),t)),until:(a,s,t)=>R(pr(Za,0,a,as(s),t)),since:(a,s,t)=>R(pr(Za,1,a,as(s),t)),round:(a,s)=>K(Zl(a,s)),equals:(a,s)=>bd(a,as(s)),toZonedDateTime:(a,s,t)=>$(lf(F,a,M(s),t)),toPlainDate:(a)=>A(N(a)),toPlainTime:(a)=>ss(wa(a)),toPlainYearMonth(a){return ts(df($i,a,this))},toPlainMonthDay(a){return Ks(ff(zi,a,this))},toLocaleString(a,s,t){const[i,o]=sh(s,t,a);return i.format(o)},toString:Lo,toJSON:(a)=>Lo(a),valueOf:is},{from:(a,s)=>K(as(a,s)),compare:(a,s)=>dr(as(a),as(s))}),[Dh,A,Fu]=xa(Ds,D(Vd,X),{...Ft,...pc},{getISOFields:Rt,getCalendar:vt,with(a,s,t){return A(Gd(Mt,a,this,Xs(s),t))},withCalendar:(a,s)=>A(Si(a,X(s))),add:(a,s,t)=>A(Uo(vs,0,a,I(s),t)),subtract:(a,s,t)=>A(Uo(vs,1,a,I(s),t)),until:(a,s,t)=>R(mr(Za,0,a,ra(s),t)),since:(a,s,t)=>R(mr(Za,1,a,ra(s),t)),equals:(a,s)=>Od(a,ra(s)),toZonedDateTime(a,s){const t=!G(s)||s instanceof Ni?{timeZone:s}:s;return $(uf(M,ea,F,a,t))},toPlainDateTime:(a,s)=>K(pf(a,dc(s))),toPlainYearMonth(a){return ts(mf($i,a,this))},toPlainMonthDay(a){return Ks(hf(zi,a,this))},toLocaleString(a,s,t){const[i,o]=th(s,t,a);return i.format(o)},toString:Io,toJSON:(a)=>Io(a),valueOf:is},{from:(a,s)=>A(ra(a,s)),compare:(a,s)=>Ts(ra(a),ra(s))}),hc={fields(a,s,t){return[...s.call(a,t)]}},Ru=Object.assign({dateFromFields(a,s,t,i){return Fu(s.call(a,Object.assign(Object.create(null),t),i))}},hc),Mu=Object.assign({yearMonthFromFields(a,s,t,i){return Oh(s.call(a,Object.assign(Object.create(null),t),i))}},hc),ju=Object.assign({monthDayFromFields(a,s,t,i){return mh(s.call(a,Object.assign(Object.create(null),t),i))}},hc),gc={mergeFields(a,s,t,i){return Ha(s.call(a,Object.assign(Object.create(null),t),Object.assign(Object.create(null),i)))}},Sh=Object.assign({},Ru,gc),wh=Object.assign({},Mu,gc),vh=Object.assign({},ju,gc),Pc={dateAdd(a,s,t,i,o){return Fu(s.call(a,A(N(t,a)),R(C(i)),o))}},Cu=Object.assign({},Pc,{dateUntil(a,s,t,i,o,r){return Ch(s.call(a,A(N(t,a)),A(N(i,a)),Object.assign(Object.create(null),r,{largestUnit:bt[o]})))}}),nh=Object.assign({},Pc,{day:yu}),Fh=Object.assign({},Cu,{day:yu}),$i=La(Mu),Ji=La(Ru),zi=La(ju),Rh=La(wh),Mt=La(Sh),Mh=La(vh),vs=La(Pc),Za=La(Cu),Pu=La(nh),Tu=La(Fh),[jh,R,Ch]=xa(xi,tf,{...uh,blank:Bl},{with:(a,s)=>R(Yd(a,s)),negated:(a)=>R(pi(a)),abs:(a)=>R(Yl(a)),add:(a,s,t)=>R(Vo(wt,Za,F,0,a,I(s),t)),subtract:(a,s,t)=>R(Vo(wt,Za,F,1,a,I(s),t)),round:(a,s)=>R(Ql(wt,Za,F,a,s)),total:(a,s)=>Ml(wt,Za,F,a,s),toLocaleString(a,s,t){return Intl.DurationFormat?new Intl.DurationFormat(s,t).format(this):ci(a)},toString:ci,toJSON:(a)=>ci(a),valueOf:is},{from:(a)=>R(I(a)),compare:(a,s,t)=>gd(wt,vs,F,I(a),I(s),t)}),Zu={toString:(a)=>a.id,toJSON:(a)=>a.id,...ch,dateAdd:({id:a,o:s},t,i,o)=>A(N(s.dateAdd(ra(t),I(i),o),a)),dateUntil:({o:a},s,t,i)=>R(C(a.dateUntil(ra(s),ra(t),Ol(i)))),dateFromFields:({id:a,o:s},t,i)=>A(br(s,t,i,ec(a))),yearMonthFromFields:({id:a,o:s},t,i)=>ts(Or(s,t,i,kc(a))),monthDayFromFields:({id:a,o:s},t,i)=>Ks(yr(s,0,t,i,Vc(a))),fields({o:a},s){const t=new Set(va),i=[];for(let o of s){if(L(o),!t.has(o))throw new RangeError(jr(o));t.delete(o),i.push(o)}return a.fields(i)},mergeFields:({o:a},s,t)=>a.mergeFields(lo(po(s)),lo(po(t)))},[Tc]=xa("Calendar",(a)=>{const s=Cd(a);return{branding:"Calendar",id:s,o:Us(s)}},{id:(a)=>a.id},Zu,{from(a){const s=X(a);return typeof s=="string"?new Tc(s):s}}),Zh=bu(Object.keys(Zu).slice(4)),[xh,$]=xa(za,D(Xd,X,M),{...vu,...Ft,...hu(pc),...hu(mc),offset:(a)=>hs(rc(a).offsetNanoseconds),offsetNanoseconds:(a)=>rc(a).offsetNanoseconds,timeZoneId:(a)=>Q(a.timeZone),hoursInDay:(a)=>Ll(F,a)},{getISOFields:(a)=>ql(J,a),getCalendar:vt,getTimeZone:({timeZone:a})=>typeof a=="string"?new Ni(a):a,with(a,s,t){return $(zd(Mt,F,a,this,Xs(s),t))},withCalendar:(a,s)=>$(Si(a,X(s))),withTimeZone:(a,s)=>$(Rf(a,M(s))),withPlainDate:(a,s)=>$(vf(F,a,ra(s))),withPlainTime:(a,s)=>$(wf(F,a,dc(s))),add:(a,s,t)=>$(Go(vs,F,0,a,I(s),t)),subtract:(a,s,t)=>$(Go(vs,F,1,a,I(s),t)),until:(a,s,t)=>R(C(ur(Za,F,0,a,Bs(s),t))),since:(a,s,t)=>R(C(ur(Za,F,1,a,Bs(s),t))),round:(a,s)=>$(Cl(F,a,s)),startOfDay:(a)=>$(Il(F,a)),equals:(a,s)=>Td(a,Bs(s)),toInstant:(a)=>oa(of(a)),toPlainDateTime:(a)=>K(vr(J,a)),toPlainDate:(a)=>A(nr(J,a)),toPlainTime:(a)=>ss(Fr(J,a)),toPlainYearMonth(a){return ts(rf($i,a,this))},toPlainMonthDay(a){return Ks(cf(zi,a,this))},toLocaleString(a,s,t={}){const[i,o]=ah(s,t,a);return i.format(o)},toString:(a,s)=>xo(J,a,s),toJSON:(a)=>xo(J,a),valueOf:is},{from:(a,s)=>$(Bs(a,s)),compare:(a,s)=>lr(Bs(a),Bs(s))}),Lh=Object.defineProperties({},{...qt("Temporal.Now"),...us({timeZoneId:()=>$a(),instant:()=>oa(q(gt())),zonedDateTime:(a,s=$a())=>$(B(gt(),M(s),X(a))),zonedDateTimeISO:(a=$a())=>$(B(gt(),M(a),S)),plainDateTime:(a,s=$a())=>K(W(zs(J(M(s))),X(a))),plainDateTimeISO:(a=$a())=>K(W(zs(J(M(a))),S)),plainDate:(a,s=$a())=>A(N(zs(J(M(s))),X(a))),plainDateISO:(a=$a())=>A(N(zs(J(M(a))),S)),plainTimeISO:(a=$a())=>ss(wa(zs(J(M(a)))))})}),ns=Object.defineProperties({},{...qt("Temporal"),...us({PlainYearMonth:bh,PlainMonthDay:ph,PlainDate:Dh,PlainTime:Th,PlainDateTime:yh,ZonedDateTime:xh,Instant:hh,Calendar:Tc,TimeZone:Ni,Duration:jh,Now:Lh})}),Ih=Bm(),bc=new WeakMap,Ah=Object.defineProperties(Object.create(Intl),us({DateTimeFormat:Ih}));class Fs extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class Oc{createSession(){throw new Fs}deleteSession(){throw new Fs}findSession(){throw new Fs}findUserByEmailAddress(){throw new Fs}updateSession(){throw new Fs}createUser(){throw new Fs}}class Au extends Fa{constructor(){super(...arguments)}schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class Eu extends Fa{constructor(){super(...arguments)}schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Hu extends Fa{constructor(){super(...arguments)}schema={email:{required:"Email is required",email:"Invalid email"}}}class Wu extends Fa{constructor(){super(...arguments)}schema={password:{required:"Password is required",password:"Invalid password"}}}class rs extends xu{constructor(){super(...arguments)}provider=jt.getStore().authenticationServiceContainer.provider;async me(){const a=await _i.user();if(!a)throw new Iu;return a}async signIn(a=new Au){const s=await a.input.call(a),{email:t,password:i}=s.toJSON(),o=await this.provider.adapter.findUserByEmailAddress(t);if(!o)throw new os({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(i,o.password))throw new os({invalid_credentials:["Invalid credentials"]});const c=a.headers.get("User-Agent"),l=new Bun.CryptoHasher("sha256");l.update(`${o.email}${c}`);const d=l.digest("hex");let f=await this.provider.adapter.findSession({token:d,userAgent:"local"});if(!f)f=await this.provider.adapter.createSession({token:d,userId:o.id,userAgent:"local",expiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else f=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(ns.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return a.ctx.setCookie("access_token",f.token,{expires:f.expiresAt}),await this.provider.onSignIn(o),o}async signUp(a=new Eu){const s=await a.input(),{email:t,password:i,name:o}=s.toJSON();if(await this.provider.adapter.findUserByEmailAddress(t))throw new os({email:["Email address already exists"]});const c=await this.provider.hashPassword(i),l=await this.provider.adapter.createUser({email:t,name:o,password:c});return await this.provider.onSignUp(l),l}async signOut(a=new Fa){const s=a.cookies.get("access_token"),t=await _i.user();return await this.provider.adapter.deleteSession({token:s}),a.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(t),{}}async forgotPassword(a=new Hu){const s=await a.input(),{email:t}=s.toJSON(),i=await this.provider.adapter.findUserByEmailAddress(t);if(!i)return{};const o=await this.provider.generateForgotPasswordToken(i);return await this.provider.adapter.createPasswordResetToken({user:i,token:o}),await this.provider.onForgotPassword(i,o),{}}async resetPassword(a=new Wu){const s=await a.input(),{password:t,token:i}=s.toJSON(),o=await this.provider.adapter.findPasswordResetToken({token:i});if(!o)throw new os({token:["Invalid token"]});if(ns.Instant.from(o.createdAt.toISOString()).add({hours:24}).until(ns.Now.instant()).sign>=0)throw new os({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:i});const c=await this.provider.adapter.findUserByEmailAddress(o.user.email);if(!c)throw new os({email:["User not found"]});const l=await this.provider.hashPassword(t);return await this.provider.adapter.updateUserPassword({id:c.id,password:l}),await this.provider.adapter.deleteAllUserSessions(c.id),await this.provider.onResetPassword(c),{}}async changePassword(a=new Fa){const s=await _i.user(),t=await a.input(),{oldPassword:i,newPassword:o}=t.toJSON(),{password:r}=await this.provider.adapter.findUserByEmailAddress(s.email);if(!await this.provider.verifyPassword(i,r))throw new os({oldPassword:["Incorrect password"]});const l=await this.provider.hashPassword(o);return await this.provider.adapter.updateUserPassword({id:s.id,password:l}),await this.provider.adapter.deleteAllUserSessions(s.id),{}}}class Nu extends Gi{constructor(){super(...arguments)}routes={"/sign-in":this.post(rs,"signIn"),"/sign-up":this.post(rs,"signUp"),"/sign-out":this.post(rs,"signOut"),"/forgot-password":this.post(rs,"forgotPassword"),"/reset-password":this.post(rs,"resetPassword"),"/change-password":this.post(rs,"changePassword"),"/me":this.get(rs,"me")}}class $u extends Lu{constructor(){super(...arguments)}routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class qi{basePath="/auth";routers={api:Nu,view:$u};sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new Oc;async verifyPassword(a,s){return await Bun.password.verify(a,s)}async hashPassword(a){return await Bun.password.hash(a)}async generateForgotPasswordToken(a){const s=new Bun.CryptoHasher("sha256");return s.update(`${a.email}${Date.now()}`),s.digest("hex")}extendSession(a){return{}}onSignUp(a){}onSignIn(a){}onSignOut(a){}onForgotPassword(a,s){}onResetPassword(a){}}class yc{a;constructor(a){this.provider=a}async getSession(a,s){const t=await this.provider.adapter.findSession({token:a,userAgent:s});let i=null;if(t?.user)i=await this.provider.extendSession(t.user);return t.user.extension=i,t}}class Ju extends Gi{constructor(){super(...arguments)}routes={"/translations":this.get(async(a=new Fa)=>{const{scope:s,locale:t}=a.search.toJSON(),i=t??jt.getStore().i18nServiceContainer.detectLocale(a),o=jt.getStore().i18nServiceContainer.getPageTranslations(i,s);return a.ctx.setHeaders("Cache-Control",a.ctx.user?"private, max-age=1200, must-revalidate":"public, max-age=864000, must-revalidate"),a.ctx.setCookie("i18n-locale",i,{expires:new Date(Date.now()+31536000000)}),{[i]:o}})}}class Dc{a;constructor(a){this.service=a}isEnabled=!1;translations=new Map;supportedLocales=[];routers={api:Ju};boot(){const a=new Map;for(let[t,i]of Object.entries(this.service.dictionary))for(let[o,r]of Object.entries(i))for(let[c,l]of Object.entries(r)){const d=c==="default"?this.service.defaultLocale:c;if(!a.has(`${d}.${t}`))a.set(`${d}.${t}`,new Map);a.get(`${d}.${t}`)?.set(o,l),this.isEnabled=!0}let s=new Set;for(let[t,i]of a.entries())this.translations.set(t,Object.fromEntries(i.entries())),s.add(t.split(".")[0]);this.supportedLocales=Array.from(s)}detectLocale(a){const s=this.service.detectLocale(a);if(this.supportedLocales.includes(s))return s;const i=a.cookies.get("i18n-locale")??(a.headers.get("accept-language")||"en-US"),[o]=i.split(",");if(this.supportedLocales.includes(o))return o;const r=this.service.defaultLocale??this.supportedLocales[0];if(r)return r;return"en-US"}getPageTranslations(a,s){if(!s)return{};const t=this.translations.get(`${a}.view:${s}`)??{},i={[`view:${s}`]:t};for(let[o]of this.translations.entries()){const r=o.split(".")[1];if(!r.startsWith("layout:"))continue;const c=r.split(":")[1];if(s?.startsWith(c))i[r]=this.translations.get(`${a}.${r}`)??{}}return i}}class Sc{a;constructor(a){this.service=a}}class vc{a;constructor(a){this.service=a}getRouteHandlerAndParams(a){const t=new URL(a.url).pathname.replace("/api","");let i={},o;for(let[r]of Object.entries(this.service.flatRoutes))try{const c=new URLPattern({pathname:r});if(c.test({pathname:t})){o=r,i=c.exec({pathname:t})?.pathname.groups;break}}catch(c){console.error(c)}return{params:i,path:o}}async runRouteMiddleware(a){const s=Rs.getStore(),i=this.service.flatRoutes[a][s.req.rawRequest.method].middleware;try{await Ui.getContext().middlewareServiceContainer.runMiddleware(i,a)}catch(o){if(o.kind===wc){if(s.req.rawRequest.url.includes("/api")){const{status:r=400,data:c,headers:l}=o.payload.api;return new Response(JSON.stringify(c),{status:r,headers:{"Content-Type":"application/json",...l}})}}else throw console.error(o),o}}async getRouteData(a){const s=this.service.flatRoutes[a],t=Rs.getStore(),i=s[t.req.rawRequest.method].exec??(()=>Promise.resolve({}));let o={};try{o=await i()}catch(r){if(r.kind===wc){const{status:c=400,data:l,headers:d}=r.payload.api;return new Response(JSON.stringify(l),{status:c,headers:{"Content-Type":"application/json",...d}})}else throw console.error(r),r}return o}async handleApiRequest(a){const{params:s,path:t}=this.getRouteHandlerAndParams(a),i=this.service.flatRoutes[t];if(!i||!i[a.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});const o=new Fa(a,s);return await Rs.run(o,async()=>{const r=await this.runRouteMiddleware(t);if(r instanceof Response)return r;const c=await this.getRouteData(t);if(c instanceof Response)return c;const l=Rs.getStore(),d=l.headers;if(d.append("Content-Type","application/json"),!d.get("Cache-Control"))if(l.user)d.set("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else d.set("Cache-Control","public, no-cache, no-store, max-age=0, must-revalidate");return l.cookies.forEach((f)=>d.append("Set-Cookie",f.toString())),l.destroy(),new Response(JSON.stringify(c),{headers:d})})}}var Eh=function(a){return Qi(a)};function nc(a){const s={};for(let[t,i]of Object.entries(a))if("run"in i){const o=i;if(!s[t])s[t]={};const{method:r,middlewares:c}=o,l=o.run.bind(o);s[t][r]={exec:l,middleware:c}}else if(Eh(i)){const o=new i,r=nc(o.routes);for(let[c,l]of Object.entries(r)){const d=c==="/"?"":c,f=t==="/"?"":t,u=`${f}${d}`===""?"/":`${f}${d}`;if(!s[u])s[u]={};for(let[p,m]of Object.entries(l))s[u][p]={exec:m.exec,middleware:[o.middleware,...o.middlewares,...m.middleware]}}}else for(let o of Object.values(i)){if(!s[t])s[t]={};const{method:r,middlewares:c}=o,l=o.run.bind(o);s[t][r]={exec:l,middleware:c}}return Object.fromEntries(Object.entries(s).sort(([t],[i])=>{const o=t.split("/").length+t.split(":").length,r=i.split("/").length+i.split(":").length;return o-r}))}class Fc extends zu{constructor(){super(...arguments)}flatRoutes={};boot(a){this.flatRoutes=nc(a)}}var Hh=function(a){const s=new Map;for(let t of a)if(typeof t==="string"){const[i,o=""]=t.split(":");if(i.startsWith("-")){if(s.has(i.replace("-","")))s.delete(i.replace("-",""))}else s.set(i,o.split(","))}else s.set(t,[]);return s};class Rc{a;constructor(a){this.service=a}runMiddleware(a,s){const t=Rs.getStore().req;return Array.from(Hh(a).entries()).map(([i,o])=>{if(typeof i==="string"){const r=this.service.aliases[i];if(r){const c=new r(s);return(l)=>c.run.call(c,l,...o)}}else{if(Qi(i)){const r=new aliasOrTest(s);return r.run.bind(r)}return i}}).filter(Boolean).reduce((i,o)=>{return async(r,c)=>{return{...await i(r,c),...await o(r,c)}}},(i)=>Promise.resolve({}))(t)}}class Mc{a;constructor(a){this.service=a}}import{AsyncLocalStorage as Wh} from"async_hooks";class jc extends _u{a;name="broadcastingServiceContainer";publishCb;context=new Wh;constructor(a){super();this.service=a}onPublish(a){this.publishCb=a}publish(...a){const[s,t,i]=a;this.publishCb(s,t,i)}async handleMessage(a,s){const t=JSON.parse(s);if(t.type==="subscribe"){const i=Object.entries(this.service.channels).sort(([o],[r])=>o.length-r.length);for(let[o,r]of i){const c=new URLPattern({pathname:o});if(c.test({pathname:t.topic})){const l=c.exec({pathname:t.topic})?.pathname.groups,d=new r;if(await d.subscribe.call(d,l))a.subscribe(t.topic)}break}}if(t.type==="broadcast")a.publish(t.topic,JSON.stringify({topic:t.topic,data:t.payload}));if(t.type==="unsubscribe")a.unsubscribe(t.topic)}run(a,s){const t=a.get("Cookie"),i=new Map;if(t){const o=t.split(";");for(let r of o){const[c,l]=r.split("=");i.set(c.trim(),l.trim())}}this.context.run({headers:a,cookies:i},s)}}class Ui{emailServiceProvider=Ku;authenticationServiceProvider=qi;middlewareServiceProvider=Gu;policiesServiceProvider=qu;i18nServiceProvider=Uu;fileStorageServiceProvider=Yu;apiRouterServiceProvider=Fc;rateLimiterServiceProvider=Bu;broadcastingsServiceProvider=Xu;services;getServices=()=>{if(!this.services)this.services={emailServiceContainer:new Qu(new this.emailServiceProvider),authenticationServiceContainer:new yc(new this.authenticationServiceProvider),middlewareServiceContainer:new Rc(new this.middlewareServiceProvider),policiesServiceProvider:new this.policiesServiceProvider,i18nServiceContainer:new Dc(new this.i18nServiceProvider),fileStorageServiceContainer:new Sc(new this.fileStorageServiceProvider),apiRouterServiceContainer:new vc(new this.apiRouterServiceProvider),rateLimiterServiceContainer:new Mc(new this.rateLimiterServiceProvider),broadcastingServiceContainer:new jc(new this.broadcastingsServiceProvider)};return this.services};static getContext=()=>Cc.getStore();run(a){const s=this.getServices();return Cc.run(s,a)}}class ku{a;constructor(a){this.prisma=a}async createSession(a){return await this.prisma.session.create({data:a,include:{user:!0}})}async createUser(a){return await this.prisma.user.create({data:a})}async deleteSession(a){return await this.prisma.session.deleteMany({where:{token:a.token}})}async findUserByEmailAddress(a){return await this.prisma.user.findUnique({where:{email:a}})}async findSession(a){if(!a.token)return null;try{return await this.prisma.session.findUnique({where:{token:a.token,userAgent:"local"},include:{user:{select:{password:!1,id:!0,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}}}}}})}catch(s){return console.log(s),null}}async updateSession(a){return await this.prisma.session.update({where:{token:a.token},data:{expiresAt:a.expiresAt},include:{user:{select:{password:!1,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}},organization:!0}}}})}async updateUserPassword(a){return await this.prisma.user.update({where:{id:a.id},data:{password:a.password}})}async createPasswordResetToken(a){return await this.prisma.passwordResetToken.create({data:{user:{connect:{id:a.user.id}},token:a.token}})}async findPasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.findUnique({where:{token:s},include:{user:!0}})}async deleteAllUserSessions(a){return await this.prisma.session.deleteMany({where:{userId:a}})}async deletePasswordResetToken(a){const{token:s}=a;return await this.prisma.passwordResetToken.delete({where:{token:s}})}}export{ku as PrismaAuthenticationAdapter,Ui as Kernel,qi as AuthenticationServiceProvider};
|
|
2
|
+
import{a as Nu,b as Qi,c as zi,d as _u,e as xs,g as pa,h as Ht,i as lt,j as Xu,k as Wu,m as Vu} from"../http/index.js";import{n as Ji} from"../facades/index.js";import{o as an,p as Bi,q as sn,r as rn,s as on} from"../services/index.js";import"../chunk-04f04986e53516f0.js";import{w as Ac,x as Gt} from"../chunk-6286081da32e2feb.js";import"../chunk-7ce930fe69575c87.js";import"../chunk-dfb863d471bf3b18.js";import{B as Bu,C as tn} from"../chunk-33abc8f4f7df6791.js";import"../chunk-cfb8c5b12b0e5378.js";import"../chunk-e1929f0f7003fbdf.js";import{K as Yu} from"../chunk-0fd23409fff0376b.js";import"../chunk-496c32676431beab.js";import"../chunk-b6fb088270ea6584.js";import"../chunk-f10ba402aaacfc12.js";import"../chunk-494de321e3423d54.js";import"../chunk-eabfa03c809e14df.js";import"../chunk-8fec55214eb03a61.js";import"../chunk-2f8839f406606d63.js";var Lt=function(t,a,s,i,r){function o(...d){if(!(this instanceof o))throw new TypeError($o);Su(this,a(...d))}function c(d,p){return Object.defineProperties(function(...u){return d.call(this,l(this),...u)},mr(p))}function l(d){const p=X(d);if(!p||p.branding!==t)throw new TypeError($o);return p}return Object.defineProperties(o.prototype,{...al(Ot(c,s)),...ha(Ot(c,i)),...Gs("Temporal."+t)}),Object.defineProperties(o,{...ha(r),...mr(t)}),[o,(d)=>{const p=Object.create(o.prototype);return Su(p,d),p},l]},Ru=function(t){return t=t.concat("id").sort(),(a)=>{if(!sl(a,t))throw new TypeError(kp);return a}},ts=function(t){if(X(t)||t.calendar!==void 0||t.timeZone!==void 0)throw new TypeError(Np);return t},$i=function(t,a){const s={};for(let i in t)s[i]=({o:r},o)=>{const c=X(o)||{},{branding:l}=c,d=l===va||a.includes(l)?c:ct(o);return r[i](d)};return s},hc=function(t){const a={};for(let s in t)a[s]=(i)=>{const{calendar:r}=i;return(o=r,typeof o=="string"?Ba(o):(c=o,Object.assign(Object.create(Pf),{i:c})))[s](i);var o,c};return a},da=function(){throw new TypeError(Wp)},Rs=function({calendar:t}){return typeof t=="string"?new Dc(t):t},Pu=function(t,a){if(a=A(a),J(t)){const i=X(t);if(i&&i.branding===Qa)return S(a),i;const r=Mu(t);return Fo(ki(r||O),!r,t,a)}const s=nd(Ba,t);return S(a),s},Fu=function(t,a,s){return i=a.call(t,ot(z(s))),Gr(ns(i));var i},ei=function(t,a=Eu){const s=Object.keys(a).sort(),i={};for(let r of s)i[r]=T(a[r],t,ru(t[r]));return i},M=function(t,a){return typeof t=="string"?Ii(t):ei(t,a)},q=function(t){return M(t,fc)},Zt=function(t){if(J(t)){const a=X(t);if(a)switch(a.branding){case Ei:return a;case zt:return z(a.epochNanoseconds)}}return cd(t)};var Tu=function(t,a,s){const i=a.l(Zt(s).epochNanoseconds,t);return i?ot(z(i)):null},Z=function(t){return J(t)?(X(t)||{}).timeZone||Rf(t):((a)=>yi(gd(I(a))))(t)},ra=function(t,a){if(J(t)){const s=X(t)||{};switch(s.branding){case Zi:return S(a),s;case Ra:return S(a),vt(s);case zt:return S(a),Eo(q,s)}return Qd(t,a)}return S(a),md(t)},gc=function(t){return t===void 0?void 0:ra(t)},Ya=function(t,a){if(a=A(a),J(t)){const i=X(t);return i&&i.branding===Ua?(S(a),i):Ro(Wi(Fs(t)),t,a)}const s=ud(Ba,t);return S(a),s},oa=function(t,a){if(a=A(a),J(t)){const i=X(t)||{};switch(i.branding){case Ra:return S(a),i;case va:return S(a),N({...i,...Tt});case zt:return S(a),xo(q,i)}return Ud(qi(Fs(t)),t,a)}const s=pd(t);return S(a),s},ct=function(t,a){if(a=A(a),J(t)){const i=X(t)||{};switch(i.branding){case va:return S(a),i;case Ra:return S(a),_(i);case zt:return S(a),Zo(q,i)}return vo(qi(Fs(t)),t,a)}const s=gi(t);return S(a),s},Cu=function(t,a,s){return St(a.call(t,$(_(s,t))))},It=function(t){return(a)=>typeof a=="string"?Ba(a):((s,i)=>{const r=Object.keys(i).sort(),o={};for(let c of r)o[c]=T(i[c],s,s[c]);return o})(a,t)},H=function(t){if(J(t)){const a=X(t);return a&&a.branding===Li?a:Bd(t)}return fd(t)},vs=function(t){if(t!==void 0){if(J(t)){const a=X(t)||{};switch(a.branding){case zt:case va:return a;case Ra:return _(a)}const s=Fs(t);return{...zd(Z,M,qi(s),t),calendar:s}}return ld(t)}},Fs=function(t){return Mu(t)||O},Mu=function(t){const{calendar:a}=t;if(a!==void 0)return Y(a)},Y=function(t){return J(t)?(X(t)||{}).calendar||_f(t):((a)=>hs(hd(I(a))))(t)},Xa=function(t,a){if(a=A(a),J(t)){const s=X(t);if(s&&s.branding===zt)return ms(a),s;const i=Fs(t);return Gd(Z,M,qi(i),i,t,a)}return dd(t,a)},Ou=function(t){return Ot((a)=>(s)=>a(mc(s)),t)},mc=function(t){return it(t,q)},rf=function(){const t=ia.prototype,a=Object.getOwnPropertyDescriptors(t),s=Object.getOwnPropertyDescriptors(ia),i=function(r,o={}){if(!(this instanceof i))return new i(r,o);vc.set(this,((c,l={})=>{const d=new ia(c,l),p=d.resolvedOptions(),u=p.locale,n=ft(Object.keys(l),p),m=nt(lf),f=(...h)=>{let g;const w=h.map((y,b)=>{const P=X(y),v=(P||{}).branding;if(b&&g&&g!==v)throw new TypeError(Gp);return g=v,P});return g?m(g)(u,n,...w):[d,...h]};return f.u=d,f})(r,o))};for(let r in a){const o=a[r],c=r.startsWith("format")&&of(r);typeof o.value=="function"?o.value=r==="constructor"?i:c||cf(r):c&&(o.get=function(){return c.bind(this)})}return s.prototype.value=Object.create(t,a),Object.defineProperties(i,s),i},of=function(t){return function(...a){const s=vc.get(this),[i,...r]=s(...a);return i[t](...r)}},cf=function(t){return function(...a){return vc.get(this).u[t](...a)}},lf=function(t){const a=df[t];if(!a)throw new TypeError(zp(t));return qt(a,nt(Lo))};var dt=function(t,a,s,i,r){return yt(a,tl(t,a),s,i,r)},yt=function(t,a,s,i,r,o){const c=rr(a,s,i);if(r&&a!==c)throw new RangeError(ep(t,a,s,i,o));return c},tl=function(t,a){const s=t[a];if(s===void 0)throw new TypeError(Io(a));return s},J=function(t){return t!==null&&/object|function/.test(typeof t)},nt=function(t,a=Map){const s=new a;return(i,...r)=>{if(s.has(i))return s.get(i);const o=t(i,...r);return s.set(i,o),o}},mr=function(t){return ha({name:t},1)},ha=function(t,a){return Ot((s)=>({value:s,configurable:1,writable:!a}),t)},al=function(t){return Ot((a)=>({get:a,configurable:1}),t)},Gs=function(t){return{[Symbol.toStringTag]:{value:t,configurable:1}}},ea=function(t,a){const s={};let i=t.length;for(let r of a)s[t[--i]]=r;return s},Ot=function(t,a,s){const i={};for(let r in a)i[r]=t(a[r],r,s);return i},ps=function(t,a,s){const i={};for(let r=0;r<a.length;r++){const o=a[r];i[o]=t(o,r,s)}return i},dn=function(t,a,s){const i={};for(let r=0;r<t.length;r++)i[a[r]]=s[t[r]];return i},ft=function(t,a){const s={};for(let i of t)s[i]=a[i];return s},fr=function(t,a){const s={};for(let i in a)t.has(i)||(s[i]=a[i]);return s},hr=function(t){t={...t};const a=Object.keys(t);for(let s of a)t[s]===void 0&&delete t[s];return t},sl=function(t,a){for(let s of a)if(!(s in t))return 0;return 1},il=function(t,a,s){for(let i of t)if(a[i]!==s[i])return 0;return 1},rl=function(t,a,s){const i={...s};for(let r=0;r<a;r++)i[t[r]]=0;return i},T=function(t,...a){return(...s)=>t(...a,...s)},Nc=function(t){return t[0].toUpperCase()+t.substring(1)},us=function(t){return t.slice().sort()},es=function(t,a){return String(a).padStart(t,"0")},Ut=function(t,a){return Math.sign(t-a)},rr=function(t,a,s){return Math.min(Math.max(t,a),s)},At=function(t,a){return[Math.floor(t/a),ss(t,a)]},ss=function(t,a){return(t%a+a)%a},Kt=function(t,a){return[Us(t,a),gr(t,a)]},Us=function(t,a){return Math.trunc(t/a)||0},gr=function(t,a){return t%a||0},Zs=function(t){return Math.abs(t%1)===0.5},ol=function(t,a,s){let i=0,r=0;for(let l=0;l<=a;l++){const d=t[s[l]],p=jt[l],u=F/p,[n,m]=Kt(d,u);i+=m*p,r+=n}const[o,c]=Kt(i,F);return[r+o,c]},Qs=function(t,a,s){const i={};for(let r=a;r>=0;r--){const o=jt[r];i[s[r]]=Us(t,o),t=gr(t,o)}return i},cl=function(t){return t===O?Mi:[]},ll=function(t){return t===O?Ts:[]},dl=function(t){return t===O?["year","day"]:[]},pl=function(t){if(t!==void 0)return I(t)},ul=function(t){if(t!==void 0)return St(t)},wr=function(t){if(t!==void 0)return ns(t)},St=function(t){return fl(ns(t))},ns=function(t){return ml(Vn(t))},yr=function(t){if(t==null)throw new TypeError("Cannot be null or undefined");return t},nl=function(t,a){if(a==null)throw new RangeError(Io(t));return a},_t=function(t){if(!J(t))throw new TypeError($p);return t},Bs=function(t,a,s=t){if(typeof a!==t)throw new TypeError(ys(s,a));return a},ml=function(t,a="number"){if(!Number.isInteger(t))throw new RangeError(vn(a,t));return t||0},fl=function(t,a="number"){if(t<=0)throw new RangeError(Rn(a,t));return t},br=function(t){if(typeof t=="symbol")throw new TypeError(jn);return String(t)},As=function(t,a){return J(t)?String(t):I(t,a)},Ks=function(t){if(typeof t=="string")return BigInt(t);if(typeof t!="bigint")throw new TypeError(Mn(t));return t},hl=function(t,a="number"){if(typeof t=="bigint")throw new TypeError(Cn(a));if(t=Number(t),!Number.isFinite(t))throw new RangeError(Fn(a,t));return t},V=function(t,a){return Math.trunc(hl(t,a))||0},gl=function(t,a){return ml(hl(t,a),a)},_c=function(t,a){return fl(V(t,a),a)},Pr=function(t,a){let[s,i]=Kt(a,F),r=t+s;const o=Math.sign(r);return o&&o===-Math.sign(i)&&(r-=o,i+=o*F),[r,i]},Ea=function(t,a,s=1){return Pr(t[0]+a[0]*s,t[1]+a[1]*s)},La=function(t,a){return Pr(t[0],t[1]+a)},ht=function(t,a){return Ea(a,t,-1)},at=function(t,a){return Ut(t[0],a[0])||Ut(t[1],a[1])},wl=function(t,a,s){return at(t,a)===-1||at(t,s)===1},Ys=function(t,a=1){const s=BigInt(F/a);return[Number(t/s),Number(t%s)*a]},Ia=function(t,a=1){const s=F/a,[i,r]=Kt(t,s);return[i,r*a]},yl=function(t,a=1){const[s,i]=t,r=Math.floor(i/a),o=F/a;return BigInt(s)*BigInt(o)+BigInt(r)},gt=function(t,a=1,s){const[i,r]=t,[o,c]=Kt(r,a);return i*(F/a)+(o+(s?c/a:0))},Tr=function(t,a,s=At){const[i,r]=t,[o,c]=s(r,a);return[i*(F/a)+o,c]},Or=function(t,a){const s=t.formatToParts(a),i={};for(let r of s)i[r.type]=r.value;return i},Sr=function(t){return dt(t,"isoYear",ds,ls,1),t.isoYear===ds?dt(t,"isoMonth",4,12,1):t.isoYear===ls&&dt(t,"isoMonth",1,9,1),t},Qt=function(t){return Wt({...t,...Tt,isoHour:12}),t},Wt=function(t){const a=dt(t,"isoYear",ds,ls,1),s=a===ds?1:a===ls?-1:0;return s&&wt(tt({...t,isoDay:t.isoDay+s,isoNanosecond:t.isoNanosecond-s})),t},wt=function(t){if(!t||wl(t,cm,om))throw new RangeError(vi);return t},Yt=function(t){return ol(t,5,Ft)[1]},Xs=function(t){const[a,s]=At(t,F);return[Qs(s,5,Ft),a]},bl=function(t){return Pl(t)[0]},Pl=function(t){return Tr(t,Pt)},st=function(t){return Aa(t.isoYear,t.isoMonth,t.isoDay,t.isoHour,t.isoMinute,t.isoSecond,t.isoMillisecond)},tt=function(t){const a=st(t);if(a!==void 0){const[s,i]=Kt(a,ut);return[s,i*xt+(t.isoMicrosecond||0)*Da+(t.isoNanosecond||0)]}},Dr=function(t,a){const[s,i]=Xs(Yt(t)-a);return wt(tt({...t,isoDay:t.isoDay+i,...s}))},Ns=function(...t){return Aa(...t)/Qp},Aa=function(...t){const[a,s]=Tl(...t),i=a.valueOf();if(!isNaN(i))return i-s*ut},Tl=function(t,a=1,s=1,i=0,r=0,o=0,c=0){const l=t===ds?1:t===ls?-1:0,d=new Date;return d.setUTCHours(i,r,o,c),d.setUTCFullYear(t,a-1,s+l),[d,l]},Vt=function(t,a){let[s,i]=La(t,a);i<0&&(i+=F,s-=1);const[r,o]=At(i,xt),[c,l]=At(o,Da);return Vs(s*ut+r,c,l)},Vs=function(t,a=0,s=0){const i=Math.ceil(Math.max(0,Math.abs(t)-rm)/ut)*Math.sign(t),r=new Date(t-i*ut);return ea(xi,[r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate()+i,r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds(),a,s])},Ol=function(t){return[t.isoYear,t.isoMonth,t.isoDay]},Sl=function(){return et},vr=function(t,a){switch(a){case 2:return Rr(t)?29:28;case 4:case 6:case 9:case 11:return 30}return 31},Dl=function(t){return Rr(t)?366:365},Rr=function(t){return t%4==0&&(t%100!=0||t%400==0)},vl=function(t){const[a,s]=Tl(t.isoYear,t.isoMonth,t.isoDay);return ss(a.getUTCDay()-s,7)||7},Rl=function({isoYear:t}){return t<1?["bce",1-t]:["ce",t]},pn=function(t){const a=st(t);if(a<dm)return Rl(t);const s=Or(Xo(Ha),a),{era:i,eraYear:r}=$d(s,Ha);return[i,r]},ti=function(t){return ga(t),ai(t,1),t},ga=function(t){return Fl(t,1),t},Wc=function(t){return il(Jo,t,Fl(t))},Fl=function(t,a){const{isoYear:s}=t,i=dt(t,"isoMonth",1,Sl(),a);return{isoYear:s,isoMonth:i,isoDay:dt(t,"isoDay",1,vr(s,i),a)}},ai=function(t,a){return ea(Ft,[dt(t,"isoHour",0,23,a),dt(t,"isoMinute",0,59,a),dt(t,"isoSecond",0,59,a),dt(t,"isoMillisecond",0,999,a),dt(t,"isoMicrosecond",0,999,a),dt(t,"isoNanosecond",0,999,a)])},S=function(t){return t===void 0?0:nu(_t(t))},ms=function(t,a=0){t=Dt(t);const s=mu(t),i=bm(t,a);return[nu(t),i,s]},Fr=function(t){return mu(Dt(t))},Cl=function(t){return t=Dt(t),Uo(t,9,6,1)},Na=function(t,a,s,i=9,r=0,o=4){a=Dt(a);let c=Uo(a,i,r),l=jr(a),d=Ss(a,o);const p=Os(a,i,r,1);return c==null?c=Math.max(s,p):Zl(c,p),l=xr(l,p,1),t&&(d=((u)=>u<4?(u+2)%4:u)(d)),[c,p,l,d]},si=function(t,a=6,s){let i=jr(t=Zr(t,zs));const r=Ss(t,7);let o=Os(t,a);return o=nl(zs,o),i=xr(i,o,void 0,s),[o,i,r]},Cr=function(t){return Qo(Dt(t))},Ml=function(t,a){return Mr(Dt(t),a)},Mr=function(t,a=4){const s=xl(t);return[Ss(t,4),...jl(Os(t,a),s)]},jl=function(t,a){return t!=null?[jt[t],t<4?9-3*t:-1]:[a===void 0?1:10**(9-a),a]},jr=function(t){const a=t[is];return a===void 0?1:V(a,is)},xr=function(t,a,s,i){const r=i?F:jt[a+1];if(r){const o=jt[a];if(r%((t=yt(is,t,1,r/o-(i?0:1),1))*o))throw new RangeError(ys(is,t))}else t=yt(is,t,1,s?1e9:1,1);return t},xl=function(t){let a=t[ir];if(a!==void 0){if(typeof a!="number"){if(br(a)==="auto")return;throw new RangeError(ys(ir,a))}a=yt(ir,Math.floor(a),0,9,1)}return a},Dt=function(t){return t===void 0?{}:_t(t)},Zr=function(t,a){return typeof t=="string"?{[a]:t}:_t(t)},A=function(t){if(t!==void 0){if(J(t))return Object.assign(Object.create(null),t);throw new TypeError($p)}},ii=function(t,a){return t&&Object.assign(Object.create(null),t,{overflow:um[a]})},Er=function(t,a,s=9,i=0,r){let o=a[t];if(o===void 0)return r?i:void 0;if(o=br(o),o==="auto")return r?i:null;let c=dr[o];if(c===void 0&&(c=sm[o]),c===void 0)throw new RangeError(_p(t,o,dr));return yt(t,c,i,s,1,Ps),c},wa=function(t,a,s,i=0){const r=s[t];if(r===void 0)return i;const o=br(r),c=a[o];if(c===void 0)throw new RangeError(_p(t,o,a));return c},Zl=function(t,a){if(a>t)throw new RangeError(Qn)},z=function(t){return{branding:Ei,epochNanoseconds:t}},B=function(t,a,s){return{branding:zt,calendar:s,timeZone:a,epochNanoseconds:t}},N=function(t,a=t.calendar){return{branding:Ra,calendar:a,...ft(lu,t)}},_=function(t,a=t.calendar){return{branding:va,calendar:a,...ft(zo,t)}},ma=function(t,a=t.calendar){return{branding:Ua,calendar:a,...ft(zo,t)}},_s=function(t,a=t.calendar){return{branding:Qa,calendar:a,...ft(zo,t)}},vt=function(t){return{branding:Zi,...ft(cu,t)}},E=function(t){return{branding:Li,sign:ta(t),...ft(Wo,t)}},El=function(t){return bl(t.epochNanoseconds)},ri=function(t){return Tr(t.epochNanoseconds,xt)[0]},Ll=function(t){return yl(t.epochNanoseconds,Da)},Il=function(t){return yl(t.epochNanoseconds)},Hl=function(t){return t.epochNanoseconds},U=function(t){return typeof t=="string"?t:I(t.id)},_a=function(t,a){return t===a||U(t)===U(a)},$l=function(t,a,s,i,r){const o=fa(i),[c,l]=((w,y)=>{const b=y((w=Zr(w,nr))[pu]);let P=ym(w);return P=nl(nr,P),[P,b]})(r,t);if(os(Math.max(c,o),l))return qc(i,c);if(!l)throw new RangeError(Ri);const[d,p,u]=ui(a,s,l),n=so(u),m=ni(u),f=io(u),h=m(p,d,i),g=f(p,d,h,c);return os(c,l)?qc(g,c):((w,y,b,P,v,R,C)=>{const x=ta(w),[e,L]=Lr(P,ko(b,w),b,x,v,R,C),G=Ir(y,e,L);return w[D[b]]+G*x})(g,n(h),c,p,d,n,m)},qc=function(t,a){return gt(k(t),jt[a],1)},Lr=function(t,a,s,i,r,o,c){const l=D[s],d={...a,[l]:a[l]+i},p=c(t,r,a),u=c(t,r,d);return[o(p),o(u)]},Ir=function(t,a,s){const i=gt(ht(a,s));if(!i)throw new RangeError(bs);return gt(ht(a,t))/i},el=function(t,a){const[s,i,r]=si(a,5,1);return z(ci(t.epochNanoseconds,s,i,r,1))},Al=function(t,a,s){let{epochNanoseconds:i,timeZone:r,calendar:o}=a;const[c,l,d]=si(s);if(c===0&&l===1)return a;const p=t(r);if(c===6)i=((u,n,m,f)=>{const h=it(m,n),[g,w]=u(h),y=m.epochNanoseconds,b=mt(n,g),P=mt(n,w);if(wl(y,b,P))throw new RangeError(bs);return Ul(Ir(y,b,P),f)?P:b})(zl,p,a,d);else{const u=p.getOffsetNanosecondsFor(i);i=ba(p,kl(Vt(i,u),c,l,d),u,2,0,1)}return B(i,r,o)},Nl=function(t,a){return N(kl(t,...si(a)),t.calendar)},_l=function(t,a){const[s,i,r]=si(a,5);var o;return vt((o=r,Hr(t,fs(s,i),o)[0]))},Wl=function(t,a){const s=t(a.timeZone),i=it(a,s),[r,o]=zl(i),c=gt(ht(mt(s,r),mt(s,o)),Ci,1);if(c<=0)throw new RangeError(bs);return c},ql=function(t,a){const{timeZone:s,calendar:i}=a,r=((o,c,l)=>mt(c,o(it(l,c))))(Gl,t(s),a);return B(r,s,i)},kl=function(t,a,s,i){return Jl(t,fs(a,s),i)},Jl=function(t,a,s){const[i,r]=Hr(t,a,s);return Wt({...Pa(t,r),...i})},Hr=function(t,a,s){return Xs(Xt(Yt(t),a,s))},Ws=function(t){return Xt(t,Fi,7)},fs=function(t,a){return jt[t]*a},zl=function(t){const a=Gl(t);return[a,Pa(a,1)]},Gl=function(t){return im(6,t)},un=function(t,a,s){const i=Math.min(fa(t),6);return qa(li(k(t,i),a,s),i)},oi=function(t,a,s,i,r,o,c,l,d,p){if(i===0&&r===1)return t;const u=os(i,l)?mi(l)&&i<6&&s>=6?mn:nn:fn;let[n,m,f]=u(t,a,s,i,r,o,c,l,d,p);return f&&i!==7&&(n=((h,g,w,y,b,P,v,R)=>{const C=ta(h);for(let x=y+1;x<=w;x++){if(x===7&&w!==7)continue;const e=ko(x,h);e[D[x]]+=C;const L=gt(ht(v(R(b,P,e)),g));if(L&&Math.sign(L)!==C)break;h=e}return h})(n,m,s,Math.max(6,i),c,l,d,p)),n},ci=function(t,a,s,i,r){if(a===6){const o=((c)=>c[0]+c[1]/F)(t);return[Xt(o,s,i),0]}return li(t,fs(a,s),i,r)},li=function(t,a,s,i){let[r,o]=t;i&&o<0&&(o+=F,r-=1);const[c,l]=At(Xt(o,a,s),F);return Pr(r+c,l)},Xt=function(t,a,s){return Ul(t/a,s)*a},Ul=function(t,a){return Om[a](t)},nn=function(t,a,s,i,r,o){const c=ta(t),l=k(t),d=ci(l,i,r,o),p=ht(l,d),u=Math.sign(d[0]-l[0])===c,n=qa(d,Math.min(s,6));return[{...t,...n},Ea(a,p),u]},mn=function(t,a,s,i,r,o,c,l,d,p){const u=ta(t),n=gt(k(t,5)),m=fs(i,r);let f=Xt(n,m,o);const[h,g]=Lr(c,{...t,...qo},6,u,l,d,p),w=f-gt(ht(h,g));let y=0;w&&Math.sign(w)!==u?a=La(h,f):(y+=u,f=Xt(w,m,o),a=La(g,f));const b=hi(f);return[{...t,...b,days:t.days+y},a,Boolean(y)]},fn=function(t,a,s,i,r,o,c,l,d,p){const u=ta(t),n=D[i],m=ko(i,t);i===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});const f=Us(t[n],r)*r;m[n]=f;const[h,g]=Lr(c,m,i,r*u,l,d,p),w=f+Ir(a,h,g)*u*r,y=Xt(w,r,o),b=Math.sign(y-w)===u;return m[n]=y,[m,b?g:h,b]},$r=function(t,a,s,i){const[r,o,c,l]=((p)=>{const u=Mr(p=Dt(p));return[p.timeZone,...u]})(i),d=r!==void 0;return((p,u,n,m,f,h)=>{n=li(n,f,m,1);const g=u.getOffsetNanosecondsFor(n);return kr(Vt(n,g),h)+(p?ya(Ws(g)):"Z")})(d,a(d?t(r):Fa),s.epochNanoseconds,o,c,l)},er=function(t,a,s){const[i,r,o,c,l,d]=((p)=>{p=Dt(p);const u=Qo(p),n=xl(p),m=Tm(p),f=Ss(p,4),h=Os(p,4);return[u,Pm(p),m,f,...jl(h,n)]})(s);return((p,u,n,m,f,h,g,w,y,b)=>{m=li(m,y,w,1);const P=p(n).getOffsetNanosecondsFor(m);return kr(Vt(m,P),b)+ya(Ws(P),g)+((v,R)=>R!==1?"["+(R===2?"!":"")+U(v)+"]":"")(n,h)+Jr(u,f)})(t,a.calendar,a.timeZone,a.epochNanoseconds,i,r,o,c,l,d)},Ar=function(t,a){const[s,i,r,o]=((p)=>(p=Dt(p),[Qo(p),...Mr(p)]))(a);return c=t.calendar,l=s,d=o,kr(Jl(t,r,i),d)+Jr(c,l);var c,l,d},Nr=function(t,a){return s=t.calendar,i=t,r=Cr(a),qs(i)+Jr(s,r);var s,i,r},_r=function(t,a){return Ql(t.calendar,Bl,t,Cr(a))},Wr=function(t,a){return Ql(t.calendar,hn,t,Cr(a))},qr=function(t,a){const[s,i,r]=Ml(a);return o=r,Kl(Hr(t,i,s)[0],o);var o},di=function(t,a){const[s,i,r]=Ml(a,3);return i>1&&(t={...t,...un(t,i,s)}),((o,c)=>{const{sign:l}=o,d=l===-1?rt(o):o,{hours:p,minutes:u}=d,[n,m]=Tr(k(d,3),Pt,Kt);rd(n);const f=zr(m,c),h=c>=0||!l||f;return(l<0?"-":"")+"P"+kc({Y:na(d.years),M:na(d.months),W:na(d.weeks),D:na(d.days)})+(p||u||n||h?"T"+kc({H:na(p),M:na(u),S:na(n,h)+f}):"")})(t,r)},Ql=function(t,a,s,i){const r=U(t),o=i>1||i===0&&r!==O;return i===1?r===O?a(s):qs(s):o?qs(s)+Yl(r,i===2):a(s)},kc=function(t){const a=[];for(let s in t){const i=t[s];i&&a.push(i,s)}return a.join("")},kr=function(t,a){return qs(t)+"T"+Kl(t,a)},qs=function(t){return Bl(t)+"-"+bt(t.isoDay)},Bl=function(t){const{isoYear:a}=t;return(a<0||a>9999?Xl(a)+es(6,Math.abs(a)):es(4,a))+"-"+bt(t.isoMonth)},hn=function(t){return bt(t.isoMonth)+"-"+bt(t.isoDay)},Kl=function(t,a){const s=[bt(t.isoHour),bt(t.isoMinute)];return a!==-1&&s.push(bt(t.isoSecond)+((i,r,o,c)=>zr(i*xt+r*Da+o,c))(t.isoMillisecond,t.isoMicrosecond,t.isoNanosecond,a)),s.join(":")},ya=function(t,a=0){if(a===1)return"";const[s,i]=At(Math.abs(t),Ci),[r,o]=At(i,Fi),[c,l]=At(o,Pt);return Xl(t)+bt(s)+":"+bt(r)+(c||l?":"+bt(c)+zr(l):"")},Jr=function(t,a){if(a!==1){const s=U(t);if(a>1||a===0&&s!==O)return Yl(s,a===2)}return""},Yl=function(t,a){return"["+(a?"!":"")+"u-ca="+t+"]"},zr=function(t,a){let s=es(9,t);return s=a===void 0?s.replace(vm,""):s.slice(0,a),s?"."+s:""},Xl=function(t){return t<0?"-":"+"},na=function(t,a){return t||a?t.toLocaleString("fullwide",{useGrouping:0}):""},gn=function(t,a){const{epochNanoseconds:s}=t,i=(a.getOffsetNanosecondsFor?a:a(t.timeZone)).getOffsetNanosecondsFor(s),r=Vt(s,i);return{calendar:t.calendar,...r,offsetNanoseconds:i}},Vl=function(t,a){const s=it(a,t);return{calendar:a.calendar,...ft(lu,s),offset:ya(s.offsetNanoseconds),timeZone:a.timeZone}},ba=function(t,a,s,i=0,r=0,o,c){if(s!==void 0&&i===1&&(i===1||c))return Dr(a,s);const l=t.getPossibleInstantsFor(a);if(s!==void 0&&i!==3){const d=((p,u,n,m)=>{const f=tt(u);m&&(n=Ws(n));for(let h of p){let g=gt(ht(h,f));if(m&&(g=Ws(g)),g===n)return h}})(l,a,s,o);if(d!==void 0)return d;if(i===0)throw new RangeError(qn)}return c?tt(a):mt(t,a,r,l)},mt=function(t,a,s=0,i=t.getPossibleInstantsFor(a)){if(i.length===1)return i[0];if(s===1)throw new RangeError(kn);if(i.length)return i[s===3?1:0];const r=tt(a),o=((l,d)=>{const p=l.getOffsetNanosecondsFor(La(d,-F));return Ur(l.getOffsetNanosecondsFor(La(d,F))-p)})(t,r),c=o*(s===2?-1:1);return(i=t.getPossibleInstantsFor(Vt(r,c)))[s===2?0:i.length-1]},Gr=function(t){if(Math.abs(t)>=F)throw new RangeError(_n);return t},Ur=function(t){if(t>F)throw new RangeError(Wn);return t},Qr=function(t,a,s){return z(wt(Ea(a.epochNanoseconds,((i)=>{if(od(i))throw new RangeError(Gn);return k(i,5)})(t?rt(s):s))))},Br=function(t,a,s,i,r,o=Object.create(null)){const c=a(i.timeZone),l=t(i.calendar);return{...i,...to(c,l,i,s?rt(r):r,o)}},Kr=function(t,a,s,i,r=Object.create(null)){const{calendar:o}=s;return N(ao(t(o),s,a?rt(i):i,r),o)},Yr=function(t,a,s,i,r){const{calendar:o}=s;return _(pi(t(o),s,a?rt(i):i,r),o)},Xr=function(t,a,s,i,r=Object.create(null)){const o=s.calendar,c=t(o);let l=rs(c,s);a&&(i=fi(i)),i.sign<0&&(l=c.dateAdd(l,{...Q,months:1}),l=Pa(l,-1));const d=c.dateAdd(l,i,r);return ma(rs(c,d),o)},Vr=function(t,a,s){return vt(td(a,t?rt(s):s)[0])},to=function(t,a,s,i,r){const o=k(i,5);let c=s.epochNanoseconds;if(od(i)){const l=it(s,t);c=Ea(mt(t,{...pi(a,l,{...i,...qo},r),...ft(Ft,l)}),o)}else c=Ea(c,o),S(r);return{epochNanoseconds:wt(c)}},ao=function(t,a,s,i){const[r,o]=td(a,s);return Wt({...pi(t,a,{...s,...qo,days:s.days+o},i),...r})},pi=function(t,a,s,i){if(s.years||s.months||s.weeks)return t.dateAdd(a,s,i);S(i);const r=s.days+k(s,5)[0];return r?Qt(Pa(a,r)):a},rs=function(t,a,s=1){return Pa(a,s-t.day(a))},td=function(t,a){const[s,i]=k(a,5),[r,o]=Xs(Yt(t)+i);return[r,s+o]},Pa=function(t,a){return a?{...t,...Vs(st(t)+a*ut)}:t},ui=function(t,a,s){const i=t(s.calendar);return mi(s)?[s,i,a(s.timeZone)]:[{...s,...Tt},i]},so=function(t){return t?Hl:tt},ni=function(t){return t?T(to,t):ao},io=function(t){return t?T(yn,t):bn},mi=function(t){return t&&t.epochNanoseconds},os=function(t,a){return t<=6-(mi(a)?1:0)},ro=function(t,a,s,i,r,o,c){const l=t(Dt(c).relativeTo),d=Math.max(fa(r),fa(o));if(os(d,l))return E(Wa(((g,w,y,b)=>{const P=Ea(k(g),k(w),b?-1:1);if(!Number.isFinite(P[0]))throw new RangeError(vi);return{...Q,...qa(P,y)}})(r,o,d,i)));if(!l)throw new RangeError(Ri);i&&(o=rt(o));const[p,u,n]=ui(a,s,l),m=ni(n),f=io(n),h=m(u,p,r);return E(f(u,p,m(u,h,o),d))},ad=function(t,a,s,i,r){const o=fa(i),[c,l,d,p,u]=((C,x,e)=>{C=Zr(C,zs);let L=Uo(C);const G=e(C[pu]);let Ct=jr(C);const xa=Ss(C,7);let $t=Os(C);if(L===void 0&&$t===void 0)throw new RangeError(Un);return $t==null&&($t=0),L==null&&(L=Math.max($t,x)),Zl(L,$t),Ct=xr(Ct,$t,1),[L,$t,Ct,xa,G]})(r,o,t),n=Math.max(o,c);if(!mi(u)&&n<=6)return E(Wa(((C,x,e,L,G)=>{const Ct=ci(k(C),e,L,G);return{...Q,...qa(Ct,x)}})(i,c,l,d,p)));if(!u)throw new RangeError(Ri);const[m,f,h]=ui(a,s,u),g=so(h),w=ni(h),y=io(h),b=w(f,m,i);let P=y(f,m,b,c);const v=i.sign,R=ta(P);if(v&&R&&v!==R)throw new RangeError(bs);return R&&(P=oi(P,g(b),c,l,d,p,f,m,g,w)),E(P)},sd=function(t){return t.sign===-1?fi(t):t},fi=function(t){return E(rt(t))},rt=function(t){const a={};for(let s of D)a[s]=-1*t[s]||0;return a},id=function(t){return!t.sign},ta=function(t,a=D){let s=0;for(let i of a){const r=Math.sign(t[i]);if(r){if(s&&s!==r)throw new RangeError(zn);s=r}}return s},Wa=function(t){for(let a of am)yt(a,t[a],-Kc,Kc,1);return rd(gt(k(t),Pt)),t},rd=function(t){if(!Number.isSafeInteger(t))throw new RangeError(Jn)},k=function(t,a=6){return ol(t,a,D)},qa=function(t,a=6){const[s,i]=t,r=Qs(i,a,D);if(r[D[a]]+=s*(F/jt[a]),!Number.isFinite(r[D[a]]))throw new RangeError(vi);return r},hi=function(t,a=5){return Qs(t,a,D)},od=function(t){return Boolean(ta(t,ou))},fa=function(t){let a=9;for(;a>0&&!t[D[a]];a--);return a},wn=function(t,a){return[t,a]},Jc=function(t){const a=Math.floor(t/Hs)*Hs;return[a,a+Hs]},cd=function(t){const a=aa(t=As(t));if(!a)throw new RangeError(pt(t));let s;if(a.m)s=0;else{if(!a.offset)throw new RangeError(pt(t));s=ka(a.offset)}return a.timeZone&&po(a.timeZone,1),z(Dr(ti(a),s))},ld=function(t){const a=aa(I(t));if(!a)throw new RangeError(pt(t));if(a.timeZone)return wd(a,a.offset?ka(a.offset):void 0);if(a.m)throw new RangeError(pt(t));return bd(a)},dd=function(t,a){const s=aa(I(t));if(!s||!s.timeZone)throw new RangeError(pt(t));const{offset:i}=s,r=i?ka(i):void 0,[,o,c]=ms(a);return wd(s,r,o,c)},ka=function(t){const a=po(t);if(a===void 0)throw new RangeError(pt(t));return a},pd=function(t){const a=aa(I(t));if(!a||a.m)throw new RangeError(pt(t));return N(yd(a))},gi=function(t){const a=aa(I(t));if(!a||a.m)throw new RangeError(pt(t));return _(a.p?yd(a):bd(a))},ud=function(t,a){const s=co(I(a));if(s)return oo(s),ma(Sr(ga(s)));const i=gi(a);return ma(rs(t(i.calendar),i))},oo=function(t){if(t.calendar!==O)throw new RangeError(Nt(t.calendar))},nd=function(t,a){const s=lo(I(a));if(s)return oo(s),_s(ga(s));const i=gi(a),{calendar:r}=i,o=t(r),[c,l,d]=o.h(i),[p,u]=o.I(c,l),[n,m]=o.N(p,u,d);return _s(Qt(o.P(n,m,d)),r)},md=function(t){let a,s=((i)=>{const r=jm.exec(i);return r?(wi(r[10]),Od(r)):void 0})(I(t));if(!s){if(s=aa(t),!s)throw new RangeError(pt(t));if(!s.p)throw new RangeError(pt(t));if(s.m)throw new RangeError(Nt("Z"));oo(s)}if((a=co(t))&&Wc(a))throw new RangeError(pt(t));if((a=lo(t))&&Wc(a))throw new RangeError(pt(t));return vt(ai(s,1))},fd=function(t){const a=((s)=>{const i=Em.exec(s);return i?((r)=>{function o(u,n,m){let f=0,h=0;if(m&&([f,d]=At(d,jt[m])),u!==void 0){if(l)throw new RangeError(Nt(u));h=((g)=>{const w=parseInt(g);if(!Number.isFinite(w))throw new RangeError(Nt(g));return w})(u),c=1,n&&(d=uo(n)*(jt[m]/Pt),l=1)}return f+h}let c=0,l=0,d=0,p={...ea(D,[o(r[2]),o(r[3]),o(r[4]),o(r[5]),o(r[6],r[7],5),o(r[8],r[9],4),o(r[10],r[11],3)]),...Qs(d,2,D)};if(!c)throw new RangeError(Ap(D));return no(r[1])<0&&(p=rt(p)),p})(i):void 0})(I(t));if(!a)throw new RangeError(pt(t));return E(Wa(a))},hd=function(t){const a=aa(t)||co(t)||lo(t);return a?a.calendar:t},gd=function(t){const a=aa(t);return a&&(a.timeZone||a.m&&Fa||a.offset)||t},wd=function(t,a,s=0,i=0){const r=yi(t.timeZone),o=Ii(r);return B(ba(o,ti(t),a,s,i,!o.v,t.m),r,hs(t.calendar))},yd=function(t){return Pd(Wt(ti(t)))},bd=function(t){return Pd(Qt(ga(t)))},Pd=function(t){return{...t,calendar:hs(t.calendar)}},aa=function(t){const a=Mm.exec(t);return a?((s)=>{const i=s[10],r=(i||"").toUpperCase()==="Z";return{isoYear:Td(s),isoMonth:parseInt(s[4]),isoDay:parseInt(s[5]),...Od(s.slice(5)),...wi(s[16]),p:Boolean(s[6]),m:r,offset:r?void 0:i}})(a):void 0},co=function(t){const a=Fm.exec(t);return a?((s)=>({isoYear:Td(s),isoMonth:parseInt(s[4]),isoDay:1,...wi(s[5])}))(a):void 0},lo=function(t){const a=Cm.exec(t);return a?((s)=>({isoYear:$a,isoMonth:parseInt(s[1]),isoDay:parseInt(s[2]),...wi(s[3])}))(a):void 0},po=function(t,a){const s=xm.exec(t);return s?((i,r)=>{const o=i[4]||i[5];if(r&&o)throw new RangeError(Nt(o));return Gr((Za(i[2])*Ci+Za(i[3])*Fi+Za(i[4])*Pt+uo(i[5]||""))*no(i[1]))})(s,a):void 0},Td=function(t){const a=no(t[1]),s=parseInt(t[2]||t[3]);if(a<0&&!s)throw new RangeError(Nt(-0));return a*s},Od=function(t){const a=Za(t[3]);return{...Xs(uo(t[4]||""))[0],isoHour:Za(t[1]),isoMinute:Za(t[2]),isoSecond:a===60?59:a}},wi=function(t){let a,s;const i=[];if(t.replace(Zm,(r,o,c)=>{const l=Boolean(o),[d,p]=c.split("=").reverse();if(p){if(p==="u-ca")i.push(d),a||(a=l);else if(l||/[A-Z]/.test(p))throw new RangeError(Nt(r))}else{if(s)throw new RangeError(Nt(r));s=d}return""}),i.length>1&&a)throw new RangeError(Nt(t));return{timeZone:s,calendar:i[0]||O}},uo=function(t){return parseInt(t.padEnd(9,"0"))},Ja=function(t){return new RegExp(`^${t}\$`,"i")},no=function(t){return t&&t!=="+"?-1:1},Za=function(t){return t===void 0?0:parseInt(t)},Sd=function(t){return yi(I(t))},yi=function(t){const a=mo(t);return typeof a=="number"?ya(a):a?((s)=>{if(Im.test(s))throw new RangeError(Nn);return s.toLowerCase().split("/").map((i,r)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(o,c)=>o.length<=2&&!r||o==="in"||o==="chat"?o.toUpperCase():o.length>2||!c?Nc(o).replace(/island|noronha|murdo|rivadavia|urville/,Nc):o)).join("/")})(t):Fa},zc=function(t){const a=mo(t);return typeof a=="number"?a:a?a.resolvedOptions().timeZone:Fa},mo=function(t){const a=po(t=t.toUpperCase(),1);return a!==void 0?a:t!==Fa?Lm(t):void 0},fo=function(t,a){return at(t.epochNanoseconds,a.epochNanoseconds)},ho=function(t,a){return at(t.epochNanoseconds,a.epochNanoseconds)},Dd=function(t,a,s,i,r,o){const c=t(Dt(o).relativeTo),l=Math.max(fa(i),fa(r));if(il(D,i,r))return 0;if(os(l,c))return at(k(i),k(r));if(!c)throw new RangeError(Ri);const[d,p,u]=ui(a,s,c),n=so(u),m=ni(u);return at(n(m(p,d,i)),n(m(p,d,r)))},go=function(t,a){return Ta(t,a)||bi(t,a)},Ta=function(t,a){return Ut(st(t),st(a))},bi=function(t,a){return Ut(Yt(t),Yt(a))},vd=function(t,a){return!fo(t,a)},Rd=function(t,a){return!ho(t,a)&&!!Pi(t.timeZone,a.timeZone)&&_a(t.calendar,a.calendar)},Fd=function(t,a){return!go(t,a)&&_a(t.calendar,a.calendar)},Cd=function(t,a){return!Ta(t,a)&&_a(t.calendar,a.calendar)},Md=function(t,a){return!Ta(t,a)&&_a(t.calendar,a.calendar)},jd=function(t,a){return!Ta(t,a)&&_a(t.calendar,a.calendar)},xd=function(t,a){return!bi(t,a)},Pi=function(t,a){if(t===a)return 1;const s=U(t),i=U(a);if(s===i)return 1;try{return zc(s)===zc(i)}catch(r){}},wo=function(t,a,s,i){const r=Na(t,A(i),3,5),o=Ti(a.epochNanoseconds,s.epochNanoseconds,...r);return E(t?rt(o):o)},yo=function(t,a,s,i,r,o){const c=Si(i.calendar,r.calendar),l=A(o),[d,p,u,n]=Na(s,l,5),m=i.epochNanoseconds,f=r.epochNanoseconds,h=at(f,m);let g;if(h)if(d<6)g=Ti(m,f,d,p,u,n);else{const w=a(((b,P)=>{if(!Pi(b,P))throw new RangeError(Jp);return b})(i.timeZone,r.timeZone)),y=t(c);g=Ed(y,w,i,r,h,d,l),g=oi(g,f,d,p,u,n,y,i,Hl,T(to,w))}else g=Q;return E(s?rt(g):g)},bo=function(t,a,s,i,r){const o=Si(s.calendar,i.calendar),c=A(r),[l,d,p,u]=Na(a,c,6),n=tt(s),m=tt(i),f=at(m,n);let h;if(f)if(l<=6)h=Ti(n,m,l,d,p,u);else{const g=t(o);h=Ld(g,s,i,f,l,c),h=oi(h,m,l,d,p,u,g,s,tt,ao)}else h=Q;return E(a?rt(h):h)},Po=function(t,a,s,i,r){const o=Si(s.calendar,i.calendar),c=A(r);return Zd(a,()=>t(o),s,i,...Na(a,c,6,9,6),c)},To=function(t,a,s,i,r){const o=Si(s.calendar,i.calendar),c=A(r),l=Na(a,c,9,9,8),d=t(o);return Zd(a,()=>d,rs(d,s),rs(d,i),...l,c)},Zd=function(t,a,s,i,r,o,c,l,d){const p=tt(s),u=tt(i);let n;if(at(u,p))if(r===6)n=Ti(p,u,r,o,c,l);else{const m=a();n=m.dateUntil(s,i,r,d),o===6&&c===1||(n=oi(n,u,r,o,c,l,m,s,tt,pi))}else n=Q;return E(t?rt(n):n)},Oo=function(t,a,s,i){const r=A(i),[o,c,l,d]=Na(t,r,5,5),p=Xt(So(a,s),fs(c,l),d),u={...Q,...hi(p,o)};return E(t?rt(u):u)},yn=function(t,a,s,i,r,o){const c=at(i.epochNanoseconds,s.epochNanoseconds);return c?r<6?Id(s.epochNanoseconds,i.epochNanoseconds,r):Ed(a,t,s,i,c,r,o):Q},bn=function(t,a,s,i,r){const o=tt(a),c=tt(s),l=at(c,o);return l?i<=6?Id(o,c,i):Ld(t,a,s,l,i,r):Q},Ed=function(t,a,s,i,r,o,c){const[l,d,p]=((m,f,h,g)=>{function w(){return x={...Pa(P,R++*-g),...b},e=mt(m,x),at(v,e)===-g}const y=it(f,m),b=ft(Ft,y),P=it(h,m),v=h.epochNanoseconds;let R=0;const C=So(y,P);let x,e;if(Math.sign(C)===-g&&R++,w()&&(g===-1||w()))throw new RangeError(bs);const L=gt(ht(e,v));return[y,x,L]})(a,s,i,r);var u,n;return{...o===6?(u=l,n=d,{...Q,days:Hd(u,n)}):t.dateUntil(l,d,o,c),...hi(p)}},Ld=function(t,a,s,i,r,o){const[c,l,d]=((p,u,n)=>{let m=u,f=So(p,u);return Math.sign(f)===-n&&(m=Pa(u,-n),f+=F*n),[p,m,f]})(a,s,i);return{...t.dateUntil(c,l,r,o),...hi(d)}},Ti=function(t,a,s,i,r,o){return{...Q,...qa(ci(ht(t,a),i,r,o),s)}},Id=function(t,a,s){return{...Q,...qa(ht(t,a),s)}},Hd=function(t,a){return Oi(st(t),st(a))},Oi=function(t,a){return Math.trunc((a-t)/ut)},So=function(t,a){return Yt(a)-Yt(t)},Si=function(t,a){if(!_a(t,a))throw new RangeError(eo);return t},Pn=function(t){function a(r){return((o,c)=>({...$d(o,c),F:o.month,day:parseInt(o.day)}))(Or(s,r),i)}const s=Xo(t),i=ks(t);return{id:t,O:Tn(a),B:On(a)}},Tn=function(t){return nt((a)=>{const s=st(a);return t(s)},WeakMap)},On=function(t){const a=t(0).year-lm;return nt((s)=>{let i,r=Aa(s-a);const o=[],c=[];do r+=400*ut;while((i=t(r)).year<=s);do r+=(1-i.day)*ut,i.year===s&&(o.push(r),c.push(i.F)),r-=ut;while((i=t(r)).year>=s);return{k:o.reverse(),C:Up(c.reverse())}})},$d=function(t,a){let s,i,r=ed(t);if(t.era){const o=su[a];o!==void 0&&(s=a==="islamic"?"ah":t.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),s==="bc"||s==="b"?s="bce":s!=="ad"&&s!=="a"||(s="ce"),i=r,r=qd(i,o[s]||0))}return{era:s,eraYear:i,year:r}},ed=function(t){return parseInt(t.relatedYear||t.year)},or=function(t){const{year:a,F:s,day:i}=this.O(t),{C:r}=this.B(a);return[a,r[s]+1,i]},cs=function(t,a=1,s=1){return this.B(t).k[a-1]+(s-1)*ut},Es=function(t){const a=Uc(this,t),s=Uc(this,t-1),i=a.length;if(i>s.length){const r=kd(this);if(r<0)return-r;for(let o=0;o<i;o++)if(a[o]!==s[o])return o+1}},Ls=function(t){return Oi(cs.call(this,t),cs.call(this,t+1))},Gc=function(t,a){const{k:s}=this.B(t);let i=a+1,r=s;return i>s.length&&(i=1,r=this.B(t+1).k),Oi(s[a-1],r[i-1])},Is=function(t){return this.B(t).k.length},Uc=function(t,a){return Object.keys(t.B(a).C)},Ad=function(t){return hs(I(t))},hs=function(t){if((t=t.toLowerCase())!==O&&t!==ji&&ks(t)!==ks(Xo(t).resolvedOptions().calendar))throw new RangeError(An(t));return t},ks=function(t){return t==="islamicc"&&(t="islamic"),t.split("-")[0]},Nd=function(t){return this.R(t)[0]},_d=function(t){return this.R(t)[1]},Do=function(t){const[a]=this.h(t);return Oi(this.q(a),st(t))+1},Wd=function(t){const a=$m.exec(t);if(!a)throw new RangeError($n(t));return[parseInt(a[1]),Boolean(a[2])]},Js=function(t,a,s){return t+(a||s&&t>=s?1:0)},cr=function(t,a){return t-(a&&t>=a?1:0)},qd=function(t,a){return(a+t)*(Math.sign(a)||1)||0},lr=function(t){return su[Jd(t)]},kd=function(t){return Xn[Jd(t)]},Jd=function(t){return ks(t.id||O)},zd=function(t,a,s,i){const r=sa(s,i,Rt,[],Xp);if(r.timeZone!==void 0){const o=s.dateFromFields(r),c=Oa(r),l=t(r.timeZone);return{epochNanoseconds:ba(a(l),{...o,...c},r.offset!==void 0?ka(r.offset):void 0),timeZone:l}}return{...s.dateFromFields(r),...Tt}},Gd=function(t,a,s,i,r,o){const c=sa(s,r,Rt,Kp,Xp),l=t(c.timeZone),[d,p,u]=ms(o),n=s.dateFromFields(c,ii(o,d)),m=Oa(c,d);return B(ba(a(l),{...n,...m},c.offset!==void 0?ka(c.offset):void 0,p,u),l,i)},Ud=function(t,a,s){const i=sa(t,a,Rt,[],Jt),r=S(s);return N(Wt({...t.dateFromFields(i,ii(s,r)),...Oa(i,r)}))},vo=function(t,a,s,i=[]){const r=sa(t,a,Rt,i);return t.dateFromFields(r,s)},Ro=function(t,a,s,i){const r=sa(t,a,_o,i);return t.yearMonthFromFields(r,s)},Fo=function(t,a,s,i,r=[]){const o=sa(t,s,Rt,r);return a&&o.month!==void 0&&o.monthCode===void 0&&o.year===void 0&&(o.year=$a),t.monthDayFromFields(o,i)},Qd=function(t,a){const s=S(a);return vt(Oa(Mt(t,pr,[],1),s))},Bd=function(t){const a=Mt(t,Wo);return E(Wa({...Q,...a}))},sa=function(t,a,s,i=[],r=[]){return Mt(a,[...t.fields(s),...r].sort(),i)},Mt=function(t,a,s,i=!s){const r={};let o,c=0;for(let l of a){if(l===o)throw new RangeError(xn(l));if(l==="constructor"||l==="__proto__")throw new RangeError(Ho(l));let d=t[l];if(d!==void 0)c=1,Yc[l]&&(d=Yc[l](d,l)),r[l]=d;else if(s){if(s.includes(l))throw new TypeError(Io(l));r[l]=au[l]}o=l}if(i&&!c)throw new TypeError(Ap(a));return r},Oa=function(t,a){return ai(_m({...au,...t}),a)},Kd=function(t,a,s,i,r,o){const c=A(o),{calendar:l,timeZone:d}=s;return B(((p,u,n,m,f)=>{const h=gs(p,n,m,Rt,Yp,Bp),[g,w,y]=ms(f,2);return ba(u,{...p.dateFromFields(h,ii(f,g)),...Oa(h,g)},ka(h.offset),w,y)})(t(l),a(d),i,r,c),d,l)},Yd=function(t,a,s,i,r){const o=A(r);return N(((c,l,d,p)=>{const u=gs(c,l,d,Rt,Jt),n=S(p);return Wt({...c.dateFromFields(u,ii(p,n)),...Oa(u,n)})})(t(a.calendar),s,i,o))},Xd=function(t,a,s,i,r){const o=A(r);return((c,l,d,p)=>{const u=gs(c,l,d,Rt);return c.dateFromFields(u,p)})(t(a.calendar),s,i,o)},Vd=function(t,a,s,i,r){const o=A(r);return ma(((c,l,d,p)=>{const u=gs(c,l,d,_o);return c.yearMonthFromFields(u,p)})(t(a.calendar),s,i,o))},tp=function(t,a,s,i,r){const o=A(r);return((c,l,d,p)=>{const u=gs(c,l,d,Rt);return c.monthDayFromFields(u,p)})(t(a.calendar),s,i,o)},ap=function(t,a,s){return vt(((i,r,o)=>{const c=S(o);return Oa({...ft(pr,i),...Mt(r,pr)},c)})(t,a,s))},sp=function(t,a){return E((s=t,i=a,Wa({...s,...Mt(i,Wo)})));var s,i},gs=function(t,a,s,i,r=[],o=[]){const c=[...t.fields(i),...r].sort();let l=Mt(a,c,o);const d=Mt(s,c);return l=t.mergeFields(l,d),Mt(l,c,[])},Co=function(t,a){const s=sa(t,a,tu);return t.monthDayFromFields(s)},Mo=function(t,a,s){const i=sa(t,a,Vp);return t.yearMonthFromFields(i,s)},ip=function(t,a,s,i,r){a=ft(s=t.fields(s),a),i=Mt(i,r=t.fields(r),[]);let o=t.mergeFields(a,i);return o=Mt(o,[...s,...r].sort(),[]),t.dateFromFields(o)},tr=function(t,a){let{era:s,eraYear:i,year:r}=a;const o=lr(t);if(s!==void 0||i!==void 0){if(s===void 0||i===void 0)throw new TypeError(En);if(!o)throw new RangeError(Zn);const c=o[s];if(c===void 0)throw new RangeError(In(s));const l=qd(i,c);if(r!==void 0&&r!==l)throw new RangeError(Ln);r=l}else if(r===void 0)throw new TypeError(Hn(o));return r},ar=function(t,a,s,i){let{month:r,monthCode:o}=a;if(o!==void 0){const c=((l,d,p,u)=>{const n=l.U(p),[m,f]=Wd(d);let h=Js(m,f,n);if(f){const g=kd(l);if(g===void 0)throw new RangeError(as);if(g>0){if(h>g)throw new RangeError(as);if(n===void 0){if(u===1)throw new RangeError(as);h--}}else{if(h!==-g)throw new RangeError(as);if(n===void 0&&u===1)throw new RangeError(as)}}return h})(t,o,s,i);if(r!==void 0&&r!==c)throw new RangeError(qp);r=c,i=1}else if(r===void 0)throw new TypeError(en);return yt("month",r,1,t.L(s),i)},Qc=function(t,a,s,i,r){return dt(a,"day",1,t.j(i,s),r)},sr=function(t,a,s,i){let r=0;const o=[];for(let c of s)a[c]!==void 0?r=1:o.push(c);if(Object.assign(t,a),r)for(let c of i||o)delete t[c]},rp=function(t){return z(wt(Ys(Ks(t))))},op=function(t,a,s,i,r=O){return B(wt(Ys(Ks(s))),a(i),t(r))},cp=function(t,a,s,i,r=0,o=0,c=0,l=0,d=0,p=0,u=O){return N(Wt(ti(Ot(V,ea(xi,[a,s,i,r,o,c,l,d,p])))),t(u))},lp=function(t,a,s,i,r=O){return _(Qt(ga(Ot(V,{isoYear:a,isoMonth:s,isoDay:i}))),t(r))},dp=function(t,a,s,i=O,r=1){const o=V(a),c=V(s),l=t(i);return ma(Sr(ga({isoYear:o,isoMonth:c,isoDay:V(r)})),l)},pp=function(t,a,s,i=O,r=$a){const o=V(a),c=V(s),l=t(i);return _s(Qt(ga({isoYear:V(r),isoMonth:o,isoDay:c})),l)},up=function(t=0,a=0,s=0,i=0,r=0,o=0){return vt(ai(Ot(V,ea(Ft,[t,a,s,i,r,o])),1))},np=function(t=0,a=0,s=0,i=0,r=0,o=0,c=0,l=0,d=0,p=0){return E(Wa(Ot(gl,ea(D,[t,a,s,i,r,o,c,l,d,p]))))},jo=function(t,a,s=O){return B(t.epochNanoseconds,a,s)},mp=function(t){return z(t.epochNanoseconds)},xo=function(t,a){return N(it(a,t))},Zo=function(t,a){return _(it(a,t))},fp=function(t,a,s){return Mo(t(a.calendar),s)},hp=function(t,a,s){return Co(t(a.calendar),s)},Eo=function(t,a){return vt(it(a,t))},gp=function(t,a,s,i){const r=((o,c,l,d)=>{const p=Fr(d);return mt(o(c),l,p)})(t,s,a,i);return B(wt(r),s,a.calendar)},wp=function(t,a,s){const i=t(a.calendar);return ma({...a,...Mo(i,s)})},yp=function(t,a,s){return Co(t(a.calendar),s)},bp=function(t,a,s,i,r){const o=t(r.timeZone),c=r.plainTime,l=c!==void 0?a(c):Tt;return B(mt(s(o),{...i,...l}),o,i.calendar)},Pp=function(t,a=Tt){return N(Wt({...t,...a}))},Tp=function(t,a,s){return Mo(t(a.calendar),s)},Op=function(t,a,s){return Co(t(a.calendar),s)},Sp=function(t,a,s,i){return((r,o,c)=>ip(r,o,Vp,_t(c),Ts))(t(a.calendar),s,i)},Dp=function(t,a,s,i){return((r,o,c)=>ip(r,o,tu,_t(c),Mi))(t(a.calendar),s,i)},vp=function(t,a,s,i,r){const o=_t(r),c=a(o.plainDate),l=t(o.timeZone);return B(mt(s(l),{...c,...i}),l,c.calendar)},Rp=function(t,a){return N(Wt({...t,...a}))},Fp=function(t){return z(wt(Ia(t,Pt)))},Cp=function(t){return z(wt(Ia(t,xt)))},Mp=function(t){return z(wt(Ys(Ks(t),Da)))},jp=function(t){return z(wt(Ys(Ks(t))))},xp=function(t,a,s=Tt){const i=a.timeZone,r=t(i),o={...it(a,r),...s};return B(ba(r,o,o.offsetNanoseconds,2),i,a.calendar)},Zp=function(t,a,s){const i=a.timeZone,r=t(i),o={...it(a,r),...s},c=Hp(a.calendar,s.calendar);return B(ba(r,o,o.offsetNanoseconds,2),i,c)},Ep=function(t,a=Tt){return N({...t,...a})},Lp=function(t,a){return N({...t,...a},Hp(t.calendar,a.calendar))},Di=function(t,a){return{...t,calendar:a}},Ip=function(t,a){return{...t,timeZone:a}},Hp=function(t,a){if(t===a)return t;const s=U(t),i=U(a);if(s===i||s===O)return a;if(i===O)return t;throw new RangeError(eo)},Sn=function(t,a){return(s)=>s===O?t:s===ji||s===Ha?Object.assign(Object.create(t),{id:s}):Object.assign(Object.create(a),Hm(s))},Sa=function(t,a,s){const i=new Set(s);return(r)=>(((o,c)=>{for(let l of c)if(l in o)return 1;return 0})(r=fr(i,r),t)||Object.assign(r,a),s&&(r.timeZone=Fa,["full","long"].includes(r.timeStyle)&&(r.timeStyle="medium")),r)},qt=function(t,a=Lo){const[s,,,i]=t;return(r,o=sf,...c)=>{const l=a(i&&i(...c),r,o,s),d=l.resolvedOptions();return[l,...Dn(t,d,c)]}},Lo=function(t,a,s,i){if(s=i(s),t){if(s.timeZone!==void 0)throw new TypeError(Bn);s.timeZone=t}return new ia(a,s)},Dn=function(t,a,s){const[,i,r]=t;return s.map((o)=>(o.calendar&&((c,l,d)=>{if((d||c!==O)&&c!==l)throw new RangeError(eo)})(U(o.calendar),a.calendar,r),i(o,a)))},za=function(t){const a=ws();return Vt(a,t.getOffsetNanosecondsFor(a))},ws=function(){return Ia(Date.now(),xt)},kt=function(){return Vc||(Vc=new ia().resolvedOptions().timeZone)},vn=(t,a)=>`Non-integer ${t}: ${a}`,Rn=(t,a)=>`Non-positive ${t}: ${a}`,Fn=(t,a)=>`Non-finite ${t}: ${a}`,Cn=(t)=>`Cannot convert bigint to ${t}`,Mn=(t)=>`Invalid bigint: ${t}`,jn="Cannot convert Symbol to string",$p="Invalid object",ep=(t,a,s,i,r)=>r?ep(t,r[a],r[s],r[i]):ys(t,a)+`; must be between ${s}-${i}`,ys=(t,a)=>`Invalid ${t}: ${a}`,Io=(t)=>`Missing ${t}`,Ho=(t)=>`Invalid field ${t}`,xn=(t)=>`Duplicate field ${t}`,Ap=(t)=>"No valid fields: "+t.join(),Np="Invalid bag",_p=(t,a,s)=>ys(t,a)+"; must be "+Object.keys(s).join(),Wp="Cannot use valueOf",$o="Invalid calling context",Zn="Forbidden era/eraYear",En="Mismatching era/eraYear",Ln="Mismatching year/eraYear",In=(t)=>`Invalid era: ${t}`,Hn=(t)=>"Missing year"+(t?"/era/eraYear":""),$n=(t)=>`Invalid monthCode: ${t}`,qp="Mismatching month/monthCode",en="Missing month/monthCode",Bc="Cannot guess year",as="Invalid leap month",kp="Invalid protocol",bs="Invalid protocol results",eo="Mismatching Calendars",An=(t)=>`Invalid Calendar: ${t}`,Jp="Mismatching TimeZones",Nn="Forbidden ICU TimeZone",_n="Out-of-bounds offset",Wn="Out-of-bounds TimeZone gap",qn="Invalid TimeZone offset",kn="Ambiguous offset",vi="Out-of-bounds date",Jn="Out-of-bounds duration",zn="Cannot mix duration signs",Ri="Missing relativeTo",Gn="Cannot use large units",Un="Required smallestUnit or largestUnit",Qn="smallestUnit > largestUnit",pt=(t)=>`Cannot parse: ${t}`,Nt=(t)=>`Invalid substring: ${t}`,zp=(t)=>`Cannot format ${t}`,Gp="Mismatching types for formatting",Bn="Cannot specify TimeZone",Up=T(ps,(t,a)=>a),Ga=T(ps,(t,a,s)=>s),bt=T(es,2),dr={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},Ps=Object.keys(dr),ut=86400000,Qp=1000,Da=1000,xt=1e6,Pt=1e9,Fi=60000000000,Ci=3600000000000,F=86400000000000,jt=[1,Da,xt,Pt,Fi,Ci,F],Jt=Ps.slice(0,6),pr=us(Jt),Bp=["offset"],Kp=["timeZone"],Yp=Jt.concat(Bp),Xp=Yp.concat(Kp),ur=["era","eraYear"],Kn=ur.concat(["year"]),Mi=["year"],Ao=["monthCode"],No=["month"].concat(Ao),Ts=["day"],_o=No.concat(Mi),Vp=Ao.concat(Mi),Rt=Ts.concat(_o),Yn=Ts.concat(No),tu=Ts.concat(Ao),au=Ga(Jt,0),O="iso8601",ji="gregory",Ha="japanese",su={[ji]:{bce:-1,ce:0},[Ha]:{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}},Xn={chinese:13,dangi:13,hebrew:-6},I=T(Bs,"string"),iu=T(Bs,"boolean"),Vn=T(Bs,"number"),ru=T(Bs,"function"),D=Ps.map((t)=>t+"s"),Wo=us(D),tm=D.slice(0,6),ou=D.slice(6),am=ou.slice(1),sm=Up(D),Q=Ga(D,0),qo=Ga(tm,0),ko=T(rl,D),Ft=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],Jo=["isoDay","isoMonth","isoYear"],xi=Ft.concat(Jo),zo=us(Jo),cu=us(Ft),lu=us(xi),Tt=Ga(cu,0),im=T(rl,xi),ia=Intl.DateTimeFormat,du="en-GB",Go=1e8,rm=Go*ut,om=[Go,0],cm=[-Go,0],ls=275760,ds=-271821,lm=1970,$a=1972,et=12,dm=Aa(1868,9,8),pm=nt(pn,WeakMap),zs="smallestUnit",nr="unit",is="roundingIncrement",ir="fractionalSecondDigits",pu="relativeTo",uu={constrain:0,reject:1},um=Object.keys(uu),nm={compatible:0,reject:1,earlier:2,later:3},mm={reject:0,use:1,prefer:2,ignore:3},fm={auto:0,never:1,critical:2,always:3},hm={auto:0,never:1,critical:2},gm={auto:0,never:1},wm={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Os=T(Er,zs),Uo=T(Er,"largestUnit"),ym=T(Er,nr),nu=T(wa,"overflow",uu),mu=T(wa,"disambiguation",nm),bm=T(wa,"offset",mm),Qo=T(wa,"calendarName",fm),Pm=T(wa,"timeZoneName",hm),Tm=T(wa,"offset",gm),Ss=T(wa,"roundingMode",wm),Ua="PlainYearMonth",Qa="PlainMonthDay",va="PlainDate",Ra="PlainDateTime",Zi="PlainTime",zt="ZonedDateTime",Ei="Instant",Li="Duration",Om=[Math.floor,(t)=>Zs(t)?Math.floor(t):Math.round(t),Math.ceil,(t)=>Zs(t)?Math.ceil(t):Math.round(t),Math.trunc,(t)=>Zs(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)=>Zs(t)?(t=Math.trunc(t)||0)+t%2:Math.round(t)],Fa="UTC",Hs=5184000,Sm=Ns(1847),Dm=Ns((new Date()).getUTCFullYear()+10),vm=/0+$/,it=nt(gn,WeakMap),Kc=4294967295,Ii=nt((t)=>{const a=mo(t);return typeof a=="object"?new hu(a):new fu(a||0)});class fu{constructor(t){this.v=t}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(t){return[Dr(t,this.v)]}l(){}}class hu{constructor(t){this.$=((a)=>{function s(d){const p=rr(d,c,l),[u,n]=Jc(p),m=r(u),f=r(n);return m===f?m:i(o(u,n),m,f,d)}function i(d,p,u,n){let m,f;for(;(n===void 0||(m=n<d[0]?p:n>=d[1]?u:void 0)===void 0)&&(f=d[1]-d[0]);){const h=d[0]+Math.floor(f/2);a(h)===u?d[1]=h:d[0]=h+1}return m}const r=nt(a),o=nt(wn);let c=Sm,l=Dm;return{G(d){const p=s(d-86400),u=s(d+86400),n=d-p,m=d-u;if(p===u)return[n];const f=s(n);return f===s(m)?[d-f]:p>u?[n,m]:[]},V:s,l(d,p){const u=rr(d,c,l);let[n,m]=Jc(u);const f=Hs*p,h=p<0?()=>m>c||(c=u,0):()=>n<l||(l=u,0);for(;h();){const g=r(n),w=r(m);if(g!==w){const y=o(n,m);i(y,g,w);const b=y[0];if((Ut(b,d)||1)===p)return b}n+=f,m+=f}}}})(((a)=>(s)=>{const i=Or(a,s*Qp);return Ns(ed(i),parseInt(i.month),parseInt(i.day),parseInt(i.hour),parseInt(i.minute),parseInt(i.second))-s})(t))}getOffsetNanosecondsFor(t){return this.$.V(bl(t))*Pt}getPossibleInstantsFor(t){const[a,s]=[Ns((i=t).isoYear,i.isoMonth,i.isoDay,i.isoHour,i.isoMinute,i.isoSecond),i.isoMillisecond*xt+i.isoMicrosecond*Da+i.isoNanosecond];var i;return this.$.G(a).map((r)=>wt(La(Ia(r,Pt),s)))}l(t,a){const[s,i]=Pl(t),r=this.$.l(s+(a>0||i?1:0),a);if(r!==void 0)return Ia(r,Pt)}}var Bo="([+\u2212-])",$s="(?:[.,](\\d{1,9}))?",gu=`(?:(?:${Bo}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Ko="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+$s+")?)?",Yo=Bo+Ko,Rm=gu+"-?(\\d{2})(?:[T ]"+Ko+"(Z|"+Yo+")?)?",wu="\\[(!?)([^\\]]*)\\]",Hi=`((?:${wu}){0,9})`,Fm=Ja(gu+Hi),Cm=Ja("(?:--)?(\\d{2})-?(\\d{2})"+Hi),Mm=Ja(Rm+Hi),jm=Ja("T?"+Ko+"(?:"+Yo+")?"+Hi),xm=Ja(Yo),Zm=new RegExp(wu,"g"),Em=Ja(`${Bo}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${$s}H)?(?:(\\d+)${$s}M)?(?:(\\d+)${$s}S)?)?`),Lm=nt((t)=>new ia(du,{timeZone:t,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),Im=/^(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$/,Hm=nt(Pn),Xo=nt((t)=>new ia(du,{calendar:t,timeZone:Fa,era:"short",year:"numeric",month:"short",day:"numeric"})),$m=/^M(\d{2})(L?)$/,em={era:As,eraYear:V,year:V,month:_c,monthCode:As,day:_c},Am=Ga(Jt,V),Nm=Ga(D,gl),Yc=Object.assign({},em,Am,Nm,{offset:As}),_m=T(dn,Jt,Ft),Xc={dateAdd(t,a,s){const i=S(s);let r,{years:o,months:c,weeks:l,days:d}=a;if(d+=k(a,5)[0],o||c)r=((p,u,n,m,f)=>{let[h,g,w]=p.h(u);if(n){const[y,b]=p.I(h,g);h+=n,g=Js(y,b,p.U(h)),g=yt("month",g,1,p.L(h),f)}return m&&([h,g]=p._(h,g,m)),w=yt("day",w,1,p.j(h,g),f),p.q(h,g,w)})(this,t,o,c,i);else{if(!l&&!d)return t;r=st(t)}return r+=(7*l+d)*ut,Qt(Vs(r))},dateUntil(t,a,s){if(s<=7){let d=0,p=Hd({...t,...Tt},{...a,...Tt});return s===7&&([d,p]=Kt(p,7)),{...Q,weeks:d,days:p}}const i=this.h(t),r=this.h(a);let[o,c,l]=((d,p,u,n,m,f,h)=>{let g=m-p,w=f-u,y=h-n;if(g||w){const b=Math.sign(g||w);let P=d.j(m,f),v=0;if(Math.sign(y)===-b){const R=P;[m,f]=d._(m,f,-b),g=m-p,w=f-u,P=d.j(m,f),v=b<0?-R:P}if(y=h-Math.min(n,P)+v,g){const[R,C]=d.I(p,u),[x,e]=d.I(m,f);if(w=x-R||Number(e)-Number(C),Math.sign(w)===-b){const L=b<0&&-d.L(m);g=(m-=b)-p,w=f-Js(R,C,d.U(m))+(L||d.L(m))}}}return[g,w,y]})(this,...i,...r);return s===8&&(c+=this.J(o,i[0]),o=0),{...Q,years:o,months:c,days:l}},dateFromFields(t,a){const s=S(a),i=tr(this,t),r=ar(this,t,i,s),o=Qc(this,t,r,i,s);return _(Qt(this.P(i,r,o)),this.id||O)},yearMonthFromFields(t,a){const s=S(a),i=tr(this,t),r=ar(this,t,i,s);return ma(Sr(this.P(i,r,1)),this.id||O)},monthDayFromFields(t,a){const s=S(a),i=!this.id,{monthCode:r,year:o,month:c}=t;let l,d,p,u,n;if(r!==void 0){[l,d]=Wd(r),n=tl(t,"day");const m=this.N(l,d,n);if(!m)throw new RangeError(Bc);if([p,u]=m,c!==void 0&&c!==u)throw new RangeError(qp);i&&(u=yt("month",u,1,et,1),n=yt("day",n,1,vr(o!==void 0?o:p,u),s))}else{p=o===void 0&&i?$a:tr(this,t),u=ar(this,t,p,s),n=Qc(this,t,u,p,s);const m=this.U(p);d=u===m,l=cr(u,m);const f=this.N(l,d,n);if(!f)throw new RangeError(Bc);[p,u]=f}return _s(Qt(this.P(p,u,n)),this.id||O)},fields(t){return lr(this)&&t.includes("year")?[...t,...ur]:t},mergeFields(t,a){const s=Object.assign(Object.create(null),t);return sr(s,a,No),lr(this)&&(sr(s,a,Kn),this.id===Ha&&sr(s,a,Yn,ur)),s},inLeapYear(t){const[a]=this.h(t);return this.K(a)},monthsInYear(t){const[a]=this.h(t);return this.L(a)},daysInMonth(t){const[a,s]=this.h(t);return this.j(a,s)},daysInYear(t){const[a]=this.h(t);return this.X(a)},dayOfYear:Do,era(t){return this.ee(t)[0]},eraYear(t){return this.ee(t)[1]},monthCode(t){const[a,s]=this.h(t),[i,r]=this.I(a,s);return((o,c)=>"M"+bt(o)+(c?"L":""))(i,r)},dayOfWeek:vl,daysInWeek(){return 7}},Wm={dayOfYear:Do,h:Ol,q:Aa},qm=Object.assign({},Wm,{weekOfYear:Nd,yearOfWeek:_d,R(t){function a(f){return(7-f<i?7:0)-f}function s(f){const h=Dl(m+f),g=f||1,w=a(ss(d+h*g,7));return u=(h+(w-p)*g)/7}const i=this.id?1:4,r=vl(t),o=this.dayOfYear(t),c=ss(r-1,7),l=o-1,d=ss(c-l,7),p=a(d);let u,n=Math.floor((l-p)/7)+1,m=t.isoYear;return n?n>s(0)&&(n=1,m++):(n=s(-1),m--),[n,m,u]}}),km={dayOfYear:Do,h:or,q:cs,weekOfYear:Nd,yearOfWeek:_d,R(){return[]}},Ba=Sn(Object.assign({},Xc,qm,{h:Ol,ee(t){return this.id===ji?Rl(t):this.id===Ha?pm(t):[]},I:(t,a)=>[a,0],N(t,a){if(!a)return[$a,t]},K:Rr,U(){},L:Sl,J:(t)=>t*et,j:vr,X:Dl,P:(t,a,s)=>({isoYear:t,isoMonth:a,isoDay:s}),q:Aa,_:(t,a,s)=>(t+=Us(s,et),(a+=gr(s,et))<1?(t--,a+=et):a>et&&(t++,a-=et),[t,a]),year(t){return t.isoYear},month(t){return t.isoMonth},day:(t)=>t.isoDay}),Object.assign({},Xc,km,{h:or,ee(t){const a=this.O(t);return[a.era,a.eraYear]},I(t,a){const s=Es.call(this,t);return[cr(a,s),s===a]},N(t,a,s){let[i,r,o]=or.call(this,{isoYear:$a,isoMonth:et,isoDay:31});const c=Es.call(this,i),l=r===c;(Ut(t,cr(r,c))||Ut(Number(a),Number(l))||Ut(s,o))===1&&i--;for(let d=0;d<100;d++){const p=i-d,u=Es.call(this,p),n=Js(t,a,u);if(a===(n===u)&&s<=Gc.call(this,p,n))return[p,n]}},K(t){const a=Ls.call(this,t);return a>Ls.call(this,t-1)&&a>Ls.call(this,t+1)},U:Es,L:Is,J(t,a){const s=a+t,i=Math.sign(t),r=i<0?-1:0;let o=0;for(let c=a;c!==s;c+=i)o+=Is.call(this,c+r);return o},j:Gc,X:Ls,P(t,a,s){return Vs(cs.call(this,t,a,s))},q:cs,_(t,a,s){if(s){if(a+=s,!Number.isSafeInteger(a))throw new RangeError(vi);if(s<0)for(;a<1;)a+=Is.call(this,--t);else{let i;for(;a>(i=Is.call(this,t));)a-=i,t++}}return[t,a]},year(t){return this.O(t).year},month(t){const{year:a,F:s}=this.O(t),{C:i}=this.B(a);return i[s]+1},day(t){return this.O(t).day}})),Bt="numeric",Ka=["timeZoneName"],yu={month:Bt,day:Bt},Vo={year:Bt,month:Bt},tc=Object.assign({},Vo,{day:Bt}),ac={hour:Bt,minute:Bt,second:Bt},sc=Object.assign({},tc,ac),Jm=Object.assign({},sc,{timeZoneName:"short"}),zm=Object.keys(Vo),Gm=Object.keys(yu),Um=Object.keys(tc),Qm=Object.keys(ac),ic=["dateStyle"],Bm=zm.concat(ic),Km=Gm.concat(ic),rc=Um.concat(ic,["weekday"]),Ds=Qm.concat(["dayPeriod","timeStyle"]),oc=rc.concat(Ds),Ym=oc.concat(Ka),Xm=Ka.concat(Ds),Vm=Ka.concat(rc),tf=Ka.concat(["day","weekday"],Ds),af=Ka.concat(["year","weekday"],Ds),sf={},cc=[Sa(oc,sc),ri],bu=[Sa(Ym,Jm),ri,0,(t,a)=>{const s=U(t.timeZone);if(a&&U(a.timeZone)!==s)throw new RangeError(Jp);return s}],lc=[Sa(oc,sc,Ka),st],dc=[Sa(rc,tc,Xm),st],pc=[Sa(Ds,ac,Vm),(t)=>Yt(t)/xt],uc=[Sa(Bm,Vo,tf),st,1],nc=[Sa(Km,yu,af),st,1],Vc;var df={Instant:cc,PlainDateTime:lc,PlainDate:dc,PlainTime:pc,PlainYearMonth:uc,PlainMonthDay:nc},pf=qt(cc),uf=qt(bu),nf=qt(lc),mf=qt(dc),ff=qt(pc),hf=qt(uc),gf=qt(nc),wc={era:pl,eraYear:wr,year:ns,month:St,daysInMonth:St,daysInYear:St,inLeapYear:iu,monthsInYear:St},Ni={monthCode:I},yc={day:St},ju={dayOfWeek:St,dayOfYear:St,weekOfYear:ul,yearOfWeek:wr,daysInWeek:St},xu=Object.assign({},wc,Ni,yc,ju),Ai=new WeakMap,X=Ai.get.bind(Ai),Su=Ai.set.bind(Ai),wf={...$i(wc,[Ua]),...$i(ju,[]),...$i(Ni,[Ua,Qa]),...$i(yc,[Qa])},bc=hc(xu),yf=hc({...wc,...Ni}),bf=hc({...Ni,...yc}),Cs={calendarId:(t)=>U(t.calendar)},Pf=Ot((t,a)=>function(s){const{i}=this;return t(i[a]($(_(s,i))))},xu),Tf=ps((t)=>(a)=>a[t],D.concat("sign")),Pc=ps((t,a)=>(s)=>s[Ft[a]],Jt),Zu={epochSeconds:El,epochMilliseconds:ri,epochMicroseconds:Ll,epochNanoseconds:Il},Ms=T(fr,new Set(["branding"])),[Of,Va,Sf]=Lt(Qa,T(pp,Y),{...Cs,...bf},{getISOFields:Ms,getCalendar:Rs,with(t,a,s){return Va(tp(ef,t,this,ts(a),s))},equals:(t,a)=>jd(t,Pu(a)),toPlainDate(t,a){return $(Dp(js,t,this,a))},toLocaleString(t,a,s){const[i,r]=gf(a,s,t);return i.format(r)},toString:Wr,toJSON:(t)=>Wr(t),valueOf:da},{from:(t,a)=>Va(Pu(t,a))}),Eu={getOffsetNanosecondsFor:Fu,getPossibleInstantsFor(t,a,s){const i=[...a.call(t,K(N(s,O)))].map((o)=>vf(o).epochNanoseconds),r=i.length;return r>1&&(i.sort(at),Ur(gt(ht(i[0],i[r-1])))),i}},fc={getOffsetNanosecondsFor:Fu},[Df,ot,vf]=Lt(Ei,rp,Zu,{add:(t,a)=>ot(Qr(0,t,H(a))),subtract:(t,a)=>ot(Qr(1,t,H(a))),until:(t,a,s)=>j(wo(0,t,Zt(a),s)),since:(t,a,s)=>j(wo(1,t,Zt(a),s)),round:(t,a)=>ot(el(t,a)),equals:(t,a)=>vd(t,Zt(a)),toZonedDateTime(t,a){const s=_t(a);return W(jo(t,Z(s.timeZone),Y(s.calendar)))},toZonedDateTimeISO:(t,a)=>W(jo(t,Z(a))),toLocaleString(t,a,s){const[i,r]=pf(a,s,t);return i.format(r)},toString:(t,a)=>$r(Z,q,t,a),toJSON:(t)=>$r(Z,q,t),valueOf:da},{from:(t)=>ot(Zt(t)),fromEpochSeconds:(t)=>ot(Fp(t)),fromEpochMilliseconds:(t)=>ot(Cp(t)),fromEpochMicroseconds:(t)=>ot(Mp(t)),fromEpochNanoseconds:(t)=>ot(jp(t)),compare:(t,a)=>fo(Zt(t),Zt(a))}),[_i,Xf]=Lt("TimeZone",(t)=>{const a=Sd(t);return{branding:"TimeZone",id:a,o:Ii(a)}},{id:(t)=>t.id},{getPossibleInstantsFor:({o:t},a)=>t.getPossibleInstantsFor(oa(a)).map((s)=>ot(z(s))),getOffsetNanosecondsFor:({o:t},a)=>t.getOffsetNanosecondsFor(Zt(a).epochNanoseconds),getOffsetStringFor(t,a){const s=Zt(a).epochNanoseconds,i=ei(this,fc).getOffsetNanosecondsFor(s);return ya(i)},getPlainDateTimeFor(t,a,s=O){const i=Zt(a).epochNanoseconds,r=ei(this,fc).getOffsetNanosecondsFor(i);return K(N(Vt(i,r),Y(s)))},getInstantFor(t,a,s){const i=oa(a),r=Fr(s),o=ei(this);return ot(z(mt(o,i,r)))},getNextTransition:({o:t},a)=>Tu(1,t,a),getPreviousTransition:({o:t},a)=>Tu(-1,t,a),equals(t,a){return!!Pi(this,Z(a))},toString:(t)=>t.id,toJSON:(t)=>t.id},{from(t){const a=Z(t);return typeof a=="string"?new _i(a):a}}),Rf=Ru(Object.keys(Eu)),[Ff,ca]=Lt(Zi,up,Pc,{getISOFields:Ms,with(t,a,s){return ca(ap(this,ts(a),s))},add:(t,a)=>ca(Vr(0,t,H(a))),subtract:(t,a)=>ca(Vr(1,t,H(a))),until:(t,a,s)=>j(Oo(0,t,ra(a),s)),since:(t,a,s)=>j(Oo(1,t,ra(a),s)),round:(t,a)=>ca(_l(t,a)),equals:(t,a)=>xd(t,ra(a)),toZonedDateTime:(t,a)=>W(vp(Z,ct,M,t,a)),toPlainDateTime:(t,a)=>K(Rp(t,ct(a))),toLocaleString(t,a,s){const[i,r]=ff(a,s,t);return i.format(r)},toString:qr,toJSON:(t)=>qr(t),valueOf:da},{from:(t,a)=>ca(ra(t,a)),compare:(t,a)=>bi(ra(t),ra(a))}),[Cf,la,Mf]=Lt(Ua,T(dp,Y),{...Cs,...yf},{getISOFields:Ms,getCalendar:Rs,with(t,a,s){return la(Vd($f,t,this,ts(a),s))},add:(t,a,s)=>la(Xr(Du,0,t,H(a),s)),subtract:(t,a,s)=>la(Xr(Du,1,t,H(a),s)),until:(t,a,s)=>j(To(vu,0,t,Ya(a),s)),since:(t,a,s)=>j(To(vu,1,t,Ya(a),s)),equals:(t,a)=>Md(t,Ya(a)),toPlainDate(t,a){return $(Sp(js,t,this,a))},toLocaleString(t,a,s){const[i,r]=hf(a,s,t);return i.format(r)},toString:_r,toJSON:(t)=>_r(t),valueOf:da},{from:(t,a)=>la(Ya(t,a)),compare:(t,a)=>Ta(Ya(t),Ya(a))}),[jf,K]=Lt(Ra,T(cp,Y),{...Cs,...bc,...Pc},{getISOFields:Ms,getCalendar:Rs,with(t,a,s){return K(Yd(js,t,this,ts(a),s))},withCalendar:(t,a)=>K(Di(t,Y(a))),withPlainDate:(t,a)=>K(Lp(t,ct(a))),withPlainTime:(t,a)=>K(Ep(t,gc(a))),add:(t,a,s)=>K(Kr(Ca,0,t,H(a),s)),subtract:(t,a,s)=>K(Kr(Ca,1,t,H(a),s)),until:(t,a,s)=>j(bo(Et,0,t,oa(a),s)),since:(t,a,s)=>j(bo(Et,1,t,oa(a),s)),round:(t,a)=>K(Nl(t,a)),equals:(t,a)=>Fd(t,oa(a)),toZonedDateTime:(t,a,s)=>W(gp(M,t,Z(a),s)),toPlainDate:(t)=>$(_(t)),toPlainTime:(t)=>ca(vt(t)),toPlainYearMonth(t){return la(wp(Wi,t,this))},toPlainMonthDay(t){return Va(yp(ki,t,this))},toLocaleString(t,a,s){const[i,r]=nf(a,s,t);return i.format(r)},toString:Ar,toJSON:(t)=>Ar(t),valueOf:da},{from:(t,a)=>K(oa(t,a)),compare:(t,a)=>go(oa(t),oa(a))}),[xf,$,Lu]=Lt(va,T(lp,Y),{...Cs,...bc},{getISOFields:Ms,getCalendar:Rs,with(t,a,s){return $(Xd(js,t,this,ts(a),s))},withCalendar:(t,a)=>$(Di(t,Y(a))),add:(t,a,s)=>$(Yr(Ca,0,t,H(a),s)),subtract:(t,a,s)=>$(Yr(Ca,1,t,H(a),s)),until:(t,a,s)=>j(Po(Et,0,t,ct(a),s)),since:(t,a,s)=>j(Po(Et,1,t,ct(a),s)),equals:(t,a)=>Cd(t,ct(a)),toZonedDateTime(t,a){const s=!J(a)||a instanceof _i?{timeZone:a}:a;return W(bp(Z,ra,M,t,s))},toPlainDateTime:(t,a)=>K(Pp(t,gc(a))),toPlainYearMonth(t){return la(Tp(Wi,t,this))},toPlainMonthDay(t){return Va(Op(ki,t,this))},toLocaleString(t,a,s){const[i,r]=mf(a,s,t);return i.format(r)},toString:Nr,toJSON:(t)=>Nr(t),valueOf:da},{from:(t,a)=>$(ct(t,a)),compare:(t,a)=>Ta(ct(t),ct(a))}),Tc={fields(t,a,s){return[...a.call(t,s)]}},Iu=Object.assign({dateFromFields(t,a,s,i){return Lu(a.call(t,Object.assign(Object.create(null),s),i))}},Tc),Hu=Object.assign({yearMonthFromFields(t,a,s,i){return Mf(a.call(t,Object.assign(Object.create(null),s),i))}},Tc),$u=Object.assign({monthDayFromFields(t,a,s,i){return Sf(a.call(t,Object.assign(Object.create(null),s),i))}},Tc),Oc={mergeFields(t,a,s,i){return _t(a.call(t,Object.assign(Object.create(null),s),Object.assign(Object.create(null),i)))}},Zf=Object.assign({},Iu,Oc),Ef=Object.assign({},Hu,Oc),Lf=Object.assign({},$u,Oc),Sc={dateAdd(t,a,s,i,r){return Lu(a.call(t,$(_(s,t)),j(E(i)),r))}},eu=Object.assign({},Sc,{dateUntil(t,a,s,i,r,o){return Nf(a.call(t,$(_(s,t)),$(_(i,t)),Object.assign(Object.create(null),o,{largestUnit:Ps[r]})))}}),If=Object.assign({},Sc,{day:Cu}),Hf=Object.assign({},eu,{day:Cu}),Wi=It(Hu),qi=It(Iu),ki=It($u),$f=It(Ef),js=It(Zf),ef=It(Lf),Ca=It(Sc),Et=It(eu),Du=It(If),vu=It(Hf),[Af,j,Nf]=Lt(Li,np,{...Tf,blank:id},{with:(t,a)=>j(sp(t,a)),negated:(t)=>j(fi(t)),abs:(t)=>j(sd(t)),add:(t,a,s)=>j(ro(vs,Et,M,0,t,H(a),s)),subtract:(t,a,s)=>j(ro(vs,Et,M,1,t,H(a),s)),round:(t,a)=>j(ad(vs,Et,M,t,a)),total:(t,a)=>$l(vs,Et,M,t,a),toLocaleString(t,a,s){return Intl.DurationFormat?new Intl.DurationFormat(a,s).format(this):di(t)},toString:di,toJSON:(t)=>di(t),valueOf:da},{from:(t)=>j(H(t)),compare:(t,a,s)=>Dd(vs,Ca,M,H(t),H(a),s)}),Au={toString:(t)=>t.id,toJSON:(t)=>t.id,...wf,dateAdd:({id:t,o:a},s,i,r)=>$(_(a.dateAdd(ct(s),H(i),r),t)),dateUntil:({o:t},a,s,i)=>j(E(t.dateUntil(ct(a),ct(s),Cl(i)))),dateFromFields:({id:t,o:a},s,i)=>$(vo(a,s,i,dl(t))),yearMonthFromFields:({id:t,o:a},s,i)=>la(Ro(a,s,i,cl(t))),monthDayFromFields:({id:t,o:a},s,i)=>Va(Fo(a,0,s,i,ll(t))),fields({o:t},a){const s=new Set(Rt),i=[];for(let r of a){if(I(r),!s.has(r))throw new RangeError(Ho(r));s.delete(r),i.push(r)}return t.fields(i)},mergeFields:({o:t},a,s)=>t.mergeFields(hr(yr(a)),hr(yr(s)))},[Dc]=Lt("Calendar",(t)=>{const a=Ad(t);return{branding:"Calendar",id:a,o:Ba(a)}},{id:(t)=>t.id},Au,{from(t){const a=Y(t);return typeof a=="string"?new Dc(a):a}}),_f=Ru(Object.keys(Au).slice(4)),[Wf,W]=Lt(zt,T(op,Y,Z),{...Zu,...Cs,...Ou(bc),...Ou(Pc),offset:(t)=>ya(mc(t).offsetNanoseconds),offsetNanoseconds:(t)=>mc(t).offsetNanoseconds,timeZoneId:(t)=>U(t.timeZone),hoursInDay:(t)=>Wl(M,t)},{getISOFields:(t)=>Vl(q,t),getCalendar:Rs,getTimeZone:({timeZone:t})=>typeof t=="string"?new _i(t):t,with(t,a,s){return W(Kd(js,M,t,this,ts(a),s))},withCalendar:(t,a)=>W(Di(t,Y(a))),withTimeZone:(t,a)=>W(Ip(t,Z(a))),withPlainDate:(t,a)=>W(Zp(M,t,ct(a))),withPlainTime:(t,a)=>W(xp(M,t,gc(a))),add:(t,a,s)=>W(Br(Ca,M,0,t,H(a),s)),subtract:(t,a,s)=>W(Br(Ca,M,1,t,H(a),s)),until:(t,a,s)=>j(E(yo(Et,M,0,t,Xa(a),s))),since:(t,a,s)=>j(E(yo(Et,M,1,t,Xa(a),s))),round:(t,a)=>W(Al(M,t,a)),startOfDay:(t)=>W(ql(M,t)),equals:(t,a)=>Rd(t,Xa(a)),toInstant:(t)=>ot(mp(t)),toPlainDateTime:(t)=>K(xo(q,t)),toPlainDate:(t)=>$(Zo(q,t)),toPlainTime:(t)=>ca(Eo(q,t)),toPlainYearMonth(t){return la(fp(Wi,t,this))},toPlainMonthDay(t){return Va(hp(ki,t,this))},toLocaleString(t,a,s={}){const[i,r]=uf(a,s,t);return i.format(r)},toString:(t,a)=>er(q,t,a),toJSON:(t)=>er(q,t),valueOf:da},{from:(t,a)=>W(Xa(t,a)),compare:(t,a)=>ho(Xa(t),Xa(a))}),qf=Object.defineProperties({},{...Gs("Temporal.Now"),...ha({timeZoneId:()=>kt(),instant:()=>ot(z(ws())),zonedDateTime:(t,a=kt())=>W(B(ws(),Z(a),Y(t))),zonedDateTimeISO:(t=kt())=>W(B(ws(),Z(t),O)),plainDateTime:(t,a=kt())=>K(N(za(q(Z(a))),Y(t))),plainDateTimeISO:(t=kt())=>K(N(za(q(Z(t))),O)),plainDate:(t,a=kt())=>$(_(za(q(Z(a))),Y(t))),plainDateISO:(t=kt())=>$(_(za(q(Z(t))),O)),plainTimeISO:(t=kt())=>ca(vt(za(q(Z(t)))))})}),Ma=Object.defineProperties({},{...Gs("Temporal"),...ha({PlainYearMonth:Cf,PlainMonthDay:Of,PlainDate:xf,PlainTime:Ff,PlainDateTime:jf,ZonedDateTime:Wf,Instant:Df,Calendar:Dc,TimeZone:_i,Duration:Af,Now:qf})}),kf=rf(),vc=new WeakMap,Jf=Object.defineProperties(Object.create(Intl),ha({DateTimeFormat:kf}));class ja extends Error{constructor(){super("Adapter not found");this.name="AdapterNotFound"}}class Rc{createSession(){throw new ja}deleteSession(){throw new ja}findSession(){throw new ja}findUserByEmailAddress(){throw new ja}updateSession(){throw new ja}createUser(){throw new ja}}class qu extends lt{constructor(){super(...arguments)}schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class ku extends lt{constructor(){super(...arguments)}schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{required:"Password is required","min:8":"Password must be at least 8 characters"}}}class Ju extends lt{constructor(){super(...arguments)}schema={email:{required:"Email is required",email:"Invalid email"}}}class zu extends lt{constructor(){super(...arguments)}schema={password:{required:"Password is required",password:"Invalid password"}}}class ua extends Nu{constructor(){super(...arguments)}provider=Gt.getStore().authenticationServiceContainer.provider;async me(){const t=await Ji.user();if(!t)throw new Wu;return t}async signIn(t=new qu){const a=await t.input.call(t),{email:s,password:i}=a.toJSON(),r=await this.provider.adapter.findUserByEmailAddress(s);if(!r)throw new pa({invalid_credentials:["Invalid credentials"]});if(!await this.provider.verifyPassword(i,r.password))throw new pa({invalid_credentials:["Invalid credentials"]});const c=t.headers.get("User-Agent"),l=new Bun.CryptoHasher("sha256");l.update(`${r.email}${c}`);const d=l.digest("hex");let p=await this.provider.adapter.findSession({token:d,userAgent:"local"});if(!p)p=await this.provider.adapter.createSession({token:d,userId:r.id,userAgent:"local",expiresAt:new Date(Ma.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString()),absoluteExpiresAt:new Date(Ma.Now.instant().add({hours:this.provider.sessionAbsoluteExpiresInHours}).toString())});else p=await this.provider.adapter.updateSession({token:d,expiresAt:new Date(Ma.Now.instant().add({hours:this.provider.sessionExpiresInHours}).toString())});return t.ctx.setCookie("access_token",p.token,{expires:p.expiresAt}),await this.provider.onSignIn(r),r}async signUp(t=new ku){const a=await t.input(),{email:s,password:i,name:r}=a.toJSON();if(await this.provider.adapter.findUserByEmailAddress(s))throw new pa({email:["Email address already exists"]});const c=await this.provider.hashPassword(i),l=await this.provider.adapter.createUser({email:s,name:r,password:c});return await this.provider.onSignUp(l),l}async signOut(t=new lt){const a=t.cookies.get("access_token"),s=await Ji.user();return await this.provider.adapter.deleteSession({token:a}),t.ctx.setCookie("access_token","",{expires:new Date(0)}),await this.provider.onSignOut(s),{}}async forgotPassword(t=new Ju){const a=await t.input(),{email:s}=a.toJSON(),i=await this.provider.adapter.findUserByEmailAddress(s);if(!i)return{};const r=await this.provider.generateForgotPasswordToken(i);return await this.provider.adapter.createPasswordResetToken({user:i,token:r}),await this.provider.onForgotPassword(i,r),{}}async resetPassword(t=new zu){const a=await t.input(),{password:s,token:i}=a.toJSON(),r=await this.provider.adapter.findPasswordResetToken({token:i});if(!r)throw new pa({token:["Invalid token"]});if(Ma.Instant.from(r.createdAt.toISOString()).add({hours:24}).until(Ma.Now.instant()).sign>=0)throw new pa({token:["Token expired"]});await this.provider.adapter.deletePasswordResetToken({token:i});const c=await this.provider.adapter.findUserByEmailAddress(r.user.email);if(!c)throw new pa({email:["User not found"]});const l=await this.provider.hashPassword(s);return await this.provider.adapter.updateUserPassword({id:c.id,password:l}),await this.provider.adapter.deleteAllUserSessions(c.id),await this.provider.onResetPassword(c),{}}async changePassword(t=new lt){const a=await Ji.user(),s=await t.input(),{oldPassword:i,newPassword:r}=s.toJSON(),{password:o}=await this.provider.adapter.findUserByEmailAddress(a.email);if(!await this.provider.verifyPassword(i,o))throw new pa({oldPassword:["Incorrect password"]});const l=await this.provider.hashPassword(r);return await this.provider.adapter.updateUserPassword({id:a.id,password:l}),await this.provider.adapter.deleteAllUserSessions(a.id),{}}}class Gu extends zi{constructor(){super(...arguments)}routes={"/sign-in":this.post(ua,"signIn"),"/sign-up":this.post(ua,"signUp"),"/sign-out":this.post(ua,"signOut"),"/forgot-password":this.post(ua,"forgotPassword"),"/reset-password":this.post(ua,"resetPassword"),"/change-password":this.post(ua,"changePassword"),"/me":this.get(ua,"me")}}class Uu extends _u{constructor(){super(...arguments)}routes={"/sign-in":this.view("auth/SignIn"),"/sign-up":this.view("auth/SignUp"),"/reset-password":this.view("auth/ResetPassword"),"/forgot-password":this.view("auth/ForgotPassword")}}class Gi{basePath="/auth";routers={api:Gu,view:Uu};sessionExpiresInHours=24;sessionAbsoluteExpiresInHours=672;adapter=new Rc;async verifyPassword(t,a){return await Bun.password.verify(t,a)}async hashPassword(t){return await Bun.password.hash(t)}async generateForgotPasswordToken(t){const a=new Bun.CryptoHasher("sha256");return a.update(`${t.email}${Date.now()}`),a.digest("hex")}extendSession(t){return{}}onSignUp(t){}onSignIn(t){}onSignOut(t){}onForgotPassword(t,a){}onResetPassword(t){}}class Fc{t;constructor(t){this.provider=t}async getSession(t,a){const s=await this.provider.adapter.findSession({token:t,userAgent:a});let i=null;if(s?.user)i=await this.provider.extendSession(s.user),s.user.extension=i;return s}}class Qu extends zi{constructor(){super(...arguments)}routes={"/translations":this.get(async()=>{const t=new lt,{scope:a,locale:s}=t.search.toJSON(),i=s??Gt.getStore().i18nServiceContainer.detectLocale(t),r=Gt.getStore().i18nServiceContainer.getPageTranslations(i,a);return t.ctx.setHeaders("Cache-Control",t.ctx.user?"private, max-age=1200, must-revalidate":"public, max-age=864000, must-revalidate"),t.ctx.setCookie("i18n-locale",i,{expires:new Date(Date.now()+31536000000)}),{[i]:r}})}}class Cc{t;constructor(t){this.service=t}isEnabled=!1;translations=new Map;supportedLocales=[];routers={api:Qu};boot(){const t=new Map;for(let[s,i]of Object.entries(this.service.dictionary))for(let[r,o]of Object.entries(i))for(let[c,l]of Object.entries(o)){const d=c==="default"?this.service.defaultLocale:c;if(!t.has(`${d}.${s}`))t.set(`${d}.${s}`,new Map);t.get(`${d}.${s}`)?.set(r,l),this.isEnabled=!0}let a=new Set;for(let[s,i]of t.entries())this.translations.set(s,Object.fromEntries(i.entries())),a.add(s.split(".")[0]);this.supportedLocales=Array.from(a)}detectLocale(t){const a=this.service.detectLocale(t);if(this.supportedLocales.includes(a))return a;const i=t.cookies.get("i18n-locale")??(t.headers.get("accept-language")||"en-US"),[r]=i.split(",");if(this.supportedLocales.includes(r))return r;const o=this.service.defaultLocale??this.supportedLocales[0];if(o)return o;return"en-US"}getPageTranslations(t,a){if(!a)return{};const s=this.translations.get(`${t}.view:${a}`)??{},i={[`view:${a}`]:s};for(let[r]of this.translations.entries()){const o=r.split(".")[1];if(!o.startsWith("layout:"))continue;const c=o.split(":")[1];if(a?.startsWith(c))i[o]=this.translations.get(`${t}.${o}`)??{}}return i}}class Mc{t;constructor(t){this.service=t}}class jc{t;constructor(t){this.service=t}getRouteHandlerAndParams(t){const s=new URL(t.url).pathname.replace("/api","");let i={},r;for(let[o]of Object.entries(this.service.flatRoutes))try{const c=new URLPattern({pathname:o});if(c.test({pathname:s})){r=o,i=c.exec({pathname:s})?.pathname.groups;break}}catch(c){console.error(c)}return{params:i,path:r}}async runRouteMiddleware(t){const a=Ht.getStore(),i=this.service.flatRoutes[t][a.req.rawRequest.method].middleware;try{await Ui.getContext().middlewareServiceContainer.runMiddleware(i,t)}catch(r){if(r.kind===xs){if(a.req.rawRequest.url.includes("/api")){const{status:o=400,data:c,headers:l}=r.payload.api;return new Response(JSON.stringify(c),{status:o,headers:{"Content-Type":"application/json",...l}})}}else throw console.error(r),r}}async getRouteData(t){const a=this.service.flatRoutes[t],s=Ht.getStore(),i=a[s.req.rawRequest.method].exec??(()=>Promise.resolve({}));let r={};try{r=await i()}catch(o){if(o.kind===xs){const{status:c=400,data:l,headers:d}=o.payload.api;return new Response(JSON.stringify(l),{status:c,headers:{"Content-Type":"application/json",...d}})}else throw console.error(o),o}return r}async handleApiRequest(t){const{params:a,path:s}=this.getRouteHandlerAndParams(t),i=this.service.flatRoutes[s];if(!i||!i[t.method])return new Response(JSON.stringify({error:{message:"Not found"}}),{status:404});const r=new lt(t,a);return await Ht.run(r,async()=>{const o=await this.runRouteMiddleware(s);if(o instanceof Response)return o;const c=await this.getRouteData(s);if(c instanceof Response)return c;const l=Ht.getStore(),d=l.headers;if(d.append("Content-Type","application/json"),!d.get("Cache-Control"))if(l.user)d.set("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");else d.set("Cache-Control","public, no-cache, no-store, max-age=0, must-revalidate");return l.cookies.forEach((p)=>d.append("Set-Cookie",p.toString())),l.destroy(),new Response(JSON.stringify(c),{headers:d})})}}var zf=function(t){return Qi(t)};function xc(t){const a={};for(let[s,i]of Object.entries(t))if("run"in i){const r=i;if(!a[s])a[s]={};const{method:o,middlewares:c}=r,l=r.run.bind(r);a[s][o]={exec:l,middleware:c}}else if(zf(i)){const r=new i,o=xc(r.routes);for(let[c,l]of Object.entries(o)){const d=c==="/"?"":c,p=s==="/"?"":s,u=`${p}${d}`===""?"/":`${p}${d}`;if(!a[u])a[u]={};for(let[n,m]of Object.entries(l))a[u][n]={exec:m.exec,middleware:[r.middleware,...r.middlewares,...m.middleware]}}}else for(let r of Object.values(i)){if(!a[s])a[s]={};const{method:o,middlewares:c}=r,l=r.run.bind(r);a[s][o]={exec:l,middleware:c}}return Object.fromEntries(Object.entries(a).sort(([s],[i])=>{const r=s.split("/").length+s.split(":").length,o=i.split("/").length+i.split(":").length;return r-o}))}class Zc extends Bi{constructor(){super(...arguments)}flatRoutes={};boot(t){this.flatRoutes=xc(t)}}var Gf=function(t){const a=new Map;for(let s of t)if(typeof s==="string"){const[i,r=""]=s.split(":");if(i.startsWith("-")){if(a.has(i.replace("-","")))a.delete(i.replace("-",""))}else a.set(i,r.split(","))}else a.set(s,[]);return a};class Ec{t;constructor(t){this.service=t}runMiddleware(t,a){const s=Ht.getStore().req;return Array.from(Gf(t).entries()).map(([i,r])=>{if(typeof i==="string"){const o=this.service.aliases[i];if(o){const c=new o(a);return(l)=>c.run.call(c,l,...r)}}else{if(Qi(i)){const o=new aliasOrTest(a);return o.run.bind(o)}return i}}).filter(Boolean).reduce((i,r)=>{return async(o,c)=>{return{...await i(o,c),...await r(o,c)}}},(i)=>Promise.resolve({}))(s)}}class Lc{t;constructor(t){this.service=t}}import{AsyncLocalStorage as Uf} from"async_hooks";class Ic extends Bu{t;name="broadcastingServiceContainer";publishCb;context=new Uf;constructor(t){super();this.service=t}onPublish(t){this.publishCb=t}publish(...t){const[a,s,i]=t;this.publishCb(a,s,i)}async handleMessage(t,a){const s=JSON.parse(a);if(s.type==="subscribe"){const i=Object.entries(this.service.channels).sort(([r],[o])=>r.length-o.length);for(let[r,o]of i){const c=new URLPattern({pathname:r});if(c.test({pathname:s.topic})){const l=c.exec({pathname:s.topic})?.pathname.groups,d=new o;if(await d.subscribe.call(d,l))t.subscribe(s.topic)}break}}if(s.type==="broadcast")t.publish(s.topic,JSON.stringify({topic:s.topic,data:s.payload}));if(s.type==="unsubscribe")t.unsubscribe(s.topic)}run(t,a){const s=t.get("Cookie"),i=new Map;if(s){const r=s.split(";");for(let o of r){const[c,l]=o.split("=");i.set(c.trim(),l.trim())}}this.context.run({headers:t,cookies:i},a)}}import{renderToReadableStream as Qf} from"react-dom/server.browser";import{createElement as Ku,Fragment as Bf} from"react";class Hc{t;constructor(t){this.service=t}async handleViewRequest(t){const a=new URL(t.url),s=a.searchParams.get("json");let i=null;try{let w=[],y=[],b=null,P={};for(let[G,Ct]of Object.entries(this.service.flatViewRoutes)){const xa=new Yu({pathname:G});if(xa.test({pathname:a.pathname})){b=G,P=xa.exec({pathname:a.pathname})?.pathname.groups,w=Ct.exec,y=Ct.middleware;break}}const v=new lt(t,P),{data:R,cookies:C,headers:x,user:e,prefetchedData:L}=await Ht.run(v,async()=>{const G=Ht.getStore();G.setRequest(v),await Gt.getStore().middlewareServiceContainer.runMiddleware(y,b);const Ct=await Promise.all([...w.map((Vi)=>Vi(v)),...Array.from(G.prefetchPromiseQueue).map((Vi)=>Vi())]),xa=G.cookies,$t=G.headers,ln=G.prefetchedResources;return{data:Ct,cookies:xa,headers:$t,user:G.user,prefetchedData:Object.fromEntries(ln.entries())}});i={data:R,prefetchedData:L,currentPathName:b,user:e,params:P,cookies:C,headers:x}}catch(w){if(w.kind===xs)if(s){const{status:y=400,data:b,directive:P,headers:v}=w.payload.api;return new Response(JSON.stringify({data:b,directive:P}),{headers:v,status:y})}else{const{status:y=400,error:b}=w.payload.view;return new Response(b?.message,{...w.payload.view,status:y})}else throw w}const{data:r,params:o,currentPathName:c,user:l,cookies:d}=i,p=r.reduce((w,y)=>{return{...w,...y}},{}),u=Gt.getStore().i18nServiceContainer,n=Gt.getStore().i18nServiceContainer.isEnabled;let m={};if(n){const w=u.detectLocale(new lt(t,o)),y=u.getPageTranslations(w,c);m={supportedLocales:u.supportedLocales,currentLocale:w,dictionary:{[w]:y}}}if(s){const w=new Headers;return w.set("Content-Type","application/json"),d.forEach((y)=>w.append("Set-Cookie",y.toString())),w.append("Cache-Control",l?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),new Response(JSON.stringify({data:{[a.pathname]:p},prefetchedData:i.prefetchedData,i18n:m,is404:!c}),{headers:w})}const f=new Headers;f.set("Content-Type","text/html"),f.set("Cache-Control",l?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),f.set("ETag",'W/"'+Math.random().toString(36).substring(7)+'"'),i.cookies.forEach((w)=>f.append("Set-Cookie",w.toString()));const h={kind:"view",data:{pageData:{[a.pathname]:p},prefetchedData:i.prefetchedData,i18n:m,auth:{user:l},routeManifest:this.service.routeManifest,router:{pathname:c,params:o,currentPath:a.pathname,searchParams:a.search,is404:!c?!0:!1},componentTree:[["404",[]],...this.service.componentTree]},head:{}},g=this.service.RootLayout;return async(w)=>{const{bootstrapModules:y,loaders:b,styles:P,viewImportMap:v}=w,R=await Qf(Ku(Bf,{children:[P,Ku(g,{data:h.data,viewImportMap:v})]}),{bootstrapScriptContent:`window.__GEMI_DATA__ = ${JSON.stringify(h.data)}; window.loaders=${b}`,bootstrapModules:y});return new Response(R,{status:!c?404:200,headers:f})}}}function $c(t){let a=[];for(let[s,i]of t)a.push(s,...$c(i).flat());return Array.from(new Set(a))}function Ki(t){const a=[];for(let[s,i]of Object.entries(t))if("run"in i){const r=i.viewPath;if("children"in i){const o=new i.children,c=Ki(o.routes);a.push([r,c])}else a.push([r,[]])}else{const r=new i,o=Ki(r.routes);a.push(...o)}return a}function Yi(t){const a={};for(let[s,i]of Object.entries(t))if("run"in i){const r=i;if("children"in r){const o=new r.children,c=Yi(o.routes);for(let[l,{exec:d,middleware:p}]of Object.entries(c)){const u=s==="/"?l:`${s}${l}`,n=l==="/"&&s!=="/"?s:u;a[n]={exec:[r.run.bind(r),...d],middleware:[...r.middlewares,...p]}}}else a[s]={exec:[r.run.bind(r)],middleware:r.middlewares}}else{const r=new i,o=Yi(r.routes);for(let[c,{exec:l,middleware:d}]of Object.entries(o)){const p=s==="/"?c:`${s}${c}`,u=c==="/"&&s!=="/"?s:p;a[u]={exec:l,middleware:[...r.middlewares,...d]}}}return Object.fromEntries(Object.entries(a).sort(([s],[i])=>{const r=s.split("/").length+s.split(":").length,o=i.split("/").length+i.split(":").length;return r-o}))}function Xi(t){const a={};for(let[s,i]of Object.entries(t))if("run"in i){const r=i.viewPath;if("children"in i)a[s]=[r];if("children"in i){const o=new i.children,c=Xi(o.routes);for(let[l,d]of Object.entries(c)){const p=s==="/"?l:`${s}${l}`,u=l==="/"&&s!=="/"?s:p;a[u]=[r,...d]}}else a[s]=[r]}else{const r=new i,o=Xi(r.routes);for(let[c,l]of Object.entries(o)){const d=s==="/"?c:`${s}${c}`,p=c==="/"&&s!=="/"?s:d;a[p]=l}}return a}class ec extends Bi{constructor(){super(...arguments)}flatViewRoutes={};routeManifest={};componentTree=[];flatComponentTree=[];RootLayout=null;boot(t,a){this.flatViewRoutes=Yi(t),this.routeManifest=Xi(t),this.componentTree=Ki(t),this.flatComponentTree=$c(this.componentTree),this.RootLayout=a}}class Ui{emailServiceProvider=rn;authenticationServiceProvider=Gi;middlewareServiceProvider=Xu;i18nServiceProvider=Vu;fileStorageServiceProvider=an;apiRouterServiceProvider=Zc;viewRouterServiceProvider=ec;rateLimiterServiceProvider=sn;broadcastingsServiceProvider=on;services;getServices=()=>{if(!this.services)this.services={emailServiceContainer:new tn(new this.emailServiceProvider),authenticationServiceContainer:new Fc(new this.authenticationServiceProvider),middlewareServiceContainer:new Ec(new this.middlewareServiceProvider),i18nServiceContainer:new Cc(new this.i18nServiceProvider),fileStorageServiceContainer:new Mc(new this.fileStorageServiceProvider),apiRouterServiceContainer:new jc(new this.apiRouterServiceProvider),viewRouterServiceContainer:new Hc(new this.viewRouterServiceProvider),rateLimiterServiceContainer:new Lc(new this.rateLimiterServiceProvider),broadcastingServiceContainer:new Ic(new this.broadcastingsServiceProvider)};return this.services};static getContext=()=>Ac.getStore();run(t){const a=this.getServices();return Ac.run(a,t)}}class cn{t;constructor(t){this.prisma=t}async createSession(t){return await this.prisma.session.create({data:t,include:{user:!0}})}async createUser(t){return await this.prisma.user.create({data:t})}async deleteSession(t){return await this.prisma.session.deleteMany({where:{token:t.token}})}async findUserByEmailAddress(t){return await this.prisma.user.findUnique({where:{email:t}})}async findSession(t){if(!t.token)return null;try{return await this.prisma.session.findUnique({where:{token:t.token,userAgent:"local"},include:{user:{select:{password:!1,id:!0,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}}}}}})}catch(a){return console.log(a),null}}async updateSession(t){return await this.prisma.session.update({where:{token:t.token},data:{expiresAt:t.expiresAt},include:{user:{select:{password:!1,email:!0,globalRole:!0,name:!0,publicId:!0,accounts:{select:{id:!0,publicId:!0,organization:!0,organizationRole:!0}},organization:!0}}}})}async updateUserPassword(t){return await this.prisma.user.update({where:{id:t.id},data:{password:t.password}})}async createPasswordResetToken(t){return await this.prisma.passwordResetToken.create({data:{user:{connect:{id:t.user.id}},token:t.token}})}async findPasswordResetToken(t){const{token:a}=t;return await this.prisma.passwordResetToken.findUnique({where:{token:a},include:{user:!0}})}async deleteAllUserSessions(t){return await this.prisma.session.deleteMany({where:{userId:t}})}async deletePasswordResetToken(t){const{token:a}=t;return await this.prisma.passwordResetToken.delete({where:{token:a}})}}export{cn as PrismaAuthenticationAdapter,Ui as Kernel,Gi as AuthenticationServiceProvider};
|
package/dist/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{y as k} from"../chunk-7ce930fe69575c87.js";import{A as U} from"../chunk-dfb863d471bf3b18.js";import{K as T} from"../chunk-0fd23409fff0376b.js";import{join as I} from"path";function x(n){return n.map((t,i)=>{if(t.isDev)return A("style",{type:"text/css","data-vite-dev-id":t.id,children:t.content},t.id,!1,void 0,this);else return A("style",{type:"text/css",children:t.content},i,!1,void 0,this)})}import{jsxDEV as A} from"react/jsx-dev-runtime";var C=k(U(),1);async function S(n){const t=new URL(n.url),i=t.searchParams.get("url"),u=Number(t.searchParams.get("w")),d=Number(t.searchParams.get("h")),a=t.searchParams.get("fit")??"cover",c=Number(t.searchParams.get("q"));if(!i)return new Response(JSON.stringify({error:"url query parameter is required"}),{headers:{"Content-Type":"application/json"},status:404});const o=`${i.startsWith("http")?"":`http://localhost:${process.env.PORT||5173}`}${i}`,e=await fetch(o);if(!e.ok)return new Response(JSON.stringify({error:"Image not found",info:o}),{headers:{"Content-Type":"application/json"},status:404});const r=Buffer.from(await e.arrayBuffer()),p=await C.default(r).resize(u>0?u:void 0,d>0?d:void 0,{fit:a}).webp({quality:c>0?c:80,force:!0}).toBuffer();return e.headers.delete("Content-Type"),e.headers.delete("Content-Length"),new Response(p,{headers:{"Content-Type":"image/webp","Content-Length":`${p.byteLength}`,...e.headers.toJSON()}})}function O(n){return`
|
|
3
3
|
<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
@@ -21,20 +21,20 @@ import{x as T,y as A} from"../chunk-53b7d6267c9172bc.js";import{B as O} from"../
|
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<h1>Error</h1>
|
|
24
|
-
<pre>${JSON.stringify(
|
|
24
|
+
<pre>${JSON.stringify(n,null,2)}</pre>
|
|
25
25
|
<script type="module" src="/refresh.js"></script>
|
|
26
26
|
</body>
|
|
27
27
|
</html>
|
|
28
|
-
`}async function
|
|
28
|
+
`}async function F(){const n=process.cwd(),t=await(await import("vite")).createServer({root:n,logLevel:"error",server:{watch:{usePolling:!0,interval:100},hmr:{clientPort:5174}},appType:"custom",resolve:{alias:{"@/app":P}}});process.env.ROOT_DIR=D,process.env.APP_DIR=P;async function i(o){const{pathname:e}=new URL(o.url);if(e.startsWith("/refresh.js"))return new Response(`
|
|
29
29
|
import RefreshRuntime from "http://localhost:5173/@react-refresh";
|
|
30
30
|
RefreshRuntime.injectIntoGlobalHook(window);
|
|
31
31
|
window.\$RefreshReg\$ = () => {};
|
|
32
32
|
window.\$RefreshSig\$ = () => (type) => type;
|
|
33
33
|
window.__vite_plugin_react_preamble_installed__ = true;
|
|
34
|
-
`,{headers:{"Content-Type":"application/javascript"}});try{const
|
|
34
|
+
`,{headers:{"Content-Type":"application/javascript"}});try{const r=await fetch(`http://localhost:5174${e}`);if(r.ok)return r}catch(r){console.log(r)}}async function u(){try{return(await t.ssrLoadModule(I(P,"bootstrap.ts"))).app}catch(o){console.log("Can't load bootstrap.ts"),console.error(o)}}async function d(o){const e=o.fetch.bind(o);return{fetch:async(r,p)=>{if(p.upgrade(r,{data:{headers:r.headers}}))return;if(!r.headers.get("x-forwarded-for")){const l=p.requestIP(r);r.headers.set("x-forwarded-for",l.address)}const{pathname:f}=new URL(r.url),v=await i(r);if(v instanceof Response)return v;if(f.startsWith("/__gemi/image"))return await S(r);try{const l=await e(r);if(l instanceof Response)return l;else{const R={},_=(w,$)=>`"${w}": () => import("${$}")`,s=[];for(let w of["404",...o.getFlatComponentTree.call(o)]){const $=`${process.env.APP_DIR}`,E=await t.ssrLoadModule(`${$}/views/${w}.tsx`);R[w]=E.default,s.push(_(w,`${$}/views/${w}.tsx`))}const h=`{${s.join(",")}}`,{default:g}=await t.ssrLoadModule(`${P}/app.css`),y=[];return y.push({isDev:!0,id:`${P}/app.css`,content:g}),await l({styles:x(y),bootstrapModules:["/refresh.js","/app/client.tsx","http://localhost:5173/@vite/client"],viewImportMap:R,loaders:h})}}catch(l){if(console.error(l),f.startsWith("/api"))return new Response(JSON.stringify({error:l.message}),{status:500,headers:{"Content-Type":"application/json"}});return new Response(O(l),{headers:{"Content-Type":"text/html"}})}},port:process.env.PORT||5173,websocket:o.websocket}}await t.listen(5174);const a=await u(),c=await d(a),m=Bun.serve(c);return a.onPublish((o,e,r)=>{m.publish(o,e,r)}),console.log(`Server started on http://localhost:${process.env.PORT||5173}`),t.watcher.on("change",async(o)=>{const e=o.replace(D,"");if(e.startsWith("/app/views")){console.log(`[vite] ${e} changed. \uD83C\uDF5C Hot reloading...`);return}console.log(`[vite] ${e} changed. Reloading...`);const r=t.moduleGraph.getModulesByFile(o);for(let p of Array.from(r))await t.reloadModule(p);try{const p=await u(),f=await d(p);p.onPublish((v,l,R)=>{m.publish(v,l,R)}),m.reload(f)}catch(p){console.log("Error on server reload"),console.log(p)}}),m}var D=process.cwd(),P=I(D,"app");import{join as N} from"path";function L(n){const t=n.toString(),i=new Bun.CryptoHasher("sha1");return i.update(t),i.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=T;async function J(){const{app:n}=await import(`${b}/server/bootstrap.mjs`),t=await import(`${b}/client/.vite/manifest.json`),i=await import(`${b}/server/.vite/manifest.json`);process.env.ROOT_DIR=j,process.env.APP_DIR=W,process.env.DIST_DIR=b;async function u(a){const{pathname:c}=new URL(a.url);if(c.startsWith("/__gemi/image"))return await S(a);const m=new T({pathname:"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|ico|ttf)"}),o=c.startsWith("/api");if(m.test({pathname:c})&&!o){const s=new URL(a.url),h=a.url.replace(s.origin,"").split("?")[0],g=Bun.file(`dist/client${h.replace("/assets/assets","/assets")}`);if(!g)return new Response("Not found",{status:404});const y=L(g.lastModified);return new Response(g.stream(),{headers:{"Content-Type":g.type,"Cache-Control":"public, max-age=31536000, must-revalidate","Content-Length":String(g.size),ETag:y}})}const e=[],p=await Bun.file(`${b}/client/${t["app/client.tsx"].css}`).text();e.push({content:p});const f={},v=(s,h)=>`"${s}": () => import("${h}")`,l=[];for(let s of["404",...n.getFlatComponentTree.call(n)]){const h=i[`app/views/${s}.tsx`];if(!h?.file){console.log(`Server file not found for ${s}`),console.log(h);const w=Object.keys(i),$=`app/views/${s}.tsx`;console.log(`${$} not found in server manifest`),console.log(w)}const g=await import(`${process.env.DIST_DIR}/server/${h?.file}`);f[s]=g.default;const y=t[`app/views/${s}.tsx`];if(y)l.push(v(s,`/${y?.file}`))}const R=`{${l.join(",")}}`,_=n.fetch.bind(n);try{const s=await _(a);if(s instanceof Response)return s;else return await s({styles:x(e),bootstrapModules:[`/${t["app/client.tsx"].file}`],loaders:R,viewImportMap:f})}catch(s){if(console.error(s),c.startsWith("/api"))return new Response(JSON.stringify({error:s.message}),{status:500,headers:{"Content-Type":"application/json"}});return new Response(s.stack,{status:500})}}const d=Bun.serve({fetch:async(a,c)=>{if(!a.headers.get("x-forwarded-for")){const m=c.requestIP(a);a.headers.set("x-forwarded-for",m.address)}return await u(a)},port:process.env.PORT||5173});return console.log("Production server running on",d.url.href),d}var j=process.cwd(),W=N(j,"app"),b=N(j,"dist");import M from"path";async function B(n){const{app:t,RootLayout:i}=n,u=process.cwd(),d=M.join(u,"app"),a=process.cwd(),c=await(await import("vite")).createServer({root:a,logLevel:"error",server:{watch:{usePolling:!0,interval:100},hmr:{clientPort:5174}},appType:"custom",resolve:{alias:{"@/app":d}}});process.env.ROOT_DIR=u,process.env.APP_DIR=d;async function m(e){const{pathname:r}=new URL(e.url);if(r.startsWith("/refresh.js"))return new Response(`
|
|
35
35
|
import RefreshRuntime from "http://localhost:5173/@react-refresh";
|
|
36
36
|
RefreshRuntime.injectIntoGlobalHook(window);
|
|
37
37
|
window.\$RefreshReg\$ = () => {};
|
|
38
38
|
window.\$RefreshSig\$ = () => (type) => type;
|
|
39
39
|
window.__vite_plugin_react_preamble_installed__ = true;
|
|
40
|
-
`,{headers:{"Content-Type":"application/javascript"}});try{const
|
|
40
|
+
`,{headers:{"Content-Type":"application/javascript"}});try{const f=await fetch(`http://localhost:5174${r}`);if(f.ok)return f}catch(f){console.log(f)}return await t.fetch.bind(t)(e,{RootLayout:i,options:{bootstrapModules:["/refresh.js","/app/client.tsx","http://localhost:5173/@vite/client"]}})}return c.watcher.on("change",async(e)=>{if(e.includes("app/views"))return;if(console.log(`[vite] ${e} changed. Updating...`),await c.moduleGraph.getModuleByUrl(`/${e}`))console.log(`[vite] ${e} changed. Updating...`)}),await c.listen(5174),Bun.serve({fetch:async(e)=>{return await m(e)},port:process.env.PORT||5173})}async function H(n){await B(n)}export{J as startProdServer,F as startDevServer,H as createServer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceProvider.d.ts","sourceRoot":"","sources":["../../services/ServiceProvider.ts"],"names":[],"mappings":"AAAA,8BAAsB,eAAe;IACnC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"ServiceProvider.d.ts","sourceRoot":"","sources":["../../services/ServiceProvider.ts"],"names":[],"mappings":"AAAA,8BAAsB,eAAe;IACnC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG;CAC/C"}
|