tempest.games 0.1.10 → 0.1.12

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.
@@ -1,52 +1,52 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var B4=Object.create;var{getPrototypeOf:N4,defineProperty:pl,getOwnPropertyNames:L4}=Object;var t4=Object.prototype.hasOwnProperty;var al=(n,i,o)=>{o=n!=null?B4(N4(n)):{};let c=i||!n||!n.__esModule?pl(o,"default",{value:n,enumerable:!0}):o;for(let p of L4(n))if(!t4.call(c,p))pl(c,p,{get:()=>n[p],enumerable:!0});return c};var h=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var D4=(n,i)=>{for(var o in i)pl(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var I0=h((h0)=>{Object.defineProperty(h0,"__esModule",{value:!0});class oc extends Error{}class NT extends oc{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class LT extends oc{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class tT extends oc{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class zc extends oc{}class Cl extends oc{constructor(n){super(`Invalid unit ${n}`)}}class ui extends oc{}class yo extends oc{constructor(){super("Zone is an abstract class")}}var B="numeric",$o="short",ji="long",Hm={year:B,month:B,day:B},DT={year:B,month:$o,day:B},d4={year:B,month:$o,day:B,weekday:$o},hT={year:B,month:ji,day:B},IT={year:B,month:ji,day:B,weekday:ji},CT={hour:B,minute:B},kT={hour:B,minute:B,second:B},rT={hour:B,minute:B,second:B,timeZoneName:$o},ZT={hour:B,minute:B,second:B,timeZoneName:ji},qT={hour:B,minute:B,hourCycle:"h23"},eT={hour:B,minute:B,second:B,hourCycle:"h23"},PT={hour:B,minute:B,second:B,hourCycle:"h23",timeZoneName:$o},gT={hour:B,minute:B,second:B,hourCycle:"h23",timeZoneName:ji},dT={year:B,month:B,day:B,hour:B,minute:B},n0={year:B,month:B,day:B,hour:B,minute:B,second:B},i0={year:B,month:$o,day:B,hour:B,minute:B},o0={year:B,month:$o,day:B,hour:B,minute:B,second:B},nK={year:B,month:$o,day:B,weekday:$o,hour:B,minute:B},c0={year:B,month:ji,day:B,hour:B,minute:B,timeZoneName:$o},p0={year:B,month:ji,day:B,hour:B,minute:B,second:B,timeZoneName:$o},a0={year:B,month:ji,day:B,weekday:ji,hour:B,minute:B,timeZoneName:ji},m0={year:B,month:ji,day:B,weekday:ji,hour:B,minute:B,second:B,timeZoneName:ji};class Oc{get type(){throw new yo}get name(){throw new yo}get ianaName(){return this.name}get isUniversal(){throw new yo}offsetName(n,i){throw new yo}formatOffset(n,i){throw new yo}offset(n){throw new yo}equals(n){throw new yo}get isValid(){throw new yo}}var sl=null;class Fa extends Oc{static get instance(){if(sl===null)sl=new Fa;return sl}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return R0(n,i,o)}formatOffset(n,i){return Aa(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var Ym={};function iK(n){if(!Ym[n])Ym[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"});return Ym[n]}var oK={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function cK(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,a,m,x,l,f,$]=c;return[m,p,a,x,l,f,$]}function pK(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:a,value:m}=o[p],x=oK[a];if(a==="era")c[x]=m;else if(!an(x))c[x]=parseInt(m,10)}return c}var Km={};class uo extends Oc{static create(n){if(!Km[n])Km[n]=new uo(n);return Km[n]}static resetCache(){Km={},Ym={}}static isValidSpecifier(n){return this.isValidZone(n)}static isValidZone(n){if(!n)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:n}).format(),!0}catch(i){return!1}}constructor(n){super();this.zoneName=n,this.valid=uo.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return R0(n,i,o,this.name)}formatOffset(n,i){return Aa(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=iK(this.name),[c,p,a,m,x,l,f]=o.formatToParts?pK(o,i):cK(o,i);if(m==="BC")c=-Math.abs(c)+1;let v=bm({year:c,month:p,day:a,hour:x===24?0:x,minute:l,second:f,millisecond:0}),w=+i,F=w%1000;return w-=F>=0?F:1000+F,(v-w)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var fT={};function aK(n,i={}){let o=JSON.stringify([n,i]),c=fT[o];if(!c)c=new Intl.ListFormat(n,i),fT[o]=c;return c}var Nl={};function Ll(n,i={}){let o=JSON.stringify([n,i]),c=Nl[o];if(!c)c=new Intl.DateTimeFormat(n,i),Nl[o]=c;return c}var tl={};function mK(n,i={}){let o=JSON.stringify([n,i]),c=tl[o];if(!c)c=new Intl.NumberFormat(n,i),tl[o]=c;return c}var Dl={};function xK(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),a=Dl[p];if(!a)a=new Intl.RelativeTimeFormat(n,i),Dl[p]=a;return a}var Sa=null;function lK(){if(Sa)return Sa;else return Sa=new Intl.DateTimeFormat().resolvedOptions().locale,Sa}var $T={};function fK(n){let i=$T[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,$T[n]=i}return i}function $K(n){let i=n.indexOf("-x-");if(i!==-1)n=n.substring(0,i);let o=n.indexOf("-u-");if(o===-1)return[n];else{let c,p;try{c=Ll(n).resolvedOptions(),p=n}catch(x){let l=n.substring(0,o);c=Ll(l).resolvedOptions(),p=l}let{numberingSystem:a,calendar:m}=c;return[p,a,m]}}function vK(n,i,o){if(o||i){if(!n.includes("-u-"))n+="-u";if(o)n+=`-ca-${o}`;if(i)n+=`-nu-${i}`;return n}else return n}function TK(n){let i=[];for(let o=1;o<=12;o++){let c=ln.utc(2009,o,1);i.push(n(c))}return i}function wK(n){let i=[];for(let o=1;o<=7;o++){let c=ln.utc(2016,11,13+o);i.push(n(c))}return i}function Wm(n,i,o,c){let p=n.listingMode();if(p==="error")return null;else if(p==="en")return o(i);else return c(i)}function SK(n){if(n.numberingSystem&&n.numberingSystem!=="latn")return!1;else return n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class x0{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...a}=o;if(!i||Object.keys(a).length>0){let m={useGrouping:!1,...o};if(o.padTo>0)m.minimumIntegerDigits=o.padTo;this.inf=mK(n,m)}}format(n){if(this.inf){let i=this.floor?Math.floor(n):n;return this.inf.format(i)}else{let i=this.floor?Math.floor(n):el(n,3);return gn(i,this.padTo)}}}class l0{constructor(n,i,o){this.opts=o,this.originalZone=void 0;let c=void 0;if(this.opts.timeZone)this.dt=n;else if(n.zone.type==="fixed"){let a=-1*(n.offset/60),m=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;if(n.offset!==0&&uo.create(m).valid)c=m,this.dt=n;else c="UTC",this.dt=n.offset===0?n:n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone}else if(n.zone.type==="system")this.dt=n;else if(n.zone.type==="iana")this.dt=n,c=n.zone.name;else c="UTC",this.dt=n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone;let p={...this.opts};p.timeZone=p.timeZone||c,this.dtf=Ll(i,p)}format(){if(this.originalZone)return this.formatToParts().map(({value:n})=>n).join("");return this.dtf.format(this.dt.toJSDate())}formatToParts(){let n=this.dtf.formatToParts(this.dt.toJSDate());if(this.originalZone)return n.map((i)=>{if(i.type==="timeZoneName"){let o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:o}}else return i});return n}resolvedOptions(){return this.dtf.resolvedOptions()}}class f0{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&J0())this.rtf=xK(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return bK(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var AK={firstDay:1,minimalDays:4,weekend:[6,7]};class Yn{static fromOpts(n){return Yn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let a=n||tn.defaultLocale,m=a||(p?"en-US":lK()),x=i||tn.defaultNumberingSystem,l=o||tn.defaultOutputCalendar,f=hl(c)||tn.defaultWeekSettings;return new Yn(m,x,l,f,a)}static resetCache(){Sa=null,Nl={},tl={},Dl={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return Yn.create(n,i,o,c)}constructor(n,i,o,c,p){let[a,m,x]=$K(n);this.locale=a,this.numberingSystem=i||m||null,this.outputCalendar=o||x||null,this.weekSettings=c,this.intl=vK(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=p,this.fastNumbersCached=null}get fastNumbers(){if(this.fastNumbersCached==null)this.fastNumbersCached=SK(this);return this.fastNumbersCached}listingMode(){let n=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return n&&i?"en":"intl"}clone(n){if(!n||Object.getOwnPropertyNames(n).length===0)return this;else return Yn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,hl(n.weekSettings)||this.weekSettings,n.defaultToEN||!1)}redefaultToEN(n={}){return this.clone({...n,defaultToEN:!0})}redefaultToSystem(n={}){return this.clone({...n,defaultToEN:!1})}months(n,i=!1){return Wm(this,n,W0,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=TK((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Wm(this,n,z0,()=>{let o=i?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},c=i?"format":"standalone";if(!this.weekdaysCache[c][n])this.weekdaysCache[c][n]=wK((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Wm(this,void 0,()=>u0,()=>{if(!this.meridiemCache){let n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ln.utc(2016,11,13,9),ln.utc(2016,11,13,19)].map((i)=>this.extract(i,n,"dayperiod"))}return this.meridiemCache})}eras(n){return Wm(this,n,Y0,()=>{let i={era:n};if(!this.eraCache[n])this.eraCache[n]=[ln.utc(-40,1,1),ln.utc(2017,1,1)].map((o)=>this.extract(o,i,"era"));return this.eraCache[n]})}extract(n,i,o){let c=this.dtFormatter(n,i),p=c.formatToParts(),a=p.find((m)=>m.type.toLowerCase()===o);return a?a.value:null}numberFormatter(n={}){return new x0(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new l0(n,this.intl,i)}relFormatter(n={}){return new f0(this.intl,this.isEnglish(),n)}listFormatter(n={}){return aK(this.intl,n)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){if(this.weekSettings)return this.weekSettings;else if(!F0())return AK;else return fK(this.locale)}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(n){return this.locale===n.locale&&this.numberingSystem===n.numberingSystem&&this.outputCalendar===n.outputCalendar}}var Ul=null;class Ai extends Oc{static get utcInstance(){if(Ul===null)Ul=new Ai(0);return Ul}static instance(n){return n===0?Ai.utcInstance:new Ai(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Ai(Vm(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Aa(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Aa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Aa(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(n){return n.type==="fixed"&&n.fixed===this.fixed}get isValid(){return!0}}class kl extends Oc{constructor(n){super();this.zoneName=n}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ic(n,i){if(an(n)||n===null)return i;else if(n instanceof Oc)return n;else if(RK(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Fa.instance;else if(o==="utc"||o==="gmt")return Ai.utcInstance;else return Ai.parseSpecifier(o)||uo.create(n)}else if(Yc(n))return Ai.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new kl(n)}var vT=()=>Date.now(),TT="system",wT=null,ST=null,AT=null,JT=60,FT,RT=null;class tn{static get now(){return vT}static set now(n){vT=n}static set defaultZone(n){TT=n}static get defaultZone(){return ic(TT,Fa.instance)}static get defaultLocale(){return wT}static set defaultLocale(n){wT=n}static get defaultNumberingSystem(){return ST}static set defaultNumberingSystem(n){ST=n}static get defaultOutputCalendar(){return AT}static set defaultOutputCalendar(n){AT=n}static get defaultWeekSettings(){return RT}static set defaultWeekSettings(n){RT=hl(n)}static get twoDigitCutoffYear(){return JT}static set twoDigitCutoffYear(n){JT=n%100}static get throwOnInvalid(){return FT}static set throwOnInvalid(n){FT=n}static resetCaches(){Yn.resetCache(),uo.resetCache()}}class qi{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var $0=[0,31,59,90,120,151,181,212,243,273,304,334],v0=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(n,i){return new qi("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function rl(n,i,o){let c=new Date(Date.UTC(n,i-1,o));if(n<100&&n>=0)c.setUTCFullYear(c.getUTCFullYear()-1900);let p=c.getUTCDay();return p===0?7:p}function T0(n,i,o){return o+(Ra(n)?v0:$0)[i-1]}function w0(n,i){let o=Ra(n)?v0:$0,c=o.findIndex((a)=>a<i),p=i-o[c];return{month:c+1,day:p}}function Zl(n,i){return(n-i+7)%7+1}function Em(n,i=4,o=1){let{year:c,month:p,day:a}=n,m=T0(c,p,a),x=Zl(rl(c,p,a),o),l=Math.floor((m-x+14-i)/7),f;if(l<1)f=c-1,l=Ja(f,i,o);else if(l>Ja(c,i,o))f=c+1,l=1;else f=c;return{weekYear:f,weekNumber:l,weekday:x,..._m(n)}}function MT(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:a}=n,m=Zl(rl(c,1,i),o),x=mp(c),l=p*7+a-m-7+i,f;if(l<1)f=c-1,l+=mp(f);else if(l>x)f=c+1,l-=mp(c);else f=c;let{month:$,day:v}=w0(f,l);return{year:f,month:$,day:v,..._m(n)}}function bl(n){let{year:i,month:o,day:c}=n,p=T0(i,o,c);return{year:i,ordinal:p,..._m(n)}}function KT(n){let{year:i,ordinal:o}=n,{month:c,day:p}=w0(i,o);return{year:i,month:c,day:p,..._m(n)}}function WT(n,i){if(!an(n.localWeekday)||!an(n.localWeekNumber)||!an(n.localWeekYear)){if(!an(n.weekday)||!an(n.weekNumber)||!an(n.weekYear))throw new zc("Cannot mix locale-based week fields with ISO-based week fields");if(!an(n.localWeekday))n.weekday=n.localWeekday;if(!an(n.localWeekNumber))n.weekNumber=n.localWeekNumber;if(!an(n.localWeekYear))n.weekYear=n.localWeekYear;return delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:i.getMinDaysInFirstWeek(),startOfWeek:i.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function JK(n,i=4,o=1){let c=Um(n.weekYear),p=Pi(n.weekNumber,1,Ja(n.weekYear,i,o)),a=Pi(n.weekday,1,7);if(!c)return ei("weekYear",n.weekYear);else if(!p)return ei("week",n.weekNumber);else if(!a)return ei("weekday",n.weekday);else return!1}function FK(n){let i=Um(n.year),o=Pi(n.ordinal,1,mp(n.year));if(!i)return ei("year",n.year);else if(!o)return ei("ordinal",n.ordinal);else return!1}function S0(n){let i=Um(n.year),o=Pi(n.month,1,12),c=Pi(n.day,1,Qm(n.year,n.month));if(!i)return ei("year",n.year);else if(!o)return ei("month",n.month);else if(!c)return ei("day",n.day);else return!1}function A0(n){let{hour:i,minute:o,second:c,millisecond:p}=n,a=Pi(i,0,23)||i===24&&o===0&&c===0&&p===0,m=Pi(o,0,59),x=Pi(c,0,59),l=Pi(p,0,999);if(!a)return ei("hour",i);else if(!m)return ei("minute",o);else if(!x)return ei("second",c);else if(!l)return ei("millisecond",p);else return!1}function an(n){return typeof n==="undefined"}function Yc(n){return typeof n==="number"}function Um(n){return typeof n==="number"&&n%1===0}function RK(n){return typeof n==="string"}function MK(n){return Object.prototype.toString.call(n)==="[object Date]"}function J0(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function F0(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function KK(n){return Array.isArray(n)?n:[n]}function XT(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let a=[i(p),p];if(!c)return a;else if(o(c[0],a[0])===c[0])return c;else return a},null)[1]}function WK(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function lp(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function hl(n){if(n==null)return null;else if(typeof n!=="object")throw new ui("Week settings must be an object");else{if(!Pi(n.firstDay,1,7)||!Pi(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some((i)=>!Pi(i,1,7)))throw new ui("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}}function Pi(n,i,o){return Um(n)&&n>=i&&n<=o}function XK(n,i){return n-i*Math.floor(n/i)}function gn(n,i=2){let o=n<0,c;if(o)c="-"+(""+-n).padStart(i,"0");else c=(""+n).padStart(i,"0");return c}function nc(n){if(an(n)||n===null||n==="")return;else return parseInt(n,10)}function Xc(n){if(an(n)||n===null||n==="")return;else return parseFloat(n)}function ql(n){if(an(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function el(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Ra(n){return n%4===0&&(n%100!==0||n%400===0)}function mp(n){return Ra(n)?366:365}function Qm(n,i){let o=XK(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Ra(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function bm(n){let i=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);if(n.year<100&&n.year>=0)i=new Date(i),i.setUTCFullYear(n.year,n.month-1,n.day);return+i}function GT(n,i,o){return-Zl(rl(n,1,i),o)+i-1}function Ja(n,i=4,o=1){let c=GT(n,i,o),p=GT(n+1,i,o);return(mp(n)-c+p)/7}function Il(n){if(n>99)return n;else return n>tn.twoDigitCutoffYear?1900+n:2000+n}function R0(n,i,o,c=null){let p=new Date(n),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)a.timeZone=c;let m={timeZoneName:i,...a},x=new Intl.DateTimeFormat(o,m).formatToParts(p).find((l)=>l.type.toLowerCase()==="timezonename");return x?x.value:null}function Vm(n,i){let o=parseInt(n,10);if(Number.isNaN(o))o=0;let c=parseInt(i,10)||0,p=o<0||Object.is(o,-0)?-c:c;return o*60+p}function M0(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new ui(`Invalid unit value ${n}`);return i}function sm(n,i){let o={};for(let c in n)if(lp(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=M0(p)}return o}function Aa(n,i){let o=Math.trunc(Math.abs(n/60)),c=Math.trunc(Math.abs(n%60)),p=n>=0?"+":"-";switch(i){case"short":return`${p}${gn(o,2)}:${gn(c,2)}`;case"narrow":return`${p}${o}${c>0?`:${c}`:""}`;case"techie":return`${p}${gn(o,2)}${gn(c,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function _m(n){return WK(n,["hour","minute","second","millisecond"])}var GK=["January","February","March","April","May","June","July","August","September","October","November","December"],K0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zK=["J","F","M","A","M","J","J","A","S","O","N","D"];function W0(n){switch(n){case"narrow":return[...zK];case"short":return[...K0];case"long":return[...GK];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var X0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],G0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],uK=["M","T","W","T","F","S","S"];function z0(n){switch(n){case"narrow":return[...uK];case"short":return[...G0];case"long":return[...X0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var u0=["AM","PM"],YK=["Before Christ","Anno Domini"],OK=["BC","AD"],HK=["B","A"];function Y0(n){switch(n){case"narrow":return[...HK];case"short":return[...OK];case"long":return[...YK];default:return null}}function EK(n){return u0[n.hour<12?0:1]}function QK(n,i){return z0(i)[n.weekday-1]}function sK(n,i){return W0(i)[n.month-1]}function UK(n,i){return Y0(i)[n.year<0?0:1]}function bK(n,i,o="always",c=!1){let p={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&a){let v=n==="days";switch(i){case 1:return v?"tomorrow":`next ${p[n][0]}`;case-1:return v?"yesterday":`last ${p[n][0]}`;case 0:return v?"today":`this ${p[n][0]}`}}let m=Object.is(i,-0)||i<0,x=Math.abs(i),l=x===1,f=p[n],$=c?l?f[1]:f[2]||f[1]:l?p[n][0]:n;return m?`${x} ${$} ago`:`in ${x} ${$}`}function zT(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var VK={D:Hm,DD:DT,DDD:hT,DDDD:IT,t:CT,tt:kT,ttt:rT,tttt:ZT,T:qT,TT:eT,TTT:PT,TTTT:gT,f:dT,ff:i0,fff:c0,ffff:a0,F:n0,FF:o0,FFF:p0,FFFF:m0};class Si{static create(n,i={}){return new Si(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let a=0;a<n.length;a++){let m=n.charAt(a);if(m==="'"){if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});i=null,o="",c=!c}else if(c)o+=m;else if(m===i)o+=m;else{if(o.length>0)p.push({literal:/^\s+$/.test(o),val:o});o=m,i=m}}if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});return p}static macroTokenToFormatOpts(n){return VK[n]}constructor(n,i){this.opts=i,this.loc=n,this.systemLoc=null}formatWithSystemDefault(n,i){if(this.systemLoc===null)this.systemLoc=this.loc.redefaultToSystem();return this.systemLoc.dtFormatter(n,{...this.opts,...i}).format()}dtFormatter(n,i={}){return this.loc.dtFormatter(n,{...this.opts,...i})}formatDateTime(n,i){return this.dtFormatter(n,i).format()}formatDateTimeParts(n,i){return this.dtFormatter(n,i).formatToParts()}formatInterval(n,i){return this.dtFormatter(n.start,i).dtf.formatRange(n.start.toJSDate(),n.end.toJSDate())}resolvedOptions(n,i){return this.dtFormatter(n,i).resolvedOptions()}num(n,i=0){if(this.opts.forceSimple)return gn(n,i);let o={...this.opts};if(i>0)o.padTo=i;return this.loc.numberFormatter(o).format(n)}formatDateTimeFromString(n,i){let o=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",p=(w,F)=>this.loc.extract(n,w,F),a=(w)=>{if(n.isOffsetFixed&&n.offset===0&&w.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,w.format):""},m=()=>o?EK(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),x=(w,F)=>o?sK(n,w):p(F?{month:w}:{month:w,day:"numeric"},"month"),l=(w,F)=>o?QK(n,w):p(F?{weekday:w}:{weekday:w,month:"long",day:"numeric"},"weekday"),f=(w)=>{let F=Si.macroTokenToFormatOpts(w);if(F)return this.formatWithSystemDefault(n,F);else return w},$=(w)=>o?UK(n,w):p({era:w},"era"),v=(w)=>{switch(w){case"S":return this.num(n.millisecond);case"u":case"SSS":return this.num(n.millisecond,3);case"s":return this.num(n.second);case"ss":return this.num(n.second,2);case"uu":return this.num(Math.floor(n.millisecond/10),2);case"uuu":return this.num(Math.floor(n.millisecond/100));case"m":return this.num(n.minute);case"mm":return this.num(n.minute,2);case"h":return this.num(n.hour%12===0?12:n.hour%12);case"hh":return this.num(n.hour%12===0?12:n.hour%12,2);case"H":return this.num(n.hour);case"HH":return this.num(n.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:this.loc.locale});case"z":return n.zoneName;case"a":return m();case"d":return c?p({day:"numeric"},"day"):this.num(n.day);case"dd":return c?p({day:"2-digit"},"day"):this.num(n.day,2);case"c":return this.num(n.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return c?p({month:"numeric",day:"numeric"},"month"):this.num(n.month);case"LL":return c?p({month:"2-digit",day:"numeric"},"month"):this.num(n.month,2);case"LLL":return x("short",!0);case"LLLL":return x("long",!0);case"LLLLL":return x("narrow",!0);case"M":return c?p({month:"numeric"},"month"):this.num(n.month);case"MM":return c?p({month:"2-digit"},"month"):this.num(n.month,2);case"MMM":return x("short",!1);case"MMMM":return x("long",!1);case"MMMMM":return x("narrow",!1);case"y":return c?p({year:"numeric"},"year"):this.num(n.year);case"yy":return c?p({year:"2-digit"},"year"):this.num(n.year.toString().slice(-2),2);case"yyyy":return c?p({year:"numeric"},"year"):this.num(n.year,4);case"yyyyyy":return c?p({year:"numeric"},"year"):this.num(n.year,6);case"G":return $("short");case"GG":return $("long");case"GGGGG":return $("narrow");case"kk":return this.num(n.weekYear.toString().slice(-2),2);case"kkkk":return this.num(n.weekYear,4);case"W":return this.num(n.weekNumber);case"WW":return this.num(n.weekNumber,2);case"n":return this.num(n.localWeekNumber);case"nn":return this.num(n.localWeekNumber,2);case"ii":return this.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(n.localWeekYear,4);case"o":return this.num(n.ordinal);case"ooo":return this.num(n.ordinal,3);case"q":return this.num(n.quarter);case"qq":return this.num(n.quarter,2);case"X":return this.num(Math.floor(n.ts/1000));case"x":return this.num(n.ts);default:return f(w)}};return zT(Si.parseFormat(i),v)}formatDurationFromString(n,i){let o=(x)=>{switch(x[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=(x)=>(l)=>{let f=o(l);if(f)return this.num(x.get(f),l.length);else return l},p=Si.parseFormat(i),a=p.reduce((x,{literal:l,val:f})=>l?x:x.concat(f),[]),m=n.shiftTo(...a.map(o).filter((x)=>x));return zT(p,c(m))}}var O0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function fp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}\$`)}function $p(...n){return(i)=>n.reduce(([o,c,p],a)=>{let[m,x,l]=a(i,p);return[{...o,...m},x||c,l]},[{},null,1]).slice(0,2)}function vp(n,...i){if(n==null)return[null,null];for(let[o,c]of i){let p=o.exec(n);if(p)return c(p)}return[null,null]}function H0(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=nc(i[o+p]);return[c,null,o+p]}}var E0=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,_K=`(?:${E0.source}?(?:\\[(${O0.source})\\])?)?`,Pl=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Q0=RegExp(`${Pl.source}${_K}`),gl=RegExp(`(?:T${Q0.source})?`),yK=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,jK=/(\d{4})-?W(\d\d)(?:-?(\d))?/,BK=/(\d{4})-?(\d{3})/,NK=H0("weekYear","weekNumber","weekDay"),LK=H0("year","ordinal"),tK=/(\d{4})-(\d\d)-(\d\d)/,s0=RegExp(`${Pl.source} ?(?:${E0.source}|(${O0.source}))?`),DK=RegExp(`(?: ${s0.source})?`);function xp(n,i,o){let c=n[i];return an(c)?o:nc(c)}function hK(n,i){return[{year:xp(n,i),month:xp(n,i+1,1),day:xp(n,i+2,1)},null,i+3]}function Tp(n,i){return[{hours:xp(n,i,0),minutes:xp(n,i+1,0),seconds:xp(n,i+2,0),milliseconds:ql(n[i+3])},null,i+4]}function Ma(n,i){let o=!n[i]&&!n[i+1],c=Vm(n[i+1],n[i+2]),p=o?null:Ai.instance(c);return[{},p,i+3]}function Ka(n,i){let o=n[i]?uo.create(n[i]):null;return[{},o,i+1]}var IK=RegExp(`^T?${Pl.source}\$`),CK=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function kK(n){let[i,o,c,p,a,m,x,l,f]=n,$=i[0]==="-",v=l&&l[0]==="-",w=(F,M=!1)=>F!==void 0&&(M||F&&$)?-F:F;return[{years:w(Xc(o)),months:w(Xc(c)),weeks:w(Xc(p)),days:w(Xc(a)),hours:w(Xc(m)),minutes:w(Xc(x)),seconds:w(Xc(l),l==="-0"),milliseconds:w(ql(f),v)}]}var rK={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function dl(n,i,o,c,p,a,m){let x={year:i.length===2?Il(nc(i)):nc(i),month:K0.indexOf(o)+1,day:nc(c),hour:nc(p),minute:nc(a)};if(m)x.second=nc(m);if(n)x.weekday=n.length>3?X0.indexOf(n)+1:G0.indexOf(n)+1;return x}var ZK=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function qK(n){let[,i,o,c,p,a,m,x,l,f,$,v]=n,w=dl(i,p,c,o,a,m,x),F;if(l)F=rK[l];else if(f)F=0;else F=Vm($,v);return[w,new Ai(F)]}function eK(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var PK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,gK=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,dK=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function uT(n){let[,i,o,c,p,a,m,x]=n;return[dl(i,p,c,o,a,m,x),Ai.utcInstance]}function n8(n){let[,i,o,c,p,a,m,x]=n;return[dl(i,x,o,c,p,a,m),Ai.utcInstance]}var i8=fp(yK,gl),o8=fp(jK,gl),c8=fp(BK,gl),p8=fp(Q0),U0=$p(hK,Tp,Ma,Ka),a8=$p(NK,Tp,Ma,Ka),m8=$p(LK,Tp,Ma,Ka),x8=$p(Tp,Ma,Ka);function l8(n){return vp(n,[i8,U0],[o8,a8],[c8,m8],[p8,x8])}function f8(n){return vp(eK(n),[ZK,qK])}function $8(n){return vp(n,[PK,uT],[gK,uT],[dK,n8])}function v8(n){return vp(n,[CK,kK])}var T8=$p(Tp);function w8(n){return vp(n,[IK,T8])}var S8=fp(tK,DK),A8=fp(s0),J8=$p(Tp,Ma,Ka);function F8(n){return vp(n,[S8,U0],[A8,J8])}var YT="Invalid Duration",b0={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:604800000},days:{hours:24,minutes:1440,seconds:86400,milliseconds:86400000},hours:{minutes:60,seconds:3600,milliseconds:3600000},minutes:{seconds:60,milliseconds:60000},seconds:{milliseconds:1000}},R8={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536000,milliseconds:31536000000},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:7862400000},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592000,milliseconds:2592000000},...b0},Zi=365.2425,cp=30.436875,M8={years:{quarters:4,months:12,weeks:Zi/7,days:Zi,hours:Zi*24,minutes:Zi*24*60,seconds:Zi*24*60*60,milliseconds:Zi*24*60*60*1000},quarters:{months:3,weeks:Zi/28,days:Zi/4,hours:Zi*24/4,minutes:Zi*24*60/4,seconds:Zi*24*60*60/4,milliseconds:Zi*24*60*60*1000/4},months:{weeks:cp/7,days:cp,hours:cp*24,minutes:cp*24*60,seconds:cp*24*60*60,milliseconds:cp*24*60*60*1000},...b0},uc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],K8=uc.slice(0).reverse();function go(n,i,o=!1){let c={values:o?i.values:{...n.values,...i.values||{}},loc:n.loc.clone(i.loc),conversionAccuracy:i.conversionAccuracy||n.conversionAccuracy,matrix:i.matrix||n.matrix};return new Fn(c)}function V0(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of K8.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function OT(n,i){let o=V0(n,i)<0?-1:1;uc.reduceRight((c,p)=>{if(!an(i[p])){if(c){let a=i[c]*o,m=n[p][c],x=Math.floor(a/m);i[p]+=x*o,i[c]-=x*m*o}return p}else return c},null),uc.reduce((c,p)=>{if(!an(i[p])){if(c){let a=i[c]%1;i[c]-=a,i[p]+=a*n[c][p]}return p}else return c},null)}function W8(n){let i={};for(let[o,c]of Object.entries(n))if(c!==0)i[o]=c;return i}class Fn{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?M8:R8;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||Yn.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return Fn.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new ui(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new Fn({values:sm(n,Fn.normalizeUnit),loc:Yn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(Yc(n))return Fn.fromMillis(n);else if(Fn.isDuration(n))return n;else if(typeof n==="object")return Fn.fromObject(n);else throw new ui(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=v8(n);if(o)return Fn.fromObject(o,i);else return Fn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=w8(n);if(o)return Fn.fromObject(o,i);else return Fn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new ui("need to specify a reason the Duration is invalid");let o=n instanceof qi?n:new qi(n,i);if(tn.throwOnInvalid)throw new tT(o);else return new Fn({invalid:o})}static normalizeUnit(n){let i={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[n?n.toLowerCase():n];if(!i)throw new Cl(n);return i}static isDuration(n){return n&&n.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(n,i={}){let o={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?Si.create(this.loc,o).formatDurationFromString(this,n):YT}toHuman(n={}){if(!this.isValid)return YT;let i=uc.map((o)=>{let c=this.values[o];if(an(c))return null;return this.loc.numberFormatter({style:"unit",unitDisplay:"long",...n,unit:o.slice(0,-1)}).format(c)}).filter((o)=>o);return this.loc.listFormatter({type:"conjunction",style:n.listStyle||"narrow",...n}).format(i)}toObject(){if(!this.isValid)return{};return{...this.values}}toISO(){if(!this.isValid)return null;let n="P";if(this.years!==0)n+=this.years+"Y";if(this.months!==0||this.quarters!==0)n+=this.months+this.quarters*3+"M";if(this.weeks!==0)n+=this.weeks+"W";if(this.days!==0)n+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)n+="T";if(this.hours!==0)n+=this.hours+"H";if(this.minutes!==0)n+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0)n+=el(this.seconds+this.milliseconds/1000,3)+"S";if(n==="P")n+="T0S";return n}toISOTime(n={}){if(!this.isValid)return null;let i=this.toMillis();if(i<0||i>=86400000)return null;return n={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...n,includeOffset:!1},ln.fromMillis(i,{zone:"UTC"}).toISOTime(n)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Duration { values: ${JSON.stringify(this.values)} }`;else return`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){if(!this.isValid)return NaN;return V0(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=Fn.fromDurationLike(n),o={};for(let c of uc)if(lp(i.values,c)||lp(this.values,c))o[c]=i.get(c)+this.get(c);return go(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=Fn.fromDurationLike(n);return this.plus(i.negate())}mapUnits(n){if(!this.isValid)return this;let i={};for(let o of Object.keys(this.values))i[o]=M0(n(this.values[o],o));return go(this,{values:i},!0)}get(n){return this[Fn.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,...sm(n,Fn.normalizeUnit)};return go(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let a={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return go(this,a)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return OT(this.matrix,n),go(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=W8(this.normalize().shiftToAll().toObject());return go(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((a)=>Fn.normalizeUnit(a));let i={},o={},c=this.toObject(),p;for(let a of uc)if(n.indexOf(a)>=0){p=a;let m=0;for(let l in o)m+=this.matrix[l][a]*o[l],o[l]=0;if(Yc(c[a]))m+=c[a];let x=Math.trunc(m);i[a]=x,o[a]=(m*1000-x*1000)/1000}else if(Yc(c[a]))o[a]=c[a];for(let a in o)if(o[a]!==0)i[p]+=a===p?o[a]:o[a]/this.matrix[p][a];return OT(this.matrix,i),go(this,{values:i},!0)}shiftToAll(){if(!this.isValid)return this;return this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds")}negate(){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=this.values[i]===0?0:-this.values[i];return go(this,{values:n},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(n){if(!this.isValid||!n.isValid)return!1;if(!this.loc.equals(n.loc))return!1;function i(o,c){if(o===void 0||o===0)return c===void 0||c===0;return o===c}for(let o of uc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var pp="Invalid Interval";function X8(n,i){if(!n||!n.isValid)return Ln.invalid("missing or invalid start");else if(!i||!i.isValid)return Ln.invalid("missing or invalid end");else if(i<n)return Ln.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${i.toISO()}`);else return null}class Ln{constructor(n){this.s=n.start,this.e=n.end,this.invalid=n.invalid||null,this.isLuxonInterval=!0}static invalid(n,i=null){if(!n)throw new ui("need to specify a reason the Interval is invalid");let o=n instanceof qi?n:new qi(n,i);if(tn.throwOnInvalid)throw new LT(o);else return new Ln({invalid:o})}static fromDateTimes(n,i){let o=wa(n),c=wa(i),p=X8(o,c);if(p==null)return new Ln({start:o,end:c});else return p}static after(n,i){let o=Fn.fromDurationLike(i),c=wa(n);return Ln.fromDateTimes(c,c.plus(o))}static before(n,i){let o=Fn.fromDurationLike(i),c=wa(n);return Ln.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,a;try{p=ln.fromISO(o,i),a=p.isValid}catch(l){a=!1}let m,x;try{m=ln.fromISO(c,i),x=m.isValid}catch(l){x=!1}if(a&&x)return Ln.fromDateTimes(p,m);if(a){let l=Fn.fromISO(c,i);if(l.isValid)return Ln.after(p,l)}else if(x){let l=Fn.fromISO(o,i);if(l.isValid)return Ln.before(m,l)}}return Ln.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static isInterval(n){return n&&n.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(n="milliseconds"){return this.isValid?this.toDuration(...[n]).get(n):NaN}count(n="milliseconds",i){if(!this.isValid)return NaN;let o=this.start.startOf(n,i),c;if(i!=null&&i.useLocaleWeeks)c=this.end.reconfigure({locale:o.locale});else c=this.end;return c=c.startOf(n,i),Math.floor(c.diff(o,n).get(n))+(c.valueOf()!==this.end.valueOf())}hasSame(n){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,n):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(n){if(!this.isValid)return!1;return this.s>n}isBefore(n){if(!this.isValid)return!1;return this.e<=n}contains(n){if(!this.isValid)return!1;return this.s<=n&&this.e>n}set({start:n,end:i}={}){if(!this.isValid)return this;return Ln.fromDateTimes(n||this.s,i||this.e)}splitAt(...n){if(!this.isValid)return[];let i=n.map(wa).filter((a)=>this.contains(a)).sort((a,m)=>a.toMillis()-m.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let a=i[p]||this.e,m=+a>+this.e?this.e:a;o.push(Ln.fromDateTimes(c,m)),c=m,p+=1}return o}splitBy(n){let i=Fn.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,a=[];while(o<this.e){let m=this.start.plus(i.mapUnits((x)=>x*c));p=+m>+this.e?this.e:m,a.push(Ln.fromDateTimes(o,p)),o=p,c+=1}return a}divideEqually(n){if(!this.isValid)return[];return this.splitBy(this.length()/n).slice(0,n)}overlaps(n){return this.e>n.s&&this.s<n.e}abutsStart(n){if(!this.isValid)return!1;return+this.e===+n.s}abutsEnd(n){if(!this.isValid)return!1;return+n.e===+this.s}engulfs(n){if(!this.isValid)return!1;return this.s<=n.s&&this.e>=n.e}equals(n){if(!this.isValid||!n.isValid)return!1;return this.s.equals(n.s)&&this.e.equals(n.e)}intersection(n){if(!this.isValid)return this;let i=this.s>n.s?this.s:n.s,o=this.e<n.e?this.e:n.e;if(i>=o)return null;else return Ln.fromDateTimes(i,o)}union(n){if(!this.isValid)return this;let i=this.s<n.s?this.s:n.s,o=this.e>n.e?this.e:n.e;return Ln.fromDateTimes(i,o)}static merge(n){let[i,o]=n.sort((c,p)=>c.s-p.s).reduce(([c,p],a)=>{if(!p)return[c,a];else if(p.overlaps(a)||p.abutsStart(a))return[c,p.union(a)];else return[c.concat([p]),a]},[[],null]);if(o)i.push(o);return i}static xor(n){let i=null,o=0,c=[],p=n.map((x)=>[{time:x.s,type:"s"},{time:x.e,type:"e"}]),a=Array.prototype.concat(...p),m=a.sort((x,l)=>x.time-l.time);for(let x of m)if(o+=x.type==="s"?1:-1,o===1)i=x.time;else{if(i&&+i!==+x.time)c.push(Ln.fromDateTimes(i,x.time));i=null}return Ln.merge(c)}difference(...n){return Ln.xor([this].concat(n)).map((i)=>this.intersection(i)).filter((i)=>i&&!i.isEmpty())}toString(){if(!this.isValid)return pp;return`[${this.s.toISO()} \u2013 ${this.e.toISO()})`}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;else return`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(n=Hm,i={}){return this.isValid?Si.create(this.s.loc.clone(i),n).formatInterval(this):pp}toISO(n){if(!this.isValid)return pp;return`${this.s.toISO(n)}/${this.e.toISO(n)}`}toISODate(){if(!this.isValid)return pp;return`${this.s.toISODate()}/${this.e.toISODate()}`}toISOTime(n){if(!this.isValid)return pp;return`${this.s.toISOTime(n)}/${this.e.toISOTime(n)}`}toFormat(n,{separator:i=" \u2013 "}={}){if(!this.isValid)return pp;return`${this.s.toFormat(n)}${i}${this.e.toFormat(n)}`}toDuration(n,i){if(!this.isValid)return Fn.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return Ln.fromDateTimes(n(this.s),n(this.e))}}class ap{static hasDST(n=tn.defaultZone){let i=ln.now().setZone(n).set({month:12});return!n.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(n){return uo.isValidZone(n)}static normalizeZone(n){return ic(n,tn.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return Yn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return Yn.create(i,null,"gregory").eras(n)}static features(){return{relative:J0(),localeWeek:F0()}}}function HT(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(Fn.fromMillis(c).as("days"))}function G8(n,i,o){let c=[["years",(l,f)=>f.year-l.year],["quarters",(l,f)=>f.quarter-l.quarter+(f.year-l.year)*4],["months",(l,f)=>f.month-l.month+(f.year-l.year)*12],["weeks",(l,f)=>{let $=HT(l,f);return($-$%7)/7}],["days",HT]],p={},a=n,m,x;for(let[l,f]of c)if(o.indexOf(l)>=0)if(m=l,p[l]=f(n,i),x=a.plus(p),x>i){if(p[l]--,n=a.plus(p),n>i)x=n,p[l]--,n=a.plus(p)}else n=x;return[n,p,x,m]}function z8(n,i,o,c){let[p,a,m,x]=G8(n,i,o),l=i-p,f=o.filter((v)=>["hours","minutes","seconds","milliseconds"].indexOf(v)>=0);if(f.length===0){if(m<i)m=p.plus({[x]:1});if(m!==p)a[x]=(a[x]||0)+l/(m-p)}let $=Fn.fromObject(a,c);if(f.length>0)return Fn.fromMillis(l,c).shiftTo(...f).plus($);else return $}var nf={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},ET={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},u8=nf.hanidec.replace(/[\[|\]]/g,"").split("");function Y8(n){let i=parseInt(n,10);if(isNaN(i)){i="";for(let o=0;o<n.length;o++){let c=n.charCodeAt(o);if(n[o].search(nf.hanidec)!==-1)i+=u8.indexOf(n[o]);else for(let p in ET){let[a,m]=ET[p];if(c>=a&&c<=m)i+=c-a}}return parseInt(i,10)}else return i}function lo({numberingSystem:n},i=""){return new RegExp(`${nf[n||"latn"]}${i}`)}var O8="missing Intl.DateTimeFormat.formatToParts support";function Xn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(Y8(o))}}var H8=String.fromCharCode(160),_0=`[ ${H8}]`,y0=new RegExp(_0,"g");function E8(n){return n.replace(/\./g,"\\.?").replace(y0,_0)}function QT(n){return n.replace(/\./g,"").replace(y0," ").toLowerCase()}function fo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(E8).join("|")),deser:([o])=>n.findIndex((c)=>QT(o)===QT(c))+i}}function sT(n,i){return{regex:n,deser:([,o,c])=>Vm(o,c),groups:i}}function Xm(n){return{regex:n,deser:([i])=>i}}function Q8(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function s8(n,i){let o=lo(i),c=lo(i,"{2}"),p=lo(i,"{3}"),a=lo(i,"{4}"),m=lo(i,"{6}"),x=lo(i,"{1,2}"),l=lo(i,"{1,3}"),f=lo(i,"{1,6}"),$=lo(i,"{1,9}"),v=lo(i,"{2,4}"),w=lo(i,"{4,6}"),F=(X)=>({regex:RegExp(Q8(X.val)),deser:([G])=>G,literal:!0}),J=((X)=>{if(n.literal)return F(X);switch(X.val){case"G":return fo(i.eras("short"),0);case"GG":return fo(i.eras("long"),0);case"y":return Xn(f);case"yy":return Xn(v,Il);case"yyyy":return Xn(a);case"yyyyy":return Xn(w);case"yyyyyy":return Xn(m);case"M":return Xn(x);case"MM":return Xn(c);case"MMM":return fo(i.months("short",!0),1);case"MMMM":return fo(i.months("long",!0),1);case"L":return Xn(x);case"LL":return Xn(c);case"LLL":return fo(i.months("short",!1),1);case"LLLL":return fo(i.months("long",!1),1);case"d":return Xn(x);case"dd":return Xn(c);case"o":return Xn(l);case"ooo":return Xn(p);case"HH":return Xn(c);case"H":return Xn(x);case"hh":return Xn(c);case"h":return Xn(x);case"mm":return Xn(c);case"m":return Xn(x);case"q":return Xn(x);case"qq":return Xn(c);case"s":return Xn(x);case"ss":return Xn(c);case"S":return Xn(l);case"SSS":return Xn(p);case"u":return Xm($);case"uu":return Xm(x);case"uuu":return Xn(o);case"a":return fo(i.meridiems(),0);case"kkkk":return Xn(a);case"kk":return Xn(v,Il);case"W":return Xn(x);case"WW":return Xn(c);case"E":case"c":return Xn(o);case"EEE":return fo(i.weekdays("short",!1),1);case"EEEE":return fo(i.weekdays("long",!1),1);case"ccc":return fo(i.weekdays("short",!0),1);case"cccc":return fo(i.weekdays("long",!0),1);case"Z":case"ZZ":return sT(new RegExp(`([+-]${x.source})(?::(${c.source}))?`),2);case"ZZZ":return sT(new RegExp(`([+-]${x.source})(${c.source})?`),2);case"z":return Xm(/[a-z_+-/]{1,256}?/i);case" ":return Xm(/[^\S\n\r]/);default:return F(X)}})(n)||{invalidReason:O8};return J.token=n,J}var U8={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function b8(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let l=/^\s+$/.test(p);return{literal:!l,val:l?" ":p}}let a=i[c],m=c;if(c==="hour")if(i.hour12!=null)m=i.hour12?"hour12":"hour24";else if(i.hourCycle!=null)if(i.hourCycle==="h11"||i.hourCycle==="h12")m="hour12";else m="hour24";else m=o.hour12?"hour12":"hour24";let x=U8[m];if(typeof x==="object")x=x[a];if(x)return{literal:!1,val:x};return}function V8(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}\$`,n]}function _8(n,i,o){let c=n.match(i);if(c){let p={},a=1;for(let m in o)if(lp(o,m)){let x=o[m],l=x.groups?x.groups+1:1;if(!x.literal&&x.token)p[x.token.val[0]]=x.deser(c.slice(a,a+l));a+=l}return[c,p]}else return[c,{}]}function y8(n){let i=(a)=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},o=null,c;if(!an(n.z))o=uo.create(n.z);if(!an(n.Z)){if(!o)o=new Ai(n.Z);c=n.Z}if(!an(n.q))n.M=(n.q-1)*3+1;if(!an(n.h)){if(n.h<12&&n.a===1)n.h+=12;else if(n.h===12&&n.a===0)n.h=0}if(n.G===0&&n.y)n.y=-n.y;if(!an(n.u))n.S=ql(n.u);return[Object.keys(n).reduce((a,m)=>{let x=i(m);if(x)a[x]=n[m];return a},{}),o,c]}var Vl=null;function j8(){if(!Vl)Vl=ln.fromMillis(1555555555555);return Vl}function B8(n,i){if(n.literal)return n;let o=Si.macroTokenToFormatOpts(n.val),c=N0(o,i);if(c==null||c.includes(void 0))return n;return c}function j0(n,i){return Array.prototype.concat(...n.map((o)=>B8(o,i)))}function B0(n,i,o){let c=j0(Si.parseFormat(o),n),p=c.map((m)=>s8(m,n)),a=p.find((m)=>m.invalidReason);if(a)return{input:i,tokens:c,invalidReason:a.invalidReason};else{let[m,x]=V8(p),l=RegExp(m,"i"),[f,$]=_8(i,l,x),[v,w,F]=$?y8($):[null,null,void 0];if(lp($,"a")&&lp($,"H"))throw new zc("Can't include meridiem when specifying 24-hour format");return{input:i,tokens:c,regex:l,rawMatches:f,matches:$,result:v,zone:w,specificOffset:F}}}function N8(n,i,o){let{result:c,zone:p,specificOffset:a,invalidReason:m}=B0(n,i,o);return[c,p,a,m]}function N0(n,i){if(!n)return null;let c=Si.create(i,n).dtFormatter(j8()),p=c.formatToParts(),a=c.resolvedOptions();return p.map((m)=>b8(m,n,a))}var _l="Invalid DateTime",UT=8640000000000000;function Gm(n){return new qi("unsupported zone",`the zone "${n.name}" is not supported`)}function yl(n){if(n.weekData===null)n.weekData=Em(n.c);return n.weekData}function jl(n){if(n.localWeekData===null)n.localWeekData=Em(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Gc(n,i){let o={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new ln({...o,...i,old:o})}function L0(n,i,o){let c=n-i*60*1000,p=o.offset(c);if(i===p)return[c,i];c-=(p-i)*60*1000;let a=o.offset(c);if(p===a)return[c,p];return[n-Math.min(p,a)*60*1000,Math.max(p,a)]}function zm(n,i){n+=i*60*1000;let o=new Date(n);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}function Om(n,i,o){return L0(bm(n),i,o)}function bT(n,i){let o=n.o,c=n.c.year+Math.trunc(i.years),p=n.c.month+Math.trunc(i.months)+Math.trunc(i.quarters)*3,a={...n.c,year:c,month:p,day:Math.min(n.c.day,Qm(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},m=Fn.fromObject({years:i.years-Math.trunc(i.years),quarters:i.quarters-Math.trunc(i.quarters),months:i.months-Math.trunc(i.months),weeks:i.weeks-Math.trunc(i.weeks),days:i.days-Math.trunc(i.days),hours:i.hours,minutes:i.minutes,seconds:i.seconds,milliseconds:i.milliseconds}).as("milliseconds"),x=bm(a),[l,f]=L0(x,o,n.zone);if(m!==0)l+=m,f=n.zone.offset(l);return{ts:l,o:f}}function Ta(n,i,o,c,p,a){let{setZone:m,zone:x}=o;if(n&&Object.keys(n).length!==0||i){let l=i||x,f=ln.fromObject(n,{...o,zone:l,specificOffset:a});return m?f:f.setZone(x)}else return ln.invalid(new qi("unparsable",`the input "${p}" can't be parsed as ${c}`))}function um(n,i,o=!0){return n.isValid?Si.create(Yn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function Bl(n,i){let o=n.c.year>9999||n.c.year<0,c="";if(o&&n.c.year>=0)c+="+";if(c+=gn(n.c.year,o?6:4),i)c+="-",c+=gn(n.c.month),c+="-",c+=gn(n.c.day);else c+=gn(n.c.month),c+=gn(n.c.day);return c}function VT(n,i,o,c,p,a){let m=gn(n.c.hour);if(i){if(m+=":",m+=gn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)m+=":"}else m+=gn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(m+=gn(n.c.second),n.c.millisecond!==0||!c)m+=".",m+=gn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!a)m+="Z";else if(n.o<0)m+="-",m+=gn(Math.trunc(-n.o/60)),m+=":",m+=gn(Math.trunc(-n.o%60));else m+="+",m+=gn(Math.trunc(n.o/60)),m+=":",m+=gn(Math.trunc(n.o%60));if(a)m+="["+n.zone.ianaName+"]";return m}var t0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},L8={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},t8={ordinal:1,hour:0,minute:0,second:0,millisecond:0},D0=["year","month","day","hour","minute","second","millisecond"],D8=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],h8=["year","ordinal","hour","minute","second","millisecond"];function I8(n){let i={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!i)throw new Cl(n);return i}function _T(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return I8(n)}}function yT(n,i){let o=ic(i.zone,tn.defaultZone),c=Yn.fromObject(i),p=tn.now(),a,m;if(!an(n.year)){for(let f of D0)if(an(n[f]))n[f]=t0[f];let x=S0(n)||A0(n);if(x)return ln.invalid(x);let l=o.offset(p);[a,m]=Om(n,l,o)}else a=p;return new ln({ts:a,zone:o,loc:c,o:m})}function jT(n,i,o){let c=an(o.round)?!0:o.round,p=(m,x)=>{return m=el(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,x)},a=(m)=>{if(o.calendary)if(!i.hasSame(n,m))return i.startOf(m).diff(n.startOf(m),m).get(m);else return 0;else return i.diff(n,m).get(m)};if(o.unit)return p(a(o.unit),o.unit);for(let m of o.units){let x=a(m);if(Math.abs(x)>=1)return p(x,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function BT(n){let i={},o;if(n.length>0&&typeof n[n.length-1]==="object")i=n[n.length-1],o=Array.from(n).slice(0,n.length-1);else o=Array.from(n);return[i,o]}class ln{constructor(n){let i=n.zone||tn.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new qi("invalid input"):null)||(!i.isValid?Gm(i):null);this.ts=an(n.ts)?tn.now():n.ts;let c=null,p=null;if(!o)if(n.old&&n.old.ts===this.ts&&n.old.zone.equals(i))[c,p]=[n.old.c,n.old.o];else{let m=i.offset(this.ts);c=zm(this.ts,m),o=Number.isNaN(c.year)?new qi("invalid input"):null,c=o?null:c,p=o?null:m}this._zone=i,this.loc=n.loc||Yn.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=c,this.o=p,this.isLuxonDateTime=!0}static now(){return new ln({})}static local(){let[n,i]=BT(arguments),[o,c,p,a,m,x,l]=i;return yT({year:o,month:c,day:p,hour:a,minute:m,second:x,millisecond:l},n)}static utc(){let[n,i]=BT(arguments),[o,c,p,a,m,x,l]=i;return n.zone=Ai.utcInstance,yT({year:o,month:c,day:p,hour:a,minute:m,second:x,millisecond:l},n)}static fromJSDate(n,i={}){let o=MK(n)?n.valueOf():NaN;if(Number.isNaN(o))return ln.invalid("invalid input");let c=ic(i.zone,tn.defaultZone);if(!c.isValid)return ln.invalid(Gm(c));return new ln({ts:o,zone:c,loc:Yn.fromObject(i)})}static fromMillis(n,i={}){if(!Yc(n))throw new ui(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-UT||n>UT)return ln.invalid("Timestamp out of range");else return new ln({ts:n,zone:ic(i.zone,tn.defaultZone),loc:Yn.fromObject(i)})}static fromSeconds(n,i={}){if(!Yc(n))throw new ui("fromSeconds requires a numerical input");else return new ln({ts:n*1000,zone:ic(i.zone,tn.defaultZone),loc:Yn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=ic(i.zone,tn.defaultZone);if(!o.isValid)return ln.invalid(Gm(o));let c=Yn.fromObject(i),p=sm(n,_T),{minDaysInFirstWeek:a,startOfWeek:m}=WT(p,c),x=tn.now(),l=!an(i.specificOffset)?i.specificOffset:o.offset(x),f=!an(p.ordinal),$=!an(p.year),v=!an(p.month)||!an(p.day),w=$||v,F=p.weekYear||p.weekNumber;if((w||f)&&F)throw new zc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(v&&f)throw new zc("Can't mix ordinal dates with month/day");let M=F||p.weekday&&!w,J,X,G=zm(x,l);if(M)J=D8,X=L8,G=Em(G,a,m);else if(f)J=h8,X=t8,G=bl(G);else J=D0,X=t0;let u=!1;for(let H of J){let K=p[H];if(!an(K))u=!0;else if(u)p[H]=X[H];else p[H]=G[H]}let Q=M?JK(p,a,m):f?FK(p):S0(p),V=Q||A0(p);if(V)return ln.invalid(V);let z=M?MT(p,a,m):f?KT(p):p,[R,O]=Om(z,l,o),b=new ln({ts:R,zone:o,o:O,loc:c});if(p.weekday&&w&&n.weekday!==b.weekday)return ln.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${b.toISO()}`);return b}static fromISO(n,i={}){let[o,c]=l8(n);return Ta(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=f8(n);return Ta(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=$8(n);return Ta(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(an(n)||an(i))throw new ui("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,a=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,x,l,f]=N8(a,n,i);if(f)return ln.invalid(f);else return Ta(m,x,o,`format ${i}`,n,l)}static fromString(n,i,o={}){return ln.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=F8(n);return Ta(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new ui("need to specify a reason the DateTime is invalid");let o=n instanceof qi?n:new qi(n,i);if(tn.throwOnInvalid)throw new NT(o);else return new ln({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=N0(n,Yn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return j0(Si.parseFormat(n),Yn.fromObject(i)).map((c)=>c.val).join("")}get(n){return this[n]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?yl(this).weekYear:NaN}get weekNumber(){return this.isValid?yl(this).weekNumber:NaN}get weekday(){return this.isValid?yl(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?jl(this).weekday:NaN}get localWeekNumber(){return this.isValid?jl(this).weekNumber:NaN}get localWeekYear(){return this.isValid?jl(this).weekYear:NaN}get ordinal(){return this.isValid?bl(this.c).ordinal:NaN}get monthShort(){return this.isValid?ap.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ap.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ap.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ap.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"short",locale:this.locale});else return null}get offsetNameLong(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"long",locale:this.locale});else return null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){if(this.isOffsetFixed)return!1;else return this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let n=86400000,i=60000,o=bm(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),a=this.zone.offset(o-c*i),m=this.zone.offset(o-p*i);if(a===m)return[this];let x=o-a*i,l=o-m*i,f=zm(x,a),$=zm(l,m);if(f.hour===$.hour&&f.minute===$.minute&&f.second===$.second&&f.millisecond===$.millisecond)return[Gc(this,{ts:x}),Gc(this,{ts:l})];return[this]}get isInLeapYear(){return Ra(this.year)}get daysInMonth(){return Qm(this.year,this.month)}get daysInYear(){return this.isValid?mp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ja(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ja(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Si.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Ai.instance(n),i)}toLocal(){return this.setZone(tn.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=ic(n,tn.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return ln.invalid(Gm(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),a=this.toObject();[c]=Om(a,p,n)}return Gc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Gc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=sm(n,_T),{minDaysInFirstWeek:o,startOfWeek:c}=WT(i,this.loc),p=!an(i.weekYear)||!an(i.weekNumber)||!an(i.weekday),a=!an(i.ordinal),m=!an(i.year),x=!an(i.month)||!an(i.day),l=m||x,f=i.weekYear||i.weekNumber;if((l||a)&&f)throw new zc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(x&&a)throw new zc("Can't mix ordinal dates with month/day");let $;if(p)$=MT({...Em(this.c,o,c),...i},o,c);else if(!an(i.ordinal))$=KT({...bl(this.c),...i});else if($={...this.toObject(),...i},an(i.day))$.day=Math.min(Qm($.year,$.month),$.day);let[v,w]=Om($,this.o,this.zone);return Gc(this,{ts:v,o:w})}plus(n){if(!this.isValid)return this;let i=Fn.fromDurationLike(n);return Gc(this,bT(this,i))}minus(n){if(!this.isValid)return this;let i=Fn.fromDurationLike(n).negate();return Gc(this,bT(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=Fn.normalizeUnit(n);switch(c){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(c==="weeks")if(i){let p=this.loc.getStartOfWeek(),{weekday:a}=this;if(a<p)o.weekNumber=this.weekNumber-1;o.weekday=p}else o.weekday=1;if(c==="quarters"){let p=Math.ceil(this.month/3);o.month=(p-1)*3+1}return this.set(o)}endOf(n,i){return this.isValid?this.plus({[n]:1}).startOf(n,i).minus(1):this}toFormat(n,i={}){return this.isValid?Si.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):_l}toLocaleString(n=Hm,i={}){return this.isValid?Si.create(this.loc.clone(i),n).formatDateTime(this):_l}toLocaleParts(n={}){return this.isValid?Si.create(this.loc.clone(n),n).formatDateTimeParts(this):[]}toISO({format:n="extended",suppressSeconds:i=!1,suppressMilliseconds:o=!1,includeOffset:c=!0,extendedZone:p=!1}={}){if(!this.isValid)return null;let a=n==="extended",m=Bl(this,a);return m+="T",m+=VT(this,a,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return Bl(this,n==="extended")}toISOWeekDate(){return um(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:n=!1,suppressSeconds:i=!1,includeOffset:o=!0,includePrefix:c=!1,extendedZone:p=!1,format:a="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+VT(this,a==="extended",i,n,o,p)}toRFC2822(){return um(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return um(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){if(!this.isValid)return null;return Bl(this,!0)}toSQLTime({includeOffset:n=!0,includeZone:i=!1,includeOffsetSpace:o=!0}={}){let c="HH:mm:ss.SSS";if(i||n){if(o)c+=" ";if(i)c+="z";else if(n)c+="ZZ"}return um(this,c,!0)}toSQL(n={}){if(!this.isValid)return null;return`${this.toSQLDate()} ${this.toSQLTime(n)}`}toString(){return this.isValid?this.toISO():_l}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;else return`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1000:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1000):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(n={}){if(!this.isValid)return{};let i={...this.c};if(n.includeConfig)i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale;return i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(n,i="milliseconds",o={}){if(!this.isValid||!n.isValid)return Fn.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=KK(i).map(Fn.normalizeUnit),a=n.valueOf()>this.valueOf(),m=a?this:n,x=a?n:this,l=z8(m,x,p,c);return a?l.negate():l}diffNow(n="milliseconds",i={}){return this.diff(ln.now(),n,i)}until(n){return this.isValid?Ln.fromDateTimes(this,n):this}hasSame(n,i,o){if(!this.isValid)return!1;let c=n.valueOf(),p=this.setZone(n.zone,{keepLocalTime:!0});return p.startOf(i,o)<=c&&c<=p.endOf(i,o)}equals(n){return this.isValid&&n.isValid&&this.valueOf()===n.valueOf()&&this.zone.equals(n.zone)&&this.loc.equals(n.loc)}toRelative(n={}){if(!this.isValid)return null;let i=n.base||ln.fromObject({},{zone:this.zone}),o=n.padding?this<i?-n.padding:n.padding:0,c=["years","months","days","hours","minutes","seconds"],p=n.unit;if(Array.isArray(n.unit))c=n.unit,p=void 0;return jT(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return jT(n.base||ln.fromObject({},{zone:this.zone}),this,{...n,numeric:"auto",units:["years","months","days"],calendary:!0})}static min(...n){if(!n.every(ln.isDateTime))throw new ui("min requires all arguments be DateTimes");return XT(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(ln.isDateTime))throw new ui("max requires all arguments be DateTimes");return XT(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,a=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return B0(a,n,i)}static fromStringExplain(n,i,o={}){return ln.fromFormatExplain(n,i,o)}static get DATE_SHORT(){return Hm}static get DATE_MED(){return DT}static get DATE_MED_WITH_WEEKDAY(){return d4}static get DATE_FULL(){return hT}static get DATE_HUGE(){return IT}static get TIME_SIMPLE(){return CT}static get TIME_WITH_SECONDS(){return kT}static get TIME_WITH_SHORT_OFFSET(){return rT}static get TIME_WITH_LONG_OFFSET(){return ZT}static get TIME_24_SIMPLE(){return qT}static get TIME_24_WITH_SECONDS(){return eT}static get TIME_24_WITH_SHORT_OFFSET(){return PT}static get TIME_24_WITH_LONG_OFFSET(){return gT}static get DATETIME_SHORT(){return dT}static get DATETIME_SHORT_WITH_SECONDS(){return n0}static get DATETIME_MED(){return i0}static get DATETIME_MED_WITH_SECONDS(){return o0}static get DATETIME_MED_WITH_WEEKDAY(){return nK}static get DATETIME_FULL(){return c0}static get DATETIME_FULL_WITH_SECONDS(){return p0}static get DATETIME_HUGE(){return a0}static get DATETIME_HUGE_WITH_SECONDS(){return m0}}function wa(n){if(ln.isDateTime(n))return n;else if(n&&n.valueOf&&Yc(n.valueOf()))return ln.fromJSDate(n);else if(n&&typeof n==="object")return ln.fromObject(n);else throw new ui(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var C8="3.4.4";h0.DateTime=ln;h0.Duration=Fn;h0.FixedOffsetZone=Ai;h0.IANAZone=uo;h0.Info=ap;h0.Interval=Ln;h0.InvalidZone=kl;h0.Settings=tn;h0.SystemZone=Fa;h0.VERSION=C8;h0.Zone=Oc});var q0=h((C0)=>{Object.defineProperty(C0,"__esModule",{value:!0});C0.RE_RANGE=C0.RE_WILDCARDS=C0.PRESETS=C0.TIME_UNITS_LEN=C0.TIME_UNITS=C0.TIME_UNITS_MAP=C0.ALIASES=C0.PARSE_DEFAULTS=C0.MONTH_CONSTRAINTS=C0.CONSTRAINTS=void 0;C0.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});C0.MONTH_CONSTRAINTS=Object.freeze({1:31,2:29,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31});C0.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});C0.ALIASES=Object.freeze({jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6});C0.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});C0.TIME_UNITS=Object.freeze(Object.values(C0.TIME_UNITS_MAP));C0.TIME_UNITS_LEN=C0.TIME_UNITS.length;C0.PRESETS=Object.freeze({"@yearly":"0 0 0 1 1 *","@monthly":"0 0 0 1 * *","@weekly":"0 0 0 * * 0","@daily":"0 0 0 * * *","@hourly":"0 0 * * * *","@minutely":"0 * * * * *","@secondly":"* * * * * *","@weekdays":"0 0 0 * * 1-5","@weekends":"0 0 0 * * 0,6"});C0.RE_WILDCARDS=/\*/g;C0.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var cf=h((P0)=>{Object.defineProperty(P0,"__esModule",{value:!0});P0.ExclusiveParametersError=P0.CronError=void 0;class of extends Error{}P0.CronError=of;class e0 extends of{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}P0.ExclusiveParametersError=e0});var iw=h((d0)=>{Object.defineProperty(d0,"__esModule",{value:!0});d0.getRecordKeys=void 0;var v6=(n)=>{return Object.keys(n)};d0.getRecordKeys=v6});var ym=h((pw)=>{Object.defineProperty(pw,"__esModule",{value:!0});pw.CronTime=void 0;var Yo=I0(),ai=q0(),Ji=cf(),ow=iw();class cw{constructor(n,i,o){if(this.realDate=!1,this.second={},this.minute={},this.hour={},this.dayOfMonth={},this.month={},this.dayOfWeek={},i!=null&&o!=null)throw new Ji.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!Yo.DateTime.fromObject({},{zone:i}).isValid)throw new Ji.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof Yo.DateTime)this.source=n instanceof Date?Yo.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source),this._verifyParse()}_getWeekDay(n){return n.weekday===7?0:n.weekday}_verifyParse(){let n=ow.getRecordKeys(this.month),i=ow.getRecordKeys(this.dayOfMonth),o=!1,c=null;for(let p of n){let a=ai.MONTH_CONSTRAINTS[p];for(let m of i)if(m<=a)o=!0;if(!o)c=p,console.warn(`Month '${p}' is limited to '${a}' days.`)}if(!o&&c!==null){let p=ai.MONTH_CONSTRAINTS[c];for(let a of i)if(a>p){delete this.dayOfMonth[a];let m=a%p;this.dayOfMonth[m]=!0}}}sendAt(n){let i=this.realDate&&this.source instanceof Yo.DateTime?this.source:Yo.DateTime.local();if(this.timeZone)i=i.setZone(this.timeZone);if(this.utcOffset!==void 0){let o=this.utcOffset<0?"-":"+",c=Math.trunc(this.utcOffset/60),p=String(Math.abs(c)).padStart(2,"0"),a=Math.abs(this.utcOffset-c*60),m=String(a).padStart(2,"0"),x=`UTC${o}${p}:${m}`;if(i=i.setZone(x),!i.isValid)throw new Ji.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(Yo.DateTime.local()>i)throw new Ji.CronError("WARNING: Date in past. Will never be fired.");return i}if(n===void 0||isNaN(n)||n<0)return this.getNextDateFrom(i);else{let o=[];for(;n>0;n--)i=this.getNextDateFrom(i),o.push(i);return o}}getTimeout(){return Math.max(-1,this.sendAt().toMillis()-Yo.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return ai.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=Yo.DateTime.fromJSDate(n);let c=n,p=n.toMillis();if(i)c=c.setZone(i);if(!this.realDate){if(c.millisecond>0)c=c.set({millisecond:0,second:c.second+1})}if(!c.isValid)throw new Ji.CronError("ERROR: You specified an invalid date.");let a=Yo.DateTime.now().plus({years:8});while(!0){let m=c.toMillis()-n.toMillis();if(c>a)throw new Ji.CronError(`Something went wrong. No execution date was found in the next 8 years.
3
+ var q4=Object.create;var{getPrototypeOf:P4,defineProperty:ll,getOwnPropertyNames:r4}=Object;var g4=Object.prototype.hasOwnProperty;var fl=(n,i,o)=>{o=n!=null?q4(P4(n)):{};let c=i||!n||!n.__esModule?ll(o,"default",{value:n,enumerable:!0}):o;for(let p of r4(n))if(!g4.call(c,p))ll(c,p,{get:()=>n[p],enumerable:!0});return c};var h=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var d4=(n,i)=>{for(var o in i)ll(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var eT=h((dT)=>{Object.defineProperty(dT,"__esModule",{value:!0});class cc extends Error{}class q0 extends cc{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class P0 extends cc{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class r0 extends cc{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class zc extends cc{}class Pl extends cc{constructor(n){super(`Invalid unit ${n}`)}}class li extends cc{}class yo extends cc{constructor(){super("Zone is an abstract class")}}var j="numeric",$o="short",Bi="long",ux={year:j,month:j,day:j},g0={year:j,month:$o,day:j},f8={year:j,month:$o,day:j,weekday:$o},d0={year:j,month:Bi,day:j},e0={year:j,month:Bi,day:j,weekday:Bi},nT={hour:j,minute:j},iT={hour:j,minute:j,second:j},oT={hour:j,minute:j,second:j,timeZoneName:$o},cT={hour:j,minute:j,second:j,timeZoneName:Bi},pT={hour:j,minute:j,hourCycle:"h23"},aT={hour:j,minute:j,second:j,hourCycle:"h23"},xT={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:$o},mT={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:Bi},lT={year:j,month:j,day:j,hour:j,minute:j},fT={year:j,month:j,day:j,hour:j,minute:j,second:j},vT={year:j,month:$o,day:j,hour:j,minute:j},$T={year:j,month:$o,day:j,hour:j,minute:j,second:j},v8={year:j,month:$o,day:j,weekday:$o,hour:j,minute:j},TT={year:j,month:Bi,day:j,hour:j,minute:j,timeZoneName:$o},wT={year:j,month:Bi,day:j,hour:j,minute:j,second:j,timeZoneName:$o},JT={year:j,month:Bi,day:j,weekday:Bi,hour:j,minute:j,timeZoneName:Bi},ST={year:j,month:Bi,day:j,weekday:Bi,hour:j,minute:j,second:j,timeZoneName:Bi};class Hc{get type(){throw new yo}get name(){throw new yo}get ianaName(){return this.name}get isUniversal(){throw new yo}offsetName(n,i){throw new yo}formatOffset(n,i){throw new yo}offset(n){throw new yo}equals(n){throw new yo}get isValid(){throw new yo}}var jl=null;class Wa extends Hc{static get instance(){if(jl===null)jl=new Wa;return jl}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return HT(n,i,o)}formatOffset(n,i){return Ma(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var Ex={};function $8(n){if(!Ex[n])Ex[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"});return Ex[n]}var T8={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function w8(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,a,x,m,l,f,v]=c;return[x,p,a,m,l,f,v]}function J8(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:a,value:x}=o[p],m=T8[a];if(a==="era")c[m]=x;else if(!pn(m))c[m]=parseInt(x,10)}return c}var Gx={};class zo extends Hc{static create(n){if(!Gx[n])Gx[n]=new zo(n);return Gx[n]}static resetCache(){Gx={},Ex={}}static isValidSpecifier(n){return this.isValidZone(n)}static isValidZone(n){if(!n)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:n}).format(),!0}catch(i){return!1}}constructor(n){super();this.zoneName=n,this.valid=zo.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return HT(n,i,o,this.name)}formatOffset(n,i){return Ma(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=$8(this.name),[c,p,a,x,m,l,f]=o.formatToParts?J8(o,i):w8(o,i);if(x==="BC")c=-Math.abs(c)+1;let $=Bx({year:c,month:p,day:a,hour:m===24?0:m,minute:l,second:f,millisecond:0}),T=+i,F=T%1000;return T-=F>=0?F:1000+F,($-T)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var M0={};function S8(n,i={}){let o=JSON.stringify([n,i]),c=M0[o];if(!c)c=new Intl.ListFormat(n,i),M0[o]=c;return c}var Il={};function kl(n,i={}){let o=JSON.stringify([n,i]),c=Il[o];if(!c)c=new Intl.DateTimeFormat(n,i),Il[o]=c;return c}var sl={};function A8(n,i={}){let o=JSON.stringify([n,i]),c=sl[o];if(!c)c=new Intl.NumberFormat(n,i),sl[o]=c;return c}var Zl={};function F8(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),a=Zl[p];if(!a)a=new Intl.RelativeTimeFormat(n,i),Zl[p]=a;return a}var Aa=null;function M8(){if(Aa)return Aa;else return Aa=new Intl.DateTimeFormat().resolvedOptions().locale,Aa}var R0={};function R8(n){let i=R0[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,R0[n]=i}return i}function W8(n){let i=n.indexOf("-x-");if(i!==-1)n=n.substring(0,i);let o=n.indexOf("-u-");if(o===-1)return[n];else{let c,p;try{c=kl(n).resolvedOptions(),p=n}catch(m){let l=n.substring(0,o);c=kl(l).resolvedOptions(),p=l}let{numberingSystem:a,calendar:x}=c;return[p,a,x]}}function K8(n,i,o){if(o||i){if(!n.includes("-u-"))n+="-u";if(o)n+=`-ca-${o}`;if(i)n+=`-nu-${i}`;return n}else return n}function X8(n){let i=[];for(let o=1;o<=12;o++){let c=cn.utc(2009,o,1);i.push(n(c))}return i}function G8(n){let i=[];for(let o=1;o<=7;o++){let c=cn.utc(2016,11,13+o);i.push(n(c))}return i}function Yx(n,i,o,c){let p=n.listingMode();if(p==="error")return null;else if(p==="en")return o(i);else return c(i)}function Y8(n){if(n.numberingSystem&&n.numberingSystem!=="latn")return!1;else return n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class AT{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...a}=o;if(!i||Object.keys(a).length>0){let x={useGrouping:!1,...o};if(o.padTo>0)x.minimumIntegerDigits=o.padTo;this.inf=A8(n,x)}}format(n){if(this.inf){let i=this.floor?Math.floor(n):n;return this.inf.format(i)}else{let i=this.floor?Math.floor(n):of(n,3);return dn(i,this.padTo)}}}class FT{constructor(n,i,o){this.opts=o,this.originalZone=void 0;let c=void 0;if(this.opts.timeZone)this.dt=n;else if(n.zone.type==="fixed"){let a=-1*(n.offset/60),x=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;if(n.offset!==0&&zo.create(x).valid)c=x,this.dt=n;else c="UTC",this.dt=n.offset===0?n:n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone}else if(n.zone.type==="system")this.dt=n;else if(n.zone.type==="iana")this.dt=n,c=n.zone.name;else c="UTC",this.dt=n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone;let p={...this.opts};p.timeZone=p.timeZone||c,this.dtf=kl(i,p)}format(){if(this.originalZone)return this.formatToParts().map(({value:n})=>n).join("");return this.dtf.format(this.dt.toJSDate())}formatToParts(){let n=this.dtf.formatToParts(this.dt.toJSDate());if(this.originalZone)return n.map((i)=>{if(i.type==="timeZoneName"){let o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:o}}else return i});return n}resolvedOptions(){return this.dtf.resolvedOptions()}}class MT{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&zT())this.rtf=F8(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return Z8(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var z8={firstDay:1,minimalDays:4,weekend:[6,7]};class zn{static fromOpts(n){return zn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let a=n||Nn.defaultLocale,x=a||(p?"en-US":M8()),m=i||Nn.defaultNumberingSystem,l=o||Nn.defaultOutputCalendar,f=tl(c)||Nn.defaultWeekSettings;return new zn(x,m,l,f,a)}static resetCache(){Aa=null,Il={},sl={},Zl={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return zn.create(n,i,o,c)}constructor(n,i,o,c,p){let[a,x,m]=W8(n);this.locale=a,this.numberingSystem=i||x||null,this.outputCalendar=o||m||null,this.weekSettings=c,this.intl=K8(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=p,this.fastNumbersCached=null}get fastNumbers(){if(this.fastNumbersCached==null)this.fastNumbersCached=Y8(this);return this.fastNumbersCached}listingMode(){let n=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return n&&i?"en":"intl"}clone(n){if(!n||Object.getOwnPropertyNames(n).length===0)return this;else return zn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,tl(n.weekSettings)||this.weekSettings,n.defaultToEN||!1)}redefaultToEN(n={}){return this.clone({...n,defaultToEN:!0})}redefaultToSystem(n={}){return this.clone({...n,defaultToEN:!1})}months(n,i=!1){return Yx(this,n,UT,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=X8((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Yx(this,n,_T,()=>{let o=i?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},c=i?"format":"standalone";if(!this.weekdaysCache[c][n])this.weekdaysCache[c][n]=G8((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Yx(this,void 0,()=>bT,()=>{if(!this.meridiemCache){let n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[cn.utc(2016,11,13,9),cn.utc(2016,11,13,19)].map((i)=>this.extract(i,n,"dayperiod"))}return this.meridiemCache})}eras(n){return Yx(this,n,jT,()=>{let i={era:n};if(!this.eraCache[n])this.eraCache[n]=[cn.utc(-40,1,1),cn.utc(2017,1,1)].map((o)=>this.extract(o,i,"era"));return this.eraCache[n]})}extract(n,i,o){let c=this.dtFormatter(n,i),p=c.formatToParts(),a=p.find((x)=>x.type.toLowerCase()===o);return a?a.value:null}numberFormatter(n={}){return new AT(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new FT(n,this.intl,i)}relFormatter(n={}){return new MT(this.intl,this.isEnglish(),n)}listFormatter(n={}){return S8(this.intl,n)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){if(this.weekSettings)return this.weekSettings;else if(!QT())return z8;else return R8(this.locale)}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(n){return this.locale===n.locale&&this.numberingSystem===n.numberingSystem&&this.outputCalendar===n.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}var yl=null;class Fi extends Hc{static get utcInstance(){if(yl===null)yl=new Fi(0);return yl}static instance(n){return n===0?Fi.utcInstance:new Fi(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Fi(Lx(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ma(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Ma(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Ma(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(n){return n.type==="fixed"&&n.fixed===this.fixed}get isValid(){return!0}}class rl extends Hc{constructor(n){super();this.zoneName=n}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ic(n,i){if(pn(n)||n===null)return i;else if(n instanceof Hc)return n;else if(V8(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Wa.instance;else if(o==="utc"||o==="gmt")return Fi.utcInstance;else return Fi.parseSpecifier(o)||zo.create(n)}else if(oc(n))return Fi.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new rl(n)}var gl={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},W0={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Q8=gl.hanidec.replace(/[\[|\]]/g,"").split("");function H8(n){let i=parseInt(n,10);if(isNaN(i)){i="";for(let o=0;o<n.length;o++){let c=n.charCodeAt(o);if(n[o].search(gl.hanidec)!==-1)i+=Q8.indexOf(n[o]);else for(let p in W0){let[a,x]=W0[p];if(c>=a&&c<=x)i+=c-a}}return parseInt(i,10)}else return i}var mp={};function E8(){mp={}}function fo({numberingSystem:n},i=""){let o=n||"latn";if(!mp[o])mp[o]={};if(!mp[o][i])mp[o][i]=new RegExp(`${gl[o]}${i}`);return mp[o][i]}var K0=()=>Date.now(),X0="system",G0=null,Y0=null,z0=null,Q0=60,H0,E0=null;class Nn{static get now(){return K0}static set now(n){K0=n}static set defaultZone(n){X0=n}static get defaultZone(){return ic(X0,Wa.instance)}static get defaultLocale(){return G0}static set defaultLocale(n){G0=n}static get defaultNumberingSystem(){return Y0}static set defaultNumberingSystem(n){Y0=n}static get defaultOutputCalendar(){return z0}static set defaultOutputCalendar(n){z0=n}static get defaultWeekSettings(){return E0}static set defaultWeekSettings(n){E0=tl(n)}static get twoDigitCutoffYear(){return Q0}static set twoDigitCutoffYear(n){Q0=n%100}static get throwOnInvalid(){return H0}static set throwOnInvalid(n){H0=n}static resetCaches(){zn.resetCache(),zo.resetCache(),cn.resetCache(),E8()}}class Pi{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var RT=[0,31,59,90,120,151,181,212,243,273,304,334],WT=[0,31,60,91,121,152,182,213,244,274,305,335];function ri(n,i){return new Pi("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function dl(n,i,o){let c=new Date(Date.UTC(n,i-1,o));if(n<100&&n>=0)c.setUTCFullYear(c.getUTCFullYear()-1900);let p=c.getUTCDay();return p===0?7:p}function KT(n,i,o){return o+(Ka(n)?WT:RT)[i-1]}function XT(n,i){let o=Ka(n)?WT:RT,c=o.findIndex((a)=>a<i),p=i-o[c];return{month:c+1,day:p}}function el(n,i){return(n-i+7)%7+1}function _x(n,i=4,o=1){let{year:c,month:p,day:a}=n,x=KT(c,p,a),m=el(dl(c,p,a),o),l=Math.floor((x-m+14-i)/7),f;if(l<1)f=c-1,l=Ra(f,i,o);else if(l>Ra(c,i,o))f=c+1,l=1;else f=c;return{weekYear:f,weekNumber:l,weekday:m,...Nx(n)}}function O0(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:a}=n,x=el(dl(c,1,i),o),m=fp(c),l=p*7+a-x-7+i,f;if(l<1)f=c-1,l+=fp(f);else if(l>m)f=c+1,l-=fp(c);else f=c;let{month:v,day:$}=XT(f,l);return{year:f,month:v,day:$,...Nx(n)}}function Bl(n){let{year:i,month:o,day:c}=n,p=KT(i,o,c);return{year:i,ordinal:p,...Nx(n)}}function U0(n){let{year:i,ordinal:o}=n,{month:c,day:p}=XT(i,o);return{year:i,month:c,day:p,...Nx(n)}}function V0(n,i){if(!pn(n.localWeekday)||!pn(n.localWeekNumber)||!pn(n.localWeekYear)){if(!pn(n.weekday)||!pn(n.weekNumber)||!pn(n.weekYear))throw new zc("Cannot mix locale-based week fields with ISO-based week fields");if(!pn(n.localWeekday))n.weekday=n.localWeekday;if(!pn(n.localWeekNumber))n.weekNumber=n.localWeekNumber;if(!pn(n.localWeekYear))n.weekYear=n.localWeekYear;return delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:i.getMinDaysInFirstWeek(),startOfWeek:i.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function O8(n,i=4,o=1){let c=yx(n.weekYear),p=gi(n.weekNumber,1,Ra(n.weekYear,i,o)),a=gi(n.weekday,1,7);if(!c)return ri("weekYear",n.weekYear);else if(!p)return ri("week",n.weekNumber);else if(!a)return ri("weekday",n.weekday);else return!1}function U8(n){let i=yx(n.year),o=gi(n.ordinal,1,fp(n.year));if(!i)return ri("year",n.year);else if(!o)return ri("ordinal",n.ordinal);else return!1}function GT(n){let i=yx(n.year),o=gi(n.month,1,12),c=gi(n.day,1,bx(n.year,n.month));if(!i)return ri("year",n.year);else if(!o)return ri("month",n.month);else if(!c)return ri("day",n.day);else return!1}function YT(n){let{hour:i,minute:o,second:c,millisecond:p}=n,a=gi(i,0,23)||i===24&&o===0&&c===0&&p===0,x=gi(o,0,59),m=gi(c,0,59),l=gi(p,0,999);if(!a)return ri("hour",i);else if(!x)return ri("minute",o);else if(!m)return ri("second",c);else if(!l)return ri("millisecond",p);else return!1}function pn(n){return typeof n==="undefined"}function oc(n){return typeof n==="number"}function yx(n){return typeof n==="number"&&n%1===0}function V8(n){return typeof n==="string"}function u8(n){return Object.prototype.toString.call(n)==="[object Date]"}function zT(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function QT(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function _8(n){return Array.isArray(n)?n:[n]}function u0(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let a=[i(p),p];if(!c)return a;else if(o(c[0],a[0])===c[0])return c;else return a},null)[1]}function b8(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function $p(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function tl(n){if(n==null)return null;else if(typeof n!=="object")throw new li("Week settings must be an object");else{if(!gi(n.firstDay,1,7)||!gi(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some((i)=>!gi(i,1,7)))throw new li("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}}function gi(n,i,o){return yx(n)&&n>=i&&n<=o}function j8(n,i){return n-i*Math.floor(n/i)}function dn(n,i=2){let o=n<0,c;if(o)c="-"+(""+-n).padStart(i,"0");else c=(""+n).padStart(i,"0");return c}function nc(n){if(pn(n)||n===null||n==="")return;else return parseInt(n,10)}function Gc(n){if(pn(n)||n===null||n==="")return;else return parseFloat(n)}function nf(n){if(pn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function of(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Ka(n){return n%4===0&&(n%100!==0||n%400===0)}function fp(n){return Ka(n)?366:365}function bx(n,i){let o=j8(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Ka(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function Bx(n){let i=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);if(n.year<100&&n.year>=0)i=new Date(i),i.setUTCFullYear(n.year,n.month-1,n.day);return+i}function _0(n,i,o){return-el(dl(n,1,i),o)+i-1}function Ra(n,i=4,o=1){let c=_0(n,i,o),p=_0(n+1,i,o);return(fp(n)-c+p)/7}function ql(n){if(n>99)return n;else return n>Nn.twoDigitCutoffYear?1900+n:2000+n}function HT(n,i,o,c=null){let p=new Date(n),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)a.timeZone=c;let x={timeZoneName:i,...a},m=new Intl.DateTimeFormat(o,x).formatToParts(p).find((l)=>l.type.toLowerCase()==="timezonename");return m?m.value:null}function Lx(n,i){let o=parseInt(n,10);if(Number.isNaN(o))o=0;let c=parseInt(i,10)||0,p=o<0||Object.is(o,-0)?-c:c;return o*60+p}function ET(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new li(`Invalid unit value ${n}`);return i}function jx(n,i){let o={};for(let c in n)if($p(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=ET(p)}return o}function Ma(n,i){let o=Math.trunc(Math.abs(n/60)),c=Math.trunc(Math.abs(n%60)),p=n>=0?"+":"-";switch(i){case"short":return`${p}${dn(o,2)}:${dn(c,2)}`;case"narrow":return`${p}${o}${c>0?`:${c}`:""}`;case"techie":return`${p}${dn(o,2)}${dn(c,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function Nx(n){return b8(n,["hour","minute","second","millisecond"])}var y8=["January","February","March","April","May","June","July","August","September","October","November","December"],OT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B8=["J","F","M","A","M","J","J","A","S","O","N","D"];function UT(n){switch(n){case"narrow":return[...B8];case"short":return[...OT];case"long":return[...y8];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var VT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],uT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],L8=["M","T","W","T","F","S","S"];function _T(n){switch(n){case"narrow":return[...L8];case"short":return[...uT];case"long":return[...VT];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var bT=["AM","PM"],N8=["Before Christ","Anno Domini"],D8=["BC","AD"],C8=["B","A"];function jT(n){switch(n){case"narrow":return[...C8];case"short":return[...D8];case"long":return[...N8];default:return null}}function h8(n){return bT[n.hour<12?0:1]}function I8(n,i){return _T(i)[n.weekday-1]}function k8(n,i){return UT(i)[n.month-1]}function s8(n,i){return jT(i)[n.year<0?0:1]}function Z8(n,i,o="always",c=!1){let p={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&a){let $=n==="days";switch(i){case 1:return $?"tomorrow":`next ${p[n][0]}`;case-1:return $?"yesterday":`last ${p[n][0]}`;case 0:return $?"today":`this ${p[n][0]}`}}let x=Object.is(i,-0)||i<0,m=Math.abs(i),l=m===1,f=p[n],v=c?l?f[1]:f[2]||f[1]:l?p[n][0]:n;return x?`${m} ${v} ago`:`in ${m} ${v}`}function b0(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var t8={D:ux,DD:g0,DDD:d0,DDDD:e0,t:nT,tt:iT,ttt:oT,tttt:cT,T:pT,TT:aT,TTT:xT,TTTT:mT,f:lT,ff:vT,fff:TT,ffff:JT,F:fT,FF:$T,FFF:wT,FFFF:ST};class Ai{static create(n,i={}){return new Ai(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let a=0;a<n.length;a++){let x=n.charAt(a);if(x==="'"){if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});i=null,o="",c=!c}else if(c)o+=x;else if(x===i)o+=x;else{if(o.length>0)p.push({literal:/^\s+$/.test(o),val:o});o=x,i=x}}if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});return p}static macroTokenToFormatOpts(n){return t8[n]}constructor(n,i){this.opts=i,this.loc=n,this.systemLoc=null}formatWithSystemDefault(n,i){if(this.systemLoc===null)this.systemLoc=this.loc.redefaultToSystem();return this.systemLoc.dtFormatter(n,{...this.opts,...i}).format()}dtFormatter(n,i={}){return this.loc.dtFormatter(n,{...this.opts,...i})}formatDateTime(n,i){return this.dtFormatter(n,i).format()}formatDateTimeParts(n,i){return this.dtFormatter(n,i).formatToParts()}formatInterval(n,i){return this.dtFormatter(n.start,i).dtf.formatRange(n.start.toJSDate(),n.end.toJSDate())}resolvedOptions(n,i){return this.dtFormatter(n,i).resolvedOptions()}num(n,i=0){if(this.opts.forceSimple)return dn(n,i);let o={...this.opts};if(i>0)o.padTo=i;return this.loc.numberFormatter(o).format(n)}formatDateTimeFromString(n,i){let o=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",p=(T,F)=>this.loc.extract(n,T,F),a=(T)=>{if(n.isOffsetFixed&&n.offset===0&&T.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,T.format):""},x=()=>o?h8(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),m=(T,F)=>o?k8(n,T):p(F?{month:T}:{month:T,day:"numeric"},"month"),l=(T,F)=>o?I8(n,T):p(F?{weekday:T}:{weekday:T,month:"long",day:"numeric"},"weekday"),f=(T)=>{let F=Ai.macroTokenToFormatOpts(T);if(F)return this.formatWithSystemDefault(n,F);else return T},v=(T)=>o?s8(n,T):p({era:T},"era"),$=(T)=>{switch(T){case"S":return this.num(n.millisecond);case"u":case"SSS":return this.num(n.millisecond,3);case"s":return this.num(n.second);case"ss":return this.num(n.second,2);case"uu":return this.num(Math.floor(n.millisecond/10),2);case"uuu":return this.num(Math.floor(n.millisecond/100));case"m":return this.num(n.minute);case"mm":return this.num(n.minute,2);case"h":return this.num(n.hour%12===0?12:n.hour%12);case"hh":return this.num(n.hour%12===0?12:n.hour%12,2);case"H":return this.num(n.hour);case"HH":return this.num(n.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:this.loc.locale});case"z":return n.zoneName;case"a":return x();case"d":return c?p({day:"numeric"},"day"):this.num(n.day);case"dd":return c?p({day:"2-digit"},"day"):this.num(n.day,2);case"c":return this.num(n.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return c?p({month:"numeric",day:"numeric"},"month"):this.num(n.month);case"LL":return c?p({month:"2-digit",day:"numeric"},"month"):this.num(n.month,2);case"LLL":return m("short",!0);case"LLLL":return m("long",!0);case"LLLLL":return m("narrow",!0);case"M":return c?p({month:"numeric"},"month"):this.num(n.month);case"MM":return c?p({month:"2-digit"},"month"):this.num(n.month,2);case"MMM":return m("short",!1);case"MMMM":return m("long",!1);case"MMMMM":return m("narrow",!1);case"y":return c?p({year:"numeric"},"year"):this.num(n.year);case"yy":return c?p({year:"2-digit"},"year"):this.num(n.year.toString().slice(-2),2);case"yyyy":return c?p({year:"numeric"},"year"):this.num(n.year,4);case"yyyyyy":return c?p({year:"numeric"},"year"):this.num(n.year,6);case"G":return v("short");case"GG":return v("long");case"GGGGG":return v("narrow");case"kk":return this.num(n.weekYear.toString().slice(-2),2);case"kkkk":return this.num(n.weekYear,4);case"W":return this.num(n.weekNumber);case"WW":return this.num(n.weekNumber,2);case"n":return this.num(n.localWeekNumber);case"nn":return this.num(n.localWeekNumber,2);case"ii":return this.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(n.localWeekYear,4);case"o":return this.num(n.ordinal);case"ooo":return this.num(n.ordinal,3);case"q":return this.num(n.quarter);case"qq":return this.num(n.quarter,2);case"X":return this.num(Math.floor(n.ts/1000));case"x":return this.num(n.ts);default:return f(T)}};return b0(Ai.parseFormat(i),$)}formatDurationFromString(n,i){let o=(m)=>{switch(m[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=(m)=>(l)=>{let f=o(l);if(f)return this.num(m.get(f),l.length);else return l},p=Ai.parseFormat(i),a=p.reduce((m,{literal:l,val:f})=>l?m:m.concat(f),[]),x=n.shiftTo(...a.map(o).filter((m)=>m));return b0(p,c(x))}}var yT=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Tp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}\$`)}function wp(...n){return(i)=>n.reduce(([o,c,p],a)=>{let[x,m,l]=a(i,p);return[{...o,...x},m||c,l]},[{},null,1]).slice(0,2)}function Jp(n,...i){if(n==null)return[null,null];for(let[o,c]of i){let p=o.exec(n);if(p)return c(p)}return[null,null]}function BT(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=nc(i[o+p]);return[c,null,o+p]}}var LT=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,q8=`(?:${LT.source}?(?:\\[(${yT.source})\\])?)?`,cf=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,NT=RegExp(`${cf.source}${q8}`),pf=RegExp(`(?:T${NT.source})?`),P8=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,r8=/(\d{4})-?W(\d\d)(?:-?(\d))?/,g8=/(\d{4})-?(\d{3})/,d8=BT("weekYear","weekNumber","weekDay"),e8=BT("year","ordinal"),n6=/(\d{4})-(\d\d)-(\d\d)/,DT=RegExp(`${cf.source} ?(?:${LT.source}|(${yT.source}))?`),i6=RegExp(`(?: ${DT.source})?`);function vp(n,i,o){let c=n[i];return pn(c)?o:nc(c)}function o6(n,i){return[{year:vp(n,i),month:vp(n,i+1,1),day:vp(n,i+2,1)},null,i+3]}function Sp(n,i){return[{hours:vp(n,i,0),minutes:vp(n,i+1,0),seconds:vp(n,i+2,0),milliseconds:nf(n[i+3])},null,i+4]}function Xa(n,i){let o=!n[i]&&!n[i+1],c=Lx(n[i+1],n[i+2]),p=o?null:Fi.instance(c);return[{},p,i+3]}function Ga(n,i){let o=n[i]?zo.create(n[i]):null;return[{},o,i+1]}var c6=RegExp(`^T?${cf.source}\$`),p6=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function a6(n){let[i,o,c,p,a,x,m,l,f]=n,v=i[0]==="-",$=l&&l[0]==="-",T=(F,M=!1)=>F!==void 0&&(M||F&&v)?-F:F;return[{years:T(Gc(o)),months:T(Gc(c)),weeks:T(Gc(p)),days:T(Gc(a)),hours:T(Gc(x)),minutes:T(Gc(m)),seconds:T(Gc(l),l==="-0"),milliseconds:T(nf(f),$)}]}var x6={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function af(n,i,o,c,p,a,x){let m={year:i.length===2?ql(nc(i)):nc(i),month:OT.indexOf(o)+1,day:nc(c),hour:nc(p),minute:nc(a)};if(x)m.second=nc(x);if(n)m.weekday=n.length>3?VT.indexOf(n)+1:uT.indexOf(n)+1;return m}var m6=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function l6(n){let[,i,o,c,p,a,x,m,l,f,v,$]=n,T=af(i,p,c,o,a,x,m),F;if(l)F=x6[l];else if(f)F=0;else F=Lx(v,$);return[T,new Fi(F)]}function f6(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var v6=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,$6=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,T6=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function j0(n){let[,i,o,c,p,a,x,m]=n;return[af(i,p,c,o,a,x,m),Fi.utcInstance]}function w6(n){let[,i,o,c,p,a,x,m]=n;return[af(i,m,o,c,p,a,x),Fi.utcInstance]}var J6=Tp(P8,pf),S6=Tp(r8,pf),A6=Tp(g8,pf),F6=Tp(NT),CT=wp(o6,Sp,Xa,Ga),M6=wp(d8,Sp,Xa,Ga),R6=wp(e8,Sp,Xa,Ga),W6=wp(Sp,Xa,Ga);function K6(n){return Jp(n,[J6,CT],[S6,M6],[A6,R6],[F6,W6])}function X6(n){return Jp(f6(n),[m6,l6])}function G6(n){return Jp(n,[v6,j0],[$6,j0],[T6,w6])}function Y6(n){return Jp(n,[p6,a6])}var z6=wp(Sp);function Q6(n){return Jp(n,[c6,z6])}var H6=Tp(n6,i6),E6=Tp(DT),O6=wp(Sp,Xa,Ga);function U6(n){return Jp(n,[H6,CT],[E6,O6])}var y0="Invalid Duration",hT={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:604800000},days:{hours:24,minutes:1440,seconds:86400,milliseconds:86400000},hours:{minutes:60,seconds:3600,milliseconds:3600000},minutes:{seconds:60,milliseconds:60000},seconds:{milliseconds:1000}},V6={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536000,milliseconds:31536000000},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:7862400000},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592000,milliseconds:2592000000},...hT},qi=365.2425,pp=30.436875,u6={years:{quarters:4,months:12,weeks:qi/7,days:qi,hours:qi*24,minutes:qi*24*60,seconds:qi*24*60*60,milliseconds:qi*24*60*60*1000},quarters:{months:3,weeks:qi/28,days:qi/4,hours:qi*24/4,minutes:qi*24*60/4,seconds:qi*24*60*60/4,milliseconds:qi*24*60*60*1000/4},months:{weeks:pp/7,days:pp,hours:pp*24,minutes:pp*24*60,seconds:pp*24*60*60,milliseconds:pp*24*60*60*1000},...hT},Qc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],_6=Qc.slice(0).reverse();function eo(n,i,o=!1){let c={values:o?i.values:{...n.values,...i.values||{}},loc:n.loc.clone(i.loc),conversionAccuracy:i.conversionAccuracy||n.conversionAccuracy,matrix:i.matrix||n.matrix};return new Mn(c)}function IT(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of _6.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function B0(n,i){let o=IT(n,i)<0?-1:1;Qc.reduceRight((c,p)=>{if(!pn(i[p])){if(c){let a=i[c]*o,x=n[p][c],m=Math.floor(a/x);i[p]+=m*o,i[c]-=m*x*o}return p}else return c},null),Qc.reduce((c,p)=>{if(!pn(i[p])){if(c){let a=i[c]%1;i[c]-=a,i[p]+=a*n[c][p]}return p}else return c},null)}function b6(n){let i={};for(let[o,c]of Object.entries(n))if(c!==0)i[o]=c;return i}class Mn{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?u6:V6;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||zn.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return Mn.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new li(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new Mn({values:jx(n,Mn.normalizeUnit),loc:zn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(oc(n))return Mn.fromMillis(n);else if(Mn.isDuration(n))return n;else if(typeof n==="object")return Mn.fromObject(n);else throw new li(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=Y6(n);if(o)return Mn.fromObject(o,i);else return Mn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=Q6(n);if(o)return Mn.fromObject(o,i);else return Mn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new li("need to specify a reason the Duration is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Nn.throwOnInvalid)throw new r0(o);else return new Mn({invalid:o})}static normalizeUnit(n){let i={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[n?n.toLowerCase():n];if(!i)throw new Pl(n);return i}static isDuration(n){return n&&n.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(n,i={}){let o={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?Ai.create(this.loc,o).formatDurationFromString(this,n):y0}toHuman(n={}){if(!this.isValid)return y0;let i=Qc.map((o)=>{let c=this.values[o];if(pn(c))return null;return this.loc.numberFormatter({style:"unit",unitDisplay:"long",...n,unit:o.slice(0,-1)}).format(c)}).filter((o)=>o);return this.loc.listFormatter({type:"conjunction",style:n.listStyle||"narrow",...n}).format(i)}toObject(){if(!this.isValid)return{};return{...this.values}}toISO(){if(!this.isValid)return null;let n="P";if(this.years!==0)n+=this.years+"Y";if(this.months!==0||this.quarters!==0)n+=this.months+this.quarters*3+"M";if(this.weeks!==0)n+=this.weeks+"W";if(this.days!==0)n+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)n+="T";if(this.hours!==0)n+=this.hours+"H";if(this.minutes!==0)n+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0)n+=of(this.seconds+this.milliseconds/1000,3)+"S";if(n==="P")n+="T0S";return n}toISOTime(n={}){if(!this.isValid)return null;let i=this.toMillis();if(i<0||i>=86400000)return null;return n={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...n,includeOffset:!1},cn.fromMillis(i,{zone:"UTC"}).toISOTime(n)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Duration { values: ${JSON.stringify(this.values)} }`;else return`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){if(!this.isValid)return NaN;return IT(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=Mn.fromDurationLike(n),o={};for(let c of Qc)if($p(i.values,c)||$p(this.values,c))o[c]=i.get(c)+this.get(c);return eo(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=Mn.fromDurationLike(n);return this.plus(i.negate())}mapUnits(n){if(!this.isValid)return this;let i={};for(let o of Object.keys(this.values))i[o]=ET(n(this.values[o],o));return eo(this,{values:i},!0)}get(n){return this[Mn.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,...jx(n,Mn.normalizeUnit)};return eo(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let a={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return eo(this,a)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return B0(this.matrix,n),eo(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=b6(this.normalize().shiftToAll().toObject());return eo(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((a)=>Mn.normalizeUnit(a));let i={},o={},c=this.toObject(),p;for(let a of Qc)if(n.indexOf(a)>=0){p=a;let x=0;for(let l in o)x+=this.matrix[l][a]*o[l],o[l]=0;if(oc(c[a]))x+=c[a];let m=Math.trunc(x);i[a]=m,o[a]=(x*1000-m*1000)/1000}else if(oc(c[a]))o[a]=c[a];for(let a in o)if(o[a]!==0)i[p]+=a===p?o[a]:o[a]/this.matrix[p][a];return B0(this.matrix,i),eo(this,{values:i},!0)}shiftToAll(){if(!this.isValid)return this;return this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds")}negate(){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=this.values[i]===0?0:-this.values[i];return eo(this,{values:n},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(n){if(!this.isValid||!n.isValid)return!1;if(!this.loc.equals(n.loc))return!1;function i(o,c){if(o===void 0||o===0)return c===void 0||c===0;return o===c}for(let o of Qc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var ap="Invalid Interval";function j6(n,i){if(!n||!n.isValid)return Cn.invalid("missing or invalid start");else if(!i||!i.isValid)return Cn.invalid("missing or invalid end");else if(i<n)return Cn.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${i.toISO()}`);else return null}class Cn{constructor(n){this.s=n.start,this.e=n.end,this.invalid=n.invalid||null,this.isLuxonInterval=!0}static invalid(n,i=null){if(!n)throw new li("need to specify a reason the Interval is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Nn.throwOnInvalid)throw new P0(o);else return new Cn({invalid:o})}static fromDateTimes(n,i){let o=Sa(n),c=Sa(i),p=j6(o,c);if(p==null)return new Cn({start:o,end:c});else return p}static after(n,i){let o=Mn.fromDurationLike(i),c=Sa(n);return Cn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=Mn.fromDurationLike(i),c=Sa(n);return Cn.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,a;try{p=cn.fromISO(o,i),a=p.isValid}catch(l){a=!1}let x,m;try{x=cn.fromISO(c,i),m=x.isValid}catch(l){m=!1}if(a&&m)return Cn.fromDateTimes(p,x);if(a){let l=Mn.fromISO(c,i);if(l.isValid)return Cn.after(p,l)}else if(m){let l=Mn.fromISO(o,i);if(l.isValid)return Cn.before(x,l)}}return Cn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static isInterval(n){return n&&n.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(n="milliseconds"){return this.isValid?this.toDuration(...[n]).get(n):NaN}count(n="milliseconds",i){if(!this.isValid)return NaN;let o=this.start.startOf(n,i),c;if(i!=null&&i.useLocaleWeeks)c=this.end.reconfigure({locale:o.locale});else c=this.end;return c=c.startOf(n,i),Math.floor(c.diff(o,n).get(n))+(c.valueOf()!==this.end.valueOf())}hasSame(n){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,n):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(n){if(!this.isValid)return!1;return this.s>n}isBefore(n){if(!this.isValid)return!1;return this.e<=n}contains(n){if(!this.isValid)return!1;return this.s<=n&&this.e>n}set({start:n,end:i}={}){if(!this.isValid)return this;return Cn.fromDateTimes(n||this.s,i||this.e)}splitAt(...n){if(!this.isValid)return[];let i=n.map(Sa).filter((a)=>this.contains(a)).sort((a,x)=>a.toMillis()-x.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let a=i[p]||this.e,x=+a>+this.e?this.e:a;o.push(Cn.fromDateTimes(c,x)),c=x,p+=1}return o}splitBy(n){let i=Mn.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,a=[];while(o<this.e){let x=this.start.plus(i.mapUnits((m)=>m*c));p=+x>+this.e?this.e:x,a.push(Cn.fromDateTimes(o,p)),o=p,c+=1}return a}divideEqually(n){if(!this.isValid)return[];return this.splitBy(this.length()/n).slice(0,n)}overlaps(n){return this.e>n.s&&this.s<n.e}abutsStart(n){if(!this.isValid)return!1;return+this.e===+n.s}abutsEnd(n){if(!this.isValid)return!1;return+n.e===+this.s}engulfs(n){if(!this.isValid)return!1;return this.s<=n.s&&this.e>=n.e}equals(n){if(!this.isValid||!n.isValid)return!1;return this.s.equals(n.s)&&this.e.equals(n.e)}intersection(n){if(!this.isValid)return this;let i=this.s>n.s?this.s:n.s,o=this.e<n.e?this.e:n.e;if(i>=o)return null;else return Cn.fromDateTimes(i,o)}union(n){if(!this.isValid)return this;let i=this.s<n.s?this.s:n.s,o=this.e>n.e?this.e:n.e;return Cn.fromDateTimes(i,o)}static merge(n){let[i,o]=n.sort((c,p)=>c.s-p.s).reduce(([c,p],a)=>{if(!p)return[c,a];else if(p.overlaps(a)||p.abutsStart(a))return[c,p.union(a)];else return[c.concat([p]),a]},[[],null]);if(o)i.push(o);return i}static xor(n){let i=null,o=0,c=[],p=n.map((m)=>[{time:m.s,type:"s"},{time:m.e,type:"e"}]),a=Array.prototype.concat(...p),x=a.sort((m,l)=>m.time-l.time);for(let m of x)if(o+=m.type==="s"?1:-1,o===1)i=m.time;else{if(i&&+i!==+m.time)c.push(Cn.fromDateTimes(i,m.time));i=null}return Cn.merge(c)}difference(...n){return Cn.xor([this].concat(n)).map((i)=>this.intersection(i)).filter((i)=>i&&!i.isEmpty())}toString(){if(!this.isValid)return ap;return`[${this.s.toISO()} \u2013 ${this.e.toISO()})`}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;else return`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(n=ux,i={}){return this.isValid?Ai.create(this.s.loc.clone(i),n).formatInterval(this):ap}toISO(n){if(!this.isValid)return ap;return`${this.s.toISO(n)}/${this.e.toISO(n)}`}toISODate(){if(!this.isValid)return ap;return`${this.s.toISODate()}/${this.e.toISODate()}`}toISOTime(n){if(!this.isValid)return ap;return`${this.s.toISOTime(n)}/${this.e.toISOTime(n)}`}toFormat(n,{separator:i=" \u2013 "}={}){if(!this.isValid)return ap;return`${this.s.toFormat(n)}${i}${this.e.toFormat(n)}`}toDuration(n,i){if(!this.isValid)return Mn.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return Cn.fromDateTimes(n(this.s),n(this.e))}}class lp{static hasDST(n=Nn.defaultZone){let i=cn.now().setZone(n).set({month:12});return!n.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(n){return zo.isValidZone(n)}static normalizeZone(n){return ic(n,Nn.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||zn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||zn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||zn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||zn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||zn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||zn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||zn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return zn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return zn.create(i,null,"gregory").eras(n)}static features(){return{relative:zT(),localeWeek:QT()}}}function L0(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(Mn.fromMillis(c).as("days"))}function y6(n,i,o){let c=[["years",(l,f)=>f.year-l.year],["quarters",(l,f)=>f.quarter-l.quarter+(f.year-l.year)*4],["months",(l,f)=>f.month-l.month+(f.year-l.year)*12],["weeks",(l,f)=>{let v=L0(l,f);return(v-v%7)/7}],["days",L0]],p={},a=n,x,m;for(let[l,f]of c)if(o.indexOf(l)>=0)if(x=l,p[l]=f(n,i),m=a.plus(p),m>i){if(p[l]--,n=a.plus(p),n>i)m=n,p[l]--,n=a.plus(p)}else n=m;return[n,p,m,x]}function B6(n,i,o,c){let[p,a,x,m]=y6(n,i,o),l=i-p,f=o.filter(($)=>["hours","minutes","seconds","milliseconds"].indexOf($)>=0);if(f.length===0){if(x<i)x=p.plus({[m]:1});if(x!==p)a[m]=(a[m]||0)+l/(x-p)}let v=Mn.fromObject(a,c);if(f.length>0)return Mn.fromMillis(l,c).shiftTo(...f).plus(v);else return v}var L6="missing Intl.DateTimeFormat.formatToParts support";function Xn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(H8(o))}}var N6=String.fromCharCode(160),kT=`[ ${N6}]`,sT=new RegExp(kT,"g");function D6(n){return n.replace(/\./g,"\\.?").replace(sT,kT)}function N0(n){return n.replace(/\./g,"").replace(sT," ").toLowerCase()}function vo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(D6).join("|")),deser:([o])=>n.findIndex((c)=>N0(o)===N0(c))+i}}function D0(n,i){return{regex:n,deser:([,o,c])=>Lx(o,c),groups:i}}function zx(n){return{regex:n,deser:([i])=>i}}function C6(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function h6(n,i){let o=fo(i),c=fo(i,"{2}"),p=fo(i,"{3}"),a=fo(i,"{4}"),x=fo(i,"{6}"),m=fo(i,"{1,2}"),l=fo(i,"{1,3}"),f=fo(i,"{1,6}"),v=fo(i,"{1,9}"),$=fo(i,"{2,4}"),T=fo(i,"{4,6}"),F=(R)=>({regex:RegExp(C6(R.val)),deser:([G])=>G,literal:!0}),A=((R)=>{if(n.literal)return F(R);switch(R.val){case"G":return vo(i.eras("short"),0);case"GG":return vo(i.eras("long"),0);case"y":return Xn(f);case"yy":return Xn($,ql);case"yyyy":return Xn(a);case"yyyyy":return Xn(T);case"yyyyyy":return Xn(x);case"M":return Xn(m);case"MM":return Xn(c);case"MMM":return vo(i.months("short",!0),1);case"MMMM":return vo(i.months("long",!0),1);case"L":return Xn(m);case"LL":return Xn(c);case"LLL":return vo(i.months("short",!1),1);case"LLLL":return vo(i.months("long",!1),1);case"d":return Xn(m);case"dd":return Xn(c);case"o":return Xn(l);case"ooo":return Xn(p);case"HH":return Xn(c);case"H":return Xn(m);case"hh":return Xn(c);case"h":return Xn(m);case"mm":return Xn(c);case"m":return Xn(m);case"q":return Xn(m);case"qq":return Xn(c);case"s":return Xn(m);case"ss":return Xn(c);case"S":return Xn(l);case"SSS":return Xn(p);case"u":return zx(v);case"uu":return zx(m);case"uuu":return Xn(o);case"a":return vo(i.meridiems(),0);case"kkkk":return Xn(a);case"kk":return Xn($,ql);case"W":return Xn(m);case"WW":return Xn(c);case"E":case"c":return Xn(o);case"EEE":return vo(i.weekdays("short",!1),1);case"EEEE":return vo(i.weekdays("long",!1),1);case"ccc":return vo(i.weekdays("short",!0),1);case"cccc":return vo(i.weekdays("long",!0),1);case"Z":case"ZZ":return D0(new RegExp(`([+-]${m.source})(?::(${c.source}))?`),2);case"ZZZ":return D0(new RegExp(`([+-]${m.source})(${c.source})?`),2);case"z":return zx(/[a-z_+-/]{1,256}?/i);case" ":return zx(/[^\S\n\r]/);default:return F(R)}})(n)||{invalidReason:L6};return A.token=n,A}var I6={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function k6(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let l=/^\s+$/.test(p);return{literal:!l,val:l?" ":p}}let a=i[c],x=c;if(c==="hour")if(i.hour12!=null)x=i.hour12?"hour12":"hour24";else if(i.hourCycle!=null)if(i.hourCycle==="h11"||i.hourCycle==="h12")x="hour12";else x="hour24";else x=o.hour12?"hour12":"hour24";let m=I6[x];if(typeof m==="object")m=m[a];if(m)return{literal:!1,val:m};return}function s6(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}\$`,n]}function Z6(n,i,o){let c=n.match(i);if(c){let p={},a=1;for(let x in o)if($p(o,x)){let m=o[x],l=m.groups?m.groups+1:1;if(!m.literal&&m.token)p[m.token.val[0]]=m.deser(c.slice(a,a+l));a+=l}return[c,p]}else return[c,{}]}function t6(n){let i=(a)=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},o=null,c;if(!pn(n.z))o=zo.create(n.z);if(!pn(n.Z)){if(!o)o=new Fi(n.Z);c=n.Z}if(!pn(n.q))n.M=(n.q-1)*3+1;if(!pn(n.h)){if(n.h<12&&n.a===1)n.h+=12;else if(n.h===12&&n.a===0)n.h=0}if(n.G===0&&n.y)n.y=-n.y;if(!pn(n.u))n.S=nf(n.u);return[Object.keys(n).reduce((a,x)=>{let m=i(x);if(m)a[m]=n[x];return a},{}),o,c]}var Ll=null;function q6(){if(!Ll)Ll=cn.fromMillis(1555555555555);return Ll}function P6(n,i){if(n.literal)return n;let o=Ai.macroTokenToFormatOpts(n.val),c=qT(o,i);if(c==null||c.includes(void 0))return n;return c}function ZT(n,i){return Array.prototype.concat(...n.map((o)=>P6(o,i)))}class xf{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=ZT(Ai.parseFormat(i),n),this.units=this.tokens.map((o)=>h6(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=s6(this.units);this.regex=RegExp(o,"i"),this.handlers=c}}explainFromTokens(n){if(!this.isValid)return{input:n,tokens:this.tokens,invalidReason:this.invalidReason};else{let[i,o]=Z6(n,this.regex,this.handlers),[c,p,a]=o?t6(o):[null,null,void 0];if($p(o,"a")&&$p(o,"H"))throw new zc("Can't include meridiem when specifying 24-hour format");return{input:n,tokens:this.tokens,regex:this.regex,rawMatches:i,matches:o,result:c,zone:p,specificOffset:a}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function tT(n,i,o){return new xf(n,o).explainFromTokens(i)}function r6(n,i,o){let{result:c,zone:p,specificOffset:a,invalidReason:x}=tT(n,i,o);return[c,p,a,x]}function qT(n,i){if(!n)return null;let c=Ai.create(i,n).dtFormatter(q6()),p=c.formatToParts(),a=c.resolvedOptions();return p.map((x)=>k6(x,n,a))}var Nl="Invalid DateTime",C0=8640000000000000;function Fa(n){return new Pi("unsupported zone",`the zone "${n.name}" is not supported`)}function Dl(n){if(n.weekData===null)n.weekData=_x(n.c);return n.weekData}function Cl(n){if(n.localWeekData===null)n.localWeekData=_x(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Yc(n,i){let o={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new cn({...o,...i,old:o})}function PT(n,i,o){let c=n-i*60*1000,p=o.offset(c);if(i===p)return[c,i];c-=(p-i)*60*1000;let a=o.offset(c);if(p===a)return[c,p];return[n-Math.min(p,a)*60*1000,Math.max(p,a)]}function Qx(n,i){n+=i*60*1000;let o=new Date(n);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}function Ox(n,i,o){return PT(Bx(n),i,o)}function h0(n,i){let o=n.o,c=n.c.year+Math.trunc(i.years),p=n.c.month+Math.trunc(i.months)+Math.trunc(i.quarters)*3,a={...n.c,year:c,month:p,day:Math.min(n.c.day,bx(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},x=Mn.fromObject({years:i.years-Math.trunc(i.years),quarters:i.quarters-Math.trunc(i.quarters),months:i.months-Math.trunc(i.months),weeks:i.weeks-Math.trunc(i.weeks),days:i.days-Math.trunc(i.days),hours:i.hours,minutes:i.minutes,seconds:i.seconds,milliseconds:i.milliseconds}).as("milliseconds"),m=Bx(a),[l,f]=PT(m,o,n.zone);if(x!==0)l+=x,f=n.zone.offset(l);return{ts:l,o:f}}function xp(n,i,o,c,p,a){let{setZone:x,zone:m}=o;if(n&&Object.keys(n).length!==0||i){let l=i||m,f=cn.fromObject(n,{...o,zone:l,specificOffset:a});return x?f:f.setZone(m)}else return cn.invalid(new Pi("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Hx(n,i,o=!0){return n.isValid?Ai.create(zn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function hl(n,i){let o=n.c.year>9999||n.c.year<0,c="";if(o&&n.c.year>=0)c+="+";if(c+=dn(n.c.year,o?6:4),i)c+="-",c+=dn(n.c.month),c+="-",c+=dn(n.c.day);else c+=dn(n.c.month),c+=dn(n.c.day);return c}function I0(n,i,o,c,p,a){let x=dn(n.c.hour);if(i){if(x+=":",x+=dn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)x+=":"}else x+=dn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(x+=dn(n.c.second),n.c.millisecond!==0||!c)x+=".",x+=dn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!a)x+="Z";else if(n.o<0)x+="-",x+=dn(Math.trunc(-n.o/60)),x+=":",x+=dn(Math.trunc(-n.o%60));else x+="+",x+=dn(Math.trunc(n.o/60)),x+=":",x+=dn(Math.trunc(n.o%60));if(a)x+="["+n.zone.ianaName+"]";return x}var rT={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},g6={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},d6={ordinal:1,hour:0,minute:0,second:0,millisecond:0},gT=["year","month","day","hour","minute","second","millisecond"],e6=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],nW=["year","ordinal","hour","minute","second","millisecond"];function iW(n){let i={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!i)throw new Pl(n);return i}function k0(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return iW(n)}}function oW(n){if(!Vx[n]){if(Ux===void 0)Ux=Nn.now();Vx[n]=n.offset(Ux)}return Vx[n]}function s0(n,i){let o=ic(i.zone,Nn.defaultZone);if(!o.isValid)return cn.invalid(Fa(o));let c=zn.fromObject(i),p,a;if(!pn(n.year)){for(let l of gT)if(pn(n[l]))n[l]=rT[l];let x=GT(n)||YT(n);if(x)return cn.invalid(x);let m=oW(o);[p,a]=Ox(n,m,o)}else p=Nn.now();return new cn({ts:p,zone:o,loc:c,o:a})}function Z0(n,i,o){let c=pn(o.round)?!0:o.round,p=(x,m)=>{return x=of(x,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(x,m)},a=(x)=>{if(o.calendary)if(!i.hasSame(n,x))return i.startOf(x).diff(n.startOf(x),x).get(x);else return 0;else return i.diff(n,x).get(x)};if(o.unit)return p(a(o.unit),o.unit);for(let x of o.units){let m=a(x);if(Math.abs(m)>=1)return p(m,x)}return p(n>i?-0:0,o.units[o.units.length-1])}function t0(n){let i={},o;if(n.length>0&&typeof n[n.length-1]==="object")i=n[n.length-1],o=Array.from(n).slice(0,n.length-1);else o=Array.from(n);return[i,o]}var Ux,Vx={};class cn{constructor(n){let i=n.zone||Nn.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new Pi("invalid input"):null)||(!i.isValid?Fa(i):null);this.ts=pn(n.ts)?Nn.now():n.ts;let c=null,p=null;if(!o)if(n.old&&n.old.ts===this.ts&&n.old.zone.equals(i))[c,p]=[n.old.c,n.old.o];else{let x=oc(n.o)&&!n.old?n.o:i.offset(this.ts);c=Qx(this.ts,x),o=Number.isNaN(c.year)?new Pi("invalid input"):null,c=o?null:c,p=o?null:x}this._zone=i,this.loc=n.loc||zn.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=c,this.o=p,this.isLuxonDateTime=!0}static now(){return new cn({})}static local(){let[n,i]=t0(arguments),[o,c,p,a,x,m,l]=i;return s0({year:o,month:c,day:p,hour:a,minute:x,second:m,millisecond:l},n)}static utc(){let[n,i]=t0(arguments),[o,c,p,a,x,m,l]=i;return n.zone=Fi.utcInstance,s0({year:o,month:c,day:p,hour:a,minute:x,second:m,millisecond:l},n)}static fromJSDate(n,i={}){let o=u8(n)?n.valueOf():NaN;if(Number.isNaN(o))return cn.invalid("invalid input");let c=ic(i.zone,Nn.defaultZone);if(!c.isValid)return cn.invalid(Fa(c));return new cn({ts:o,zone:c,loc:zn.fromObject(i)})}static fromMillis(n,i={}){if(!oc(n))throw new li(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-C0||n>C0)return cn.invalid("Timestamp out of range");else return new cn({ts:n,zone:ic(i.zone,Nn.defaultZone),loc:zn.fromObject(i)})}static fromSeconds(n,i={}){if(!oc(n))throw new li("fromSeconds requires a numerical input");else return new cn({ts:n*1000,zone:ic(i.zone,Nn.defaultZone),loc:zn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=ic(i.zone,Nn.defaultZone);if(!o.isValid)return cn.invalid(Fa(o));let c=zn.fromObject(i),p=jx(n,k0),{minDaysInFirstWeek:a,startOfWeek:x}=V0(p,c),m=Nn.now(),l=!pn(i.specificOffset)?i.specificOffset:o.offset(m),f=!pn(p.ordinal),v=!pn(p.year),$=!pn(p.month)||!pn(p.day),T=v||$,F=p.weekYear||p.weekNumber;if((T||f)&&F)throw new zc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if($&&f)throw new zc("Can't mix ordinal dates with month/day");let M=F||p.weekday&&!T,A,R,G=Qx(m,l);if(M)A=e6,R=g6,G=_x(G,a,x);else if(f)A=nW,R=d6,G=Bl(G);else A=gT,R=rT;let Q=!1;for(let V of A){let X=p[V];if(!pn(X))Q=!0;else if(Q)p[V]=R[V];else p[V]=G[V]}let b=M?O8(p,a,x):f?U8(p):GT(p),D=b||YT(p);if(D)return cn.invalid(D);let Y=M?O0(p,a,x):f?U0(p):p,[K,E]=Ox(Y,l,o),y=new cn({ts:K,zone:o,o:E,loc:c});if(p.weekday&&T&&n.weekday!==y.weekday)return cn.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${y.toISO()}`);if(!y.isValid)return cn.invalid(y.invalid);return y}static fromISO(n,i={}){let[o,c]=K6(n);return xp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=X6(n);return xp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=G6(n);return xp(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(pn(n)||pn(i))throw new li("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,a=zn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[x,m,l,f]=r6(a,n,i);if(f)return cn.invalid(f);else return xp(x,m,o,`format ${i}`,n,l)}static fromString(n,i,o={}){return cn.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=U6(n);return xp(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new li("need to specify a reason the DateTime is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Nn.throwOnInvalid)throw new q0(o);else return new cn({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=qT(n,zn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return ZT(Ai.parseFormat(n),zn.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){Ux=void 0,Vx={}}get(n){return this[n]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Dl(this).weekYear:NaN}get weekNumber(){return this.isValid?Dl(this).weekNumber:NaN}get weekday(){return this.isValid?Dl(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Cl(this).weekday:NaN}get localWeekNumber(){return this.isValid?Cl(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Cl(this).weekYear:NaN}get ordinal(){return this.isValid?Bl(this.c).ordinal:NaN}get monthShort(){return this.isValid?lp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?lp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?lp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?lp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"short",locale:this.locale});else return null}get offsetNameLong(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"long",locale:this.locale});else return null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){if(this.isOffsetFixed)return!1;else return this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let n=86400000,i=60000,o=Bx(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),a=this.zone.offset(o-c*i),x=this.zone.offset(o-p*i);if(a===x)return[this];let m=o-a*i,l=o-x*i,f=Qx(m,a),v=Qx(l,x);if(f.hour===v.hour&&f.minute===v.minute&&f.second===v.second&&f.millisecond===v.millisecond)return[Yc(this,{ts:m}),Yc(this,{ts:l})];return[this]}get isInLeapYear(){return Ka(this.year)}get daysInMonth(){return bx(this.year,this.month)}get daysInYear(){return this.isValid?fp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ra(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ra(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Ai.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Fi.instance(n),i)}toLocal(){return this.setZone(Nn.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=ic(n,Nn.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return cn.invalid(Fa(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),a=this.toObject();[c]=Ox(a,p,n)}return Yc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Yc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=jx(n,k0),{minDaysInFirstWeek:o,startOfWeek:c}=V0(i,this.loc),p=!pn(i.weekYear)||!pn(i.weekNumber)||!pn(i.weekday),a=!pn(i.ordinal),x=!pn(i.year),m=!pn(i.month)||!pn(i.day),l=x||m,f=i.weekYear||i.weekNumber;if((l||a)&&f)throw new zc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&a)throw new zc("Can't mix ordinal dates with month/day");let v;if(p)v=O0({..._x(this.c,o,c),...i},o,c);else if(!pn(i.ordinal))v=U0({...Bl(this.c),...i});else if(v={...this.toObject(),...i},pn(i.day))v.day=Math.min(bx(v.year,v.month),v.day);let[$,T]=Ox(v,this.o,this.zone);return Yc(this,{ts:$,o:T})}plus(n){if(!this.isValid)return this;let i=Mn.fromDurationLike(n);return Yc(this,h0(this,i))}minus(n){if(!this.isValid)return this;let i=Mn.fromDurationLike(n).negate();return Yc(this,h0(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=Mn.normalizeUnit(n);switch(c){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(c==="weeks")if(i){let p=this.loc.getStartOfWeek(),{weekday:a}=this;if(a<p)o.weekNumber=this.weekNumber-1;o.weekday=p}else o.weekday=1;if(c==="quarters"){let p=Math.ceil(this.month/3);o.month=(p-1)*3+1}return this.set(o)}endOf(n,i){return this.isValid?this.plus({[n]:1}).startOf(n,i).minus(1):this}toFormat(n,i={}){return this.isValid?Ai.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):Nl}toLocaleString(n=ux,i={}){return this.isValid?Ai.create(this.loc.clone(i),n).formatDateTime(this):Nl}toLocaleParts(n={}){return this.isValid?Ai.create(this.loc.clone(n),n).formatDateTimeParts(this):[]}toISO({format:n="extended",suppressSeconds:i=!1,suppressMilliseconds:o=!1,includeOffset:c=!0,extendedZone:p=!1}={}){if(!this.isValid)return null;let a=n==="extended",x=hl(this,a);return x+="T",x+=I0(this,a,i,o,c,p),x}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return hl(this,n==="extended")}toISOWeekDate(){return Hx(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:n=!1,suppressSeconds:i=!1,includeOffset:o=!0,includePrefix:c=!1,extendedZone:p=!1,format:a="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+I0(this,a==="extended",i,n,o,p)}toRFC2822(){return Hx(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hx(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){if(!this.isValid)return null;return hl(this,!0)}toSQLTime({includeOffset:n=!0,includeZone:i=!1,includeOffsetSpace:o=!0}={}){let c="HH:mm:ss.SSS";if(i||n){if(o)c+=" ";if(i)c+="z";else if(n)c+="ZZ"}return Hx(this,c,!0)}toSQL(n={}){if(!this.isValid)return null;return`${this.toSQLDate()} ${this.toSQLTime(n)}`}toString(){return this.isValid?this.toISO():Nl}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;else return`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1000:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1000):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(n={}){if(!this.isValid)return{};let i={...this.c};if(n.includeConfig)i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale;return i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(n,i="milliseconds",o={}){if(!this.isValid||!n.isValid)return Mn.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=_8(i).map(Mn.normalizeUnit),a=n.valueOf()>this.valueOf(),x=a?this:n,m=a?n:this,l=B6(x,m,p,c);return a?l.negate():l}diffNow(n="milliseconds",i={}){return this.diff(cn.now(),n,i)}until(n){return this.isValid?Cn.fromDateTimes(this,n):this}hasSame(n,i,o){if(!this.isValid)return!1;let c=n.valueOf(),p=this.setZone(n.zone,{keepLocalTime:!0});return p.startOf(i,o)<=c&&c<=p.endOf(i,o)}equals(n){return this.isValid&&n.isValid&&this.valueOf()===n.valueOf()&&this.zone.equals(n.zone)&&this.loc.equals(n.loc)}toRelative(n={}){if(!this.isValid)return null;let i=n.base||cn.fromObject({},{zone:this.zone}),o=n.padding?this<i?-n.padding:n.padding:0,c=["years","months","days","hours","minutes","seconds"],p=n.unit;if(Array.isArray(n.unit))c=n.unit,p=void 0;return Z0(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return Z0(n.base||cn.fromObject({},{zone:this.zone}),this,{...n,numeric:"auto",units:["years","months","days"],calendary:!0})}static min(...n){if(!n.every(cn.isDateTime))throw new li("min requires all arguments be DateTimes");return u0(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(cn.isDateTime))throw new li("max requires all arguments be DateTimes");return u0(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,a=zn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return tT(a,n,i)}static fromStringExplain(n,i,o={}){return cn.fromFormatExplain(n,i,o)}static buildFormatParser(n,i={}){let{locale:o=null,numberingSystem:c=null}=i,p=zn.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new xf(p,n)}static fromFormatParser(n,i,o={}){if(pn(n)||pn(i))throw new li("fromFormatParser requires an input string and a format parser");let{locale:c=null,numberingSystem:p=null}=o,a=zn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!a.equals(i.locale))throw new li(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${i.locale}`);let{result:x,zone:m,specificOffset:l,invalidReason:f}=i.explainFromTokens(n);if(f)return cn.invalid(f);else return xp(x,m,o,`format ${i.format}`,n,l)}static get DATE_SHORT(){return ux}static get DATE_MED(){return g0}static get DATE_MED_WITH_WEEKDAY(){return f8}static get DATE_FULL(){return d0}static get DATE_HUGE(){return e0}static get TIME_SIMPLE(){return nT}static get TIME_WITH_SECONDS(){return iT}static get TIME_WITH_SHORT_OFFSET(){return oT}static get TIME_WITH_LONG_OFFSET(){return cT}static get TIME_24_SIMPLE(){return pT}static get TIME_24_WITH_SECONDS(){return aT}static get TIME_24_WITH_SHORT_OFFSET(){return xT}static get TIME_24_WITH_LONG_OFFSET(){return mT}static get DATETIME_SHORT(){return lT}static get DATETIME_SHORT_WITH_SECONDS(){return fT}static get DATETIME_MED(){return vT}static get DATETIME_MED_WITH_SECONDS(){return $T}static get DATETIME_MED_WITH_WEEKDAY(){return v8}static get DATETIME_FULL(){return TT}static get DATETIME_FULL_WITH_SECONDS(){return wT}static get DATETIME_HUGE(){return JT}static get DATETIME_HUGE_WITH_SECONDS(){return ST}}function Sa(n){if(cn.isDateTime(n))return n;else if(n&&n.valueOf&&oc(n.valueOf()))return cn.fromJSDate(n);else if(n&&typeof n==="object")return cn.fromObject(n);else throw new li(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var cW="3.5.0";dT.DateTime=cn;dT.Duration=Mn;dT.FixedOffsetZone=Fi;dT.IANAZone=zo;dT.Info=lp;dT.Interval=Cn;dT.InvalidZone=rl;dT.Settings=Nn;dT.SystemZone=Wa;dT.VERSION=cW;dT.Zone=Hc});var p1=h((n1)=>{Object.defineProperty(n1,"__esModule",{value:!0});n1.RE_RANGE=n1.RE_WILDCARDS=n1.PRESETS=n1.TIME_UNITS_LEN=n1.TIME_UNITS=n1.TIME_UNITS_MAP=n1.ALIASES=n1.PARSE_DEFAULTS=n1.MONTH_CONSTRAINTS=n1.CONSTRAINTS=void 0;n1.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});n1.MONTH_CONSTRAINTS=Object.freeze({1:31,2:29,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31});n1.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});n1.ALIASES=Object.freeze({jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6});n1.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});n1.TIME_UNITS=Object.freeze(Object.values(n1.TIME_UNITS_MAP));n1.TIME_UNITS_LEN=n1.TIME_UNITS.length;n1.PRESETS=Object.freeze({"@yearly":"0 0 0 1 1 *","@monthly":"0 0 0 1 * *","@weekly":"0 0 0 * * 0","@daily":"0 0 0 * * *","@hourly":"0 0 * * * *","@minutely":"0 * * * * *","@secondly":"* * * * * *","@weekdays":"0 0 0 * * 1-5","@weekends":"0 0 0 * * 0,6"});n1.RE_WILDCARDS=/\*/g;n1.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var lf=h((x1)=>{Object.defineProperty(x1,"__esModule",{value:!0});x1.ExclusiveParametersError=x1.CronError=void 0;class mf extends Error{}x1.CronError=mf;class a1 extends mf{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}x1.ExclusiveParametersError=a1});var v1=h((l1)=>{Object.defineProperty(l1,"__esModule",{value:!0});l1.getRecordKeys=void 0;var GW=(n)=>{return Object.keys(n)};l1.getRecordKeys=GW});var Dx=h((w1)=>{Object.defineProperty(w1,"__esModule",{value:!0});w1.CronTime=void 0;var Qo=eT(),ai=p1(),Mi=lf(),$1=v1();class T1{constructor(n,i,o){if(this.realDate=!1,this.second={},this.minute={},this.hour={},this.dayOfMonth={},this.month={},this.dayOfWeek={},i!=null&&o!=null)throw new Mi.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!Qo.DateTime.fromObject({},{zone:i}).isValid)throw new Mi.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof Qo.DateTime)this.source=n instanceof Date?Qo.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source),this._verifyParse()}_getWeekDay(n){return n.weekday===7?0:n.weekday}_verifyParse(){let n=$1.getRecordKeys(this.month),i=$1.getRecordKeys(this.dayOfMonth),o=!1,c=null;for(let p of n){let a=ai.MONTH_CONSTRAINTS[p];for(let x of i)if(x<=a)o=!0;if(!o)c=p,console.warn(`Month '${p}' is limited to '${a}' days.`)}if(!o&&c!==null){let p=ai.MONTH_CONSTRAINTS[c];for(let a of i)if(a>p){delete this.dayOfMonth[a];let x=a%p;this.dayOfMonth[x]=!0}}}sendAt(n){let i=this.realDate&&this.source instanceof Qo.DateTime?this.source:Qo.DateTime.local();if(this.timeZone)i=i.setZone(this.timeZone);if(this.utcOffset!==void 0){let o=this.utcOffset<0?"-":"+",c=Math.trunc(this.utcOffset/60),p=String(Math.abs(c)).padStart(2,"0"),a=Math.abs(this.utcOffset-c*60),x=String(a).padStart(2,"0"),m=`UTC${o}${p}:${x}`;if(i=i.setZone(m),!i.isValid)throw new Mi.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(Qo.DateTime.local()>i)throw new Mi.CronError("WARNING: Date in past. Will never be fired.");return i}if(n===void 0||isNaN(n)||n<0)return this.getNextDateFrom(i);else{let o=[];for(;n>0;n--)i=this.getNextDateFrom(i),o.push(i);return o}}getTimeout(){return Math.max(-1,this.sendAt().toMillis()-Qo.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return ai.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=Qo.DateTime.fromJSDate(n);let c=n,p=n.toMillis();if(i)c=c.setZone(i);if(!this.realDate){if(c.millisecond>0)c=c.set({millisecond:0,second:c.second+1})}if(!c.isValid)throw new Mi.CronError("ERROR: You specified an invalid date.");let a=Qo.DateTime.now().plus({years:8});while(!0){let x=c.toMillis()-n.toMillis();if(c>a)throw new Mi.CronError(`Something went wrong. No execution date was found in the next 8 years.
4
4
  Please provide the following string if you would like to help debug:
5
- Time Zone: ${(o=i===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:'""'} - Cron String: ${this.source.toString()} - UTC offset: ${c.offset} - current Date: ${Yo.DateTime.local().toString()}`);if(!(c.month in this.month)&&Object.keys(this.month).length!==12){if(c=c.plus({months:1}),c=c.set({day:1,hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[x,l]=this._findPreviousDSTJump(c);if(c=l,x)break}continue}if(!(c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!((this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[x,l]=this._findPreviousDSTJump(c);if(c=l,x)break}continue}if(!(this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!((c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[x,l]=this._findPreviousDSTJump(c);if(c=l,x)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let x=c.hour===23&&m>86400000?0:c.hour+1,l=c.minute;if(c=c.set({hour:x}),c=c.set({minute:0,second:0}),this._forwardDSTJump(x,l,c)){let[f,$]=this._findPreviousDSTJump(c);if(c=$,f)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let x=c.minute===59&&m>3600000?0:c.minute+1,l=c.hour+(x===60?1:0);if(c=c.set({minute:x}),c=c.set({second:0}),this._forwardDSTJump(l,x,c)){let[f,$]=this._findPreviousDSTJump(c);if(c=$,f)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let x=c.second===59&&m>60000?0:c.second+1,l=c.minute+(x===60?1:0),f=c.hour+(l===60?1:0);if(c=c.set({second:x}),this._forwardDSTJump(f,l,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}if(c.toMillis()===p){let x=c.second+1,l=c.minute+(x===60?1:0),f=c.hour+(l===60?1:0);if(c=c.set({second:x}),this._forwardDSTJump(f,l,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}break}return c}_findPreviousDSTJump(n){var i;let o,c,p,a,m=n,x=1440,l=0;do{if(++l>x)throw new Ji.CronError(`ERROR: This DST checking related function assumes the input DateTime (${(i=n.toISO())!==null&&i!==void 0?i:n.toMillis()}) is within 24 hours of a DST jump.`);if(o=m.minute-1,c=m.hour,o<0)o+=60,c=(c+24-1)%24;m=m.minus({minute:1}),p=m.minute,a=m.hour}while(o===p&&c===a);let f=m.plus({minute:1}).set({second:0,millisecond:0}),$=f.minus({second:1});if(n.month+1 in this.month&&n.day in this.dayOfMonth&&this._getWeekDay(n)in this.dayOfWeek)return[this._checkTimeInSkippedRange($,f),f];return[!1,f]}_checkTimeInSkippedRange(n,i){let o=(n.minute+1)%60,c=(n.hour+(o===0?1:0))%24,p=i.hour-c+1,a=o===0&&i.minute===0;if(p===2&&a)return c in this.hour;else if(p===1)return c in this.hour&&this._checkTimeInSkippedRangeSingleHour(o,i.minute);else return this._checkTimeInSkippedRangeMultiHour(c,o,i.hour,i.minute)}_checkTimeInSkippedRangeSingleHour(n,i){for(let o=n;o<i;++o)if(o in this.minute)return!0;return i in this.minute&&0 in this.second}_checkTimeInSkippedRangeMultiHour(n,i,o,c){if(n>=o)throw new Ji.CronError(`ERROR: This DST checking related function assumes the forward jump starting hour (${n}) is less than the end hour (${o})`);let p=Array.from({length:60-i},(l,f)=>i+f),a=Array.from({length:c},(l,f)=>f),m=Array.from({length:60},(l,f)=>f),x=(l)=>{if(l===n)return p;else if(l===o)return a;else return m};for(let l=n;l<=o;++l){if(!(l in this.hour))continue;let f=x(l);for(let $ of f)if($ in this.minute)return!0}return o in this.hour&&c in this.minute&&0 in this.second}_forwardDSTJump(n,i,o){let{hour:c,minute:p}=o,a=n%24<c,m=i%60<p;return a||m}_wcOrAll(n){if(this._hasAll(n))return"*";let i=[];for(let o in this[n])i.push(o);return i.join(",")}_hasAll(n){let i=ai.CONSTRAINTS[n],o=i[0],c=n===ai.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,a=c;p<a;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(ai.PRESETS).includes(n))n=ai.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(ai.ALIASES).includes(p))return ai.ALIASES[p].toString();throw new Ji.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<ai.TIME_UNITS_LEN-1)throw new Ji.CronError("Too few fields");if(o.length>ai.TIME_UNITS_LEN)throw new Ji.CronError("Too many fields");let c=o.length;for(let p of ai.TIME_UNITS){let a=ai.TIME_UNITS.indexOf(p),m=(i=o[a-(ai.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:ai.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=ai.CONSTRAINTS[i],a=p[0],m=p[1];n.split(",").forEach((f)=>{let $=f.indexOf("*");if($!==-1&&$!==0)throw new Ji.CronError(`Field (${f}) has an invalid wildcard expression`)}),n=n.replace(ai.RE_WILDCARDS,`${a}-${m}`);let l=n.split(",");for(let f of l){let $=[...f.matchAll(ai.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,v,w,F]=$,M=parseInt(v,10),J=w!==void 0?parseInt(w,10):void 0,X=F!==void 0,G=parseInt(F!==null&&F!==void 0?F:"1",10);if(G===0)throw new Ji.CronError(`Field (${i}) has a step of zero`);if(J!==void 0&&M>J)throw new Ji.CronError(`Field (${i}) has an invalid range`);if(M<a||J!==void 0&&J>m||J===void 0&&M>m)throw new Ji.CronError(`Field value (${n}) is out of range`);if(M=Math.min(Math.max(a,~~Math.abs(M)),m),J!==void 0)J=Math.min(m,~~Math.abs(J));else J=X?m:M;c=M;do o[c]=!0,c+=G;while(c<=J);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new Ji.CronError(`Field (${i}) cannot be parsed`)}}}pw.CronTime=cw});var fw=h((xw)=>{Object.defineProperty(xw,"__esModule",{value:!0});xw.CronJob=void 0;var mw=import.meta.require("child_process"),pf=cf(),jm=ym();class Wa{constructor(n,i,o,c,p,a,m,x,l){if(this.running=!1,this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this._callbacks=[],this.context=a!==null&&a!==void 0?a:this,p!=null&&x!=null)throw new pf.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new jm.CronTime(n,p,null);else if(x!=null)this.cronTime=new jm.CronTime(n,null,x);else this.cronTime=new jm.CronTime(n,p,x);if(l!=null)this.unrefTimeout=l;if(o!=null)this.onComplete=this._fnWrap(o);if(this.cronTime.realDate)this.runOnce=!0;if(this.addCallback(this._fnWrap(i)),m)this.lastExecution=new Date,this.fireOnTick();if(c)this.start()}static from(n){if(n.timeZone!=null&&n.utcOffset!=null)throw new pf.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Wa(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout);else if(n.utcOffset!=null)return new Wa(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout);else return new Wa(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout)}_fnWrap(n){var i,o;switch(typeof n){case"function":return n;case"string":{let[c,...p]=n.split(" ");return mw.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return mw.spawn.bind(void 0,n.command,(i=n.args)!==null&&i!==void 0?i:[],(o=n.options)!==null&&o!==void 0?o:{})}}addCallback(n){if(typeof n==="function")this._callbacks.push(n)}setTime(n){if(!(n instanceof jm.CronTime))throw new pf.CronError("time must be an instance of CronTime.");let i=this.running;if(this.stop(),this.cronTime=n,n.realDate)this.runOnce=!0;if(i)this.start()}nextDate(){return this.cronTime.sendAt()}fireOnTick(){for(let n of this._callbacks)n.call(this.context,this.onComplete)}nextDates(n){return this.cronTime.sendAt(n!==null&&n!==void 0?n:0)}start(){if(this.running)return;let n=2147483647,i=this.cronTime.getTimeout(),o=0,c,p=(m)=>{if(c=Date.now(),this._timeout=setTimeout(a,m),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},a=()=>{let m=c+i-Date.now();if(m>0){let x=this.cronTime.getTimeout();if(x>m)x=m;o+=x}if(o){if(o>n)o-=n,i=n;else i=o,o=0;p(i)}else{if(this.lastExecution=new Date,this.running=!1,!this.runOnce)this.start();this.fireOnTick()}};if(i>=0){if(this.running=!0,i>n)o=i-n,i=n;p(i)}else this.stop()}lastDate(){return this.lastExecution}stop(){if(this._timeout)clearTimeout(this._timeout);if(this.running=!1,typeof this.onComplete==="function")this.onComplete.call(this.context)}}xw.CronJob=Wa});var af=h((Bm)=>{Object.defineProperty(Bm,"__esModule",{value:!0});Bm.timeout=Bm.sendAt=Bm.CronTime=Bm.CronJob=void 0;var $w=ym(),T6=fw();Object.defineProperty(Bm,"CronJob",{enumerable:!0,get:function(){return T6.CronJob}});var w6=ym();Object.defineProperty(Bm,"CronTime",{enumerable:!0,get:function(){return w6.CronTime}});var S6=(n)=>new $w.CronTime(n).sendAt();Bm.sendAt=S6;var A6=(n)=>new $w.CronTime(n).getTimeout();Bm.timeout=A6});var oA=h((fj,Yf)=>{Yf.exports=iA;Yf.exports.preferredCharsets=iA;var z6=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function u6(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=Y6(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function Y6(n,i){var o=z6.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var a=o[2].split(";");for(var m=0;m<a.length;m++){var x=a[m].trim().split("=");if(x[0]==="q"){p=parseFloat(x[1]);break}}}return{charset:c,q:p,i}}function O6(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=H6(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function H6(n,i,o){var c=0;if(i.charset.toLowerCase()===n.toLowerCase())c|=1;else if(i.charset!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function iA(n,i){var o=u6(n===void 0?"*":n||"");if(!i)return o.filter(nA).sort(d1).map(E6);var c=i.map(function p(a,m){return O6(a,o,m)});return c.filter(nA).sort(d1).map(function p(a){return i[c.indexOf(a)]})}function d1(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function E6(n){return n.charset}function nA(n){return n.q>0}});var xA=h(($j,Of)=>{Of.exports=mA;Of.exports.preferredEncodings=mA;var Q6=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function s6(n){var i=n.split(","),o=!1,c=1;for(var p=0,a=0;p<i.length;p++){var m=U6(i[p].trim(),p);if(m)i[a++]=m,o=o||aA("identity",m),c=Math.min(c,m.q||1)}if(!o)i[a++]={encoding:"identity",q:c,i:p};return i.length=a,i}function U6(n,i){var o=Q6.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var a=o[2].split(";");for(var m=0;m<a.length;m++){var x=a[m].trim().split("=");if(x[0]==="q"){p=parseFloat(x[1]);break}}}return{encoding:c,q:p,i}}function b6(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=aA(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function aA(n,i,o){var c=0;if(i.encoding.toLowerCase()===n.toLowerCase())c|=1;else if(i.encoding!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function mA(n,i){var o=s6(n||"");if(!i)return o.filter(pA).sort(cA).map(V6);var c=i.map(function p(a,m){return b6(a,o,m)});return c.filter(pA).sort(cA).map(function p(a){return i[c.indexOf(a)]})}function cA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function V6(n){return n.encoding}function pA(n){return n.q>0}});var TA=h((vj,Hf)=>{Hf.exports=vA;Hf.exports.preferredLanguages=vA;var _6=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function y6(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=$A(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function $A(n,i){var o=_6.exec(n);if(!o)return null;var c=o[1],p=o[2],a=c;if(p)a+="-"+p;var m=1;if(o[3]){var x=o[3].split(";");for(var l=0;l<x.length;l++){var f=x[l].split("=");if(f[0]==="q")m=parseFloat(f[1])}}return{prefix:c,suffix:p,q:m,i,full:a}}function j6(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=B6(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function B6(n,i,o){var c=$A(n);if(!c)return null;var p=0;if(i.full.toLowerCase()===c.full.toLowerCase())p|=4;else if(i.prefix.toLowerCase()===c.full.toLowerCase())p|=2;else if(i.full.toLowerCase()===c.prefix.toLowerCase())p|=1;else if(i.full!=="*")return null;return{i:o,o:i.i,q:i.q,s:p}}function vA(n,i){var o=y6(n===void 0?"*":n||"");if(!i)return o.filter(fA).sort(lA).map(N6);var c=i.map(function p(a,m){return j6(a,o,m)});return c.filter(fA).sort(lA).map(function p(a){return i[c.indexOf(a)]})}function lA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function N6(n){return n.full}function fA(n){return n.q>0}});var RA=h((Tj,Ef)=>{Ef.exports=JA;Ef.exports.preferredMediaTypes=JA;var L6=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function t6(n){var i=k6(n);for(var o=0,c=0;o<i.length;o++){var p=AA(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function AA(n,i){var o=L6.exec(n);if(!o)return null;var c=Object.create(null),p=1,a=o[2],m=o[1];if(o[3]){var x=r6(o[3]).map(C6);for(var l=0;l<x.length;l++){var f=x[l],$=f[0].toLowerCase(),v=f[1],w=v&&v[0]==='"'&&v[v.length-1]==='"'?v.substr(1,v.length-2):v;if($==="q"){p=parseFloat(w);break}c[$]=w}}return{type:m,subtype:a,params:c,q:p,i}}function D6(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=h6(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function h6(n,i,o){var c=AA(n),p=0;if(!c)return null;if(i.type.toLowerCase()==c.type.toLowerCase())p|=4;else if(i.type!="*")return null;if(i.subtype.toLowerCase()==c.subtype.toLowerCase())p|=2;else if(i.subtype!="*")return null;var a=Object.keys(i.params);if(a.length>0)if(a.every(function(m){return i.params[m]=="*"||(i.params[m]||"").toLowerCase()==(c.params[m]||"").toLowerCase()}))p|=1;else return null;return{i:o,o:i.i,q:i.q,s:p}}function JA(n,i){var o=t6(n===void 0?"*/*":n||"");if(!i)return o.filter(SA).sort(wA).map(I6);var c=i.map(function p(a,m){return D6(a,o,m)});return c.filter(SA).sort(wA).map(function p(a){return i[c.indexOf(a)]})}function wA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function I6(n){return n.type+"/"+n.subtype}function SA(n){return n.q>0}function FA(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function C6(n){var i=n.indexOf("="),o,c;if(i===-1)o=n;else o=n.substr(0,i),c=n.substr(i+1);return[o,c]}function k6(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(FA(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function r6(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(FA(i[c])%2==0)i[++c]=i[o];else i[c]+=";"+i[o];i.length=c+1;for(var o=0;o<i.length;o++)i[o]=i[o].trim();return i}});var MA=h((wj,Qf)=>{/*!
5
+ Time Zone: ${(o=i===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:'""'} - Cron String: ${this.source.toString()} - UTC offset: ${c.offset} - current Date: ${Qo.DateTime.local().toString()}`);if(!(c.month in this.month)&&Object.keys(this.month).length!==12){if(c=c.plus({months:1}),c=c.set({day:1,hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[m,l]=this._findPreviousDSTJump(c);if(c=l,m)break}continue}if(!(c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!((this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[m,l]=this._findPreviousDSTJump(c);if(c=l,m)break}continue}if(!(this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!((c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[m,l]=this._findPreviousDSTJump(c);if(c=l,m)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let m=c.hour===23&&x>86400000?0:c.hour+1,l=c.minute;if(c=c.set({hour:m}),c=c.set({minute:0,second:0}),this._forwardDSTJump(m,l,c)){let[f,v]=this._findPreviousDSTJump(c);if(c=v,f)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let m=c.minute===59&&x>3600000?0:c.minute+1,l=c.hour+(m===60?1:0);if(c=c.set({minute:m}),c=c.set({second:0}),this._forwardDSTJump(l,m,c)){let[f,v]=this._findPreviousDSTJump(c);if(c=v,f)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let m=c.second===59&&x>60000?0:c.second+1,l=c.minute+(m===60?1:0),f=c.hour+(l===60?1:0);if(c=c.set({second:m}),this._forwardDSTJump(f,l,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}if(c.toMillis()===p){let m=c.second+1,l=c.minute+(m===60?1:0),f=c.hour+(l===60?1:0);if(c=c.set({second:m}),this._forwardDSTJump(f,l,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}break}return c}_findPreviousDSTJump(n){var i;let o,c,p,a,x=n,m=1440,l=0;do{if(++l>m)throw new Mi.CronError(`ERROR: This DST checking related function assumes the input DateTime (${(i=n.toISO())!==null&&i!==void 0?i:n.toMillis()}) is within 24 hours of a DST jump.`);if(o=x.minute-1,c=x.hour,o<0)o+=60,c=(c+24-1)%24;x=x.minus({minute:1}),p=x.minute,a=x.hour}while(o===p&&c===a);let f=x.plus({minute:1}).set({second:0,millisecond:0}),v=f.minus({second:1});if(n.month+1 in this.month&&n.day in this.dayOfMonth&&this._getWeekDay(n)in this.dayOfWeek)return[this._checkTimeInSkippedRange(v,f),f];return[!1,f]}_checkTimeInSkippedRange(n,i){let o=(n.minute+1)%60,c=(n.hour+(o===0?1:0))%24,p=i.hour-c+1,a=o===0&&i.minute===0;if(p===2&&a)return c in this.hour;else if(p===1)return c in this.hour&&this._checkTimeInSkippedRangeSingleHour(o,i.minute);else return this._checkTimeInSkippedRangeMultiHour(c,o,i.hour,i.minute)}_checkTimeInSkippedRangeSingleHour(n,i){for(let o=n;o<i;++o)if(o in this.minute)return!0;return i in this.minute&&0 in this.second}_checkTimeInSkippedRangeMultiHour(n,i,o,c){if(n>=o)throw new Mi.CronError(`ERROR: This DST checking related function assumes the forward jump starting hour (${n}) is less than the end hour (${o})`);let p=Array.from({length:60-i},(l,f)=>i+f),a=Array.from({length:c},(l,f)=>f),x=Array.from({length:60},(l,f)=>f),m=(l)=>{if(l===n)return p;else if(l===o)return a;else return x};for(let l=n;l<=o;++l){if(!(l in this.hour))continue;let f=m(l);for(let v of f)if(v in this.minute)return!0}return o in this.hour&&c in this.minute&&0 in this.second}_forwardDSTJump(n,i,o){let{hour:c,minute:p}=o,a=n%24<c,x=i%60<p;return a||x}_wcOrAll(n){if(this._hasAll(n))return"*";let i=[];for(let o in this[n])i.push(o);return i.join(",")}_hasAll(n){let i=ai.CONSTRAINTS[n],o=i[0],c=n===ai.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,a=c;p<a;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(ai.PRESETS).includes(n))n=ai.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(ai.ALIASES).includes(p))return ai.ALIASES[p].toString();throw new Mi.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<ai.TIME_UNITS_LEN-1)throw new Mi.CronError("Too few fields");if(o.length>ai.TIME_UNITS_LEN)throw new Mi.CronError("Too many fields");let c=o.length;for(let p of ai.TIME_UNITS){let a=ai.TIME_UNITS.indexOf(p),x=(i=o[a-(ai.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:ai.PARSE_DEFAULTS[p];this._parseField(x,p)}}_parseField(n,i){let o=this[i],c,p=ai.CONSTRAINTS[i],a=p[0],x=p[1];n.split(",").forEach((f)=>{let v=f.indexOf("*");if(v!==-1&&v!==0)throw new Mi.CronError(`Field (${f}) has an invalid wildcard expression`)}),n=n.replace(ai.RE_WILDCARDS,`${a}-${x}`);let l=n.split(",");for(let f of l){let v=[...f.matchAll(ai.RE_RANGE)][0];if((v===null||v===void 0?void 0:v[1])!==void 0){let[,$,T,F]=v,M=parseInt($,10),A=T!==void 0?parseInt(T,10):void 0,R=F!==void 0,G=parseInt(F!==null&&F!==void 0?F:"1",10);if(G===0)throw new Mi.CronError(`Field (${i}) has a step of zero`);if(A!==void 0&&M>A)throw new Mi.CronError(`Field (${i}) has an invalid range`);if(M<a||A!==void 0&&A>x||A===void 0&&M>x)throw new Mi.CronError(`Field value (${n}) is out of range`);if(M=Math.min(Math.max(a,~~Math.abs(M)),x),A!==void 0)A=Math.min(x,~~Math.abs(A));else A=R?x:M;c=M;do o[c]=!0,c+=G;while(c<=A);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new Mi.CronError(`Field (${i}) cannot be parsed`)}}}w1.CronTime=T1});var M1=h((A1)=>{Object.defineProperty(A1,"__esModule",{value:!0});A1.CronJob=void 0;var S1=import.meta.require("child_process"),ff=lf(),Cx=Dx();class Ya{constructor(n,i,o,c,p,a,x,m,l){if(this.running=!1,this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this._callbacks=[],this.context=a!==null&&a!==void 0?a:this,p!=null&&m!=null)throw new ff.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new Cx.CronTime(n,p,null);else if(m!=null)this.cronTime=new Cx.CronTime(n,null,m);else this.cronTime=new Cx.CronTime(n,p,m);if(l!=null)this.unrefTimeout=l;if(o!=null)this.onComplete=this._fnWrap(o);if(this.cronTime.realDate)this.runOnce=!0;if(this.addCallback(this._fnWrap(i)),x)this.lastExecution=new Date,this.fireOnTick();if(c)this.start()}static from(n){if(n.timeZone!=null&&n.utcOffset!=null)throw new ff.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Ya(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout);else if(n.utcOffset!=null)return new Ya(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout);else return new Ya(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout)}_fnWrap(n){var i,o;switch(typeof n){case"function":return n;case"string":{let[c,...p]=n.split(" ");return S1.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return S1.spawn.bind(void 0,n.command,(i=n.args)!==null&&i!==void 0?i:[],(o=n.options)!==null&&o!==void 0?o:{})}}addCallback(n){if(typeof n==="function")this._callbacks.push(n)}setTime(n){if(!(n instanceof Cx.CronTime))throw new ff.CronError("time must be an instance of CronTime.");let i=this.running;if(this.stop(),this.cronTime=n,n.realDate)this.runOnce=!0;if(i)this.start()}nextDate(){return this.cronTime.sendAt()}fireOnTick(){for(let n of this._callbacks)n.call(this.context,this.onComplete)}nextDates(n){return this.cronTime.sendAt(n!==null&&n!==void 0?n:0)}start(){if(this.running)return;let n=2147483647,i=this.cronTime.getTimeout(),o=0,c,p=(x)=>{if(c=Date.now(),this._timeout=setTimeout(a,x),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},a=()=>{let x=c+i-Date.now();if(x>0){let m=this.cronTime.getTimeout();if(m>x)m=x;o+=m}if(o){if(o>n)o-=n,i=n;else i=o,o=0;p(i)}else{if(this.lastExecution=new Date,this.running=!1,!this.runOnce)this.start();this.fireOnTick()}};if(i>=0){if(this.running=!0,i>n)o=i-n,i=n;p(i)}else this.stop()}lastDate(){return this.lastExecution}stop(){if(this._timeout)clearTimeout(this._timeout);if(this.running=!1,typeof this.onComplete==="function")this.onComplete.call(this.context)}}A1.CronJob=Ya});var vf=h((hx)=>{Object.defineProperty(hx,"__esModule",{value:!0});hx.timeout=hx.sendAt=hx.CronTime=hx.CronJob=void 0;var R1=Dx(),YW=M1();Object.defineProperty(hx,"CronJob",{enumerable:!0,get:function(){return YW.CronJob}});var zW=Dx();Object.defineProperty(hx,"CronTime",{enumerable:!0,get:function(){return zW.CronTime}});var QW=(n)=>new R1.CronTime(n).sendAt();hx.sendAt=QW;var HW=(n)=>new R1.CronTime(n).getTimeout();hx.timeout=HW});var TS=h((DB,Vf)=>{Vf.exports=$S;Vf.exports.preferredCharsets=$S;var yW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function BW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=LW(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function LW(n,i){var o=yW.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var a=o[2].split(";");for(var x=0;x<a.length;x++){var m=a[x].trim().split("=");if(m[0]==="q"){p=parseFloat(m[1]);break}}}return{charset:c,q:p,i}}function NW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=DW(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function DW(n,i,o){var c=0;if(i.charset.toLowerCase()===n.toLowerCase())c|=1;else if(i.charset!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function $S(n,i){var o=BW(n===void 0?"*":n||"");if(!i)return o.filter(vS).sort(fS).map(CW);var c=i.map(function p(a,x){return NW(a,o,x)});return c.filter(vS).sort(fS).map(function p(a){return i[c.indexOf(a)]})}function fS(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function CW(n){return n.charset}function vS(n){return n.q>0}});var FS=h((CB,uf)=>{uf.exports=AS;uf.exports.preferredEncodings=AS;var hW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function IW(n){var i=n.split(","),o=!1,c=1;for(var p=0,a=0;p<i.length;p++){var x=kW(i[p].trim(),p);if(x)i[a++]=x,o=o||SS("identity",x),c=Math.min(c,x.q||1)}if(!o)i[a++]={encoding:"identity",q:c,i:p};return i.length=a,i}function kW(n,i){var o=hW.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var a=o[2].split(";");for(var x=0;x<a.length;x++){var m=a[x].trim().split("=");if(m[0]==="q"){p=parseFloat(m[1]);break}}}return{encoding:c,q:p,i}}function sW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=SS(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function SS(n,i,o){var c=0;if(i.encoding.toLowerCase()===n.toLowerCase())c|=1;else if(i.encoding!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function AS(n,i){var o=IW(n||"");if(!i)return o.filter(JS).sort(wS).map(ZW);var c=i.map(function p(a,x){return sW(a,o,x)});return c.filter(JS).sort(wS).map(function p(a){return i[c.indexOf(a)]})}function wS(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function ZW(n){return n.encoding}function JS(n){return n.q>0}});var XS=h((hB,_f)=>{_f.exports=KS;_f.exports.preferredLanguages=KS;var tW=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function qW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=WS(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function WS(n,i){var o=tW.exec(n);if(!o)return null;var c=o[1],p=o[2],a=c;if(p)a+="-"+p;var x=1;if(o[3]){var m=o[3].split(";");for(var l=0;l<m.length;l++){var f=m[l].split("=");if(f[0]==="q")x=parseFloat(f[1])}}return{prefix:c,suffix:p,q:x,i,full:a}}function PW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=rW(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function rW(n,i,o){var c=WS(n);if(!c)return null;var p=0;if(i.full.toLowerCase()===c.full.toLowerCase())p|=4;else if(i.prefix.toLowerCase()===c.full.toLowerCase())p|=2;else if(i.full.toLowerCase()===c.prefix.toLowerCase())p|=1;else if(i.full!=="*")return null;return{i:o,o:i.i,q:i.q,s:p}}function KS(n,i){var o=qW(n===void 0?"*":n||"");if(!i)return o.filter(RS).sort(MS).map(gW);var c=i.map(function p(a,x){return PW(a,o,x)});return c.filter(RS).sort(MS).map(function p(a){return i[c.indexOf(a)]})}function MS(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function gW(n){return n.full}function RS(n){return n.q>0}});var ES=h((IB,bf)=>{bf.exports=QS;bf.exports.preferredMediaTypes=QS;var dW=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function eW(n){var i=p7(n);for(var o=0,c=0;o<i.length;o++){var p=zS(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function zS(n,i){var o=dW.exec(n);if(!o)return null;var c=Object.create(null),p=1,a=o[2],x=o[1];if(o[3]){var m=a7(o[3]).map(c7);for(var l=0;l<m.length;l++){var f=m[l],v=f[0].toLowerCase(),$=f[1],T=$&&$[0]==='"'&&$[$.length-1]==='"'?$.substr(1,$.length-2):$;if(v==="q"){p=parseFloat(T);break}c[v]=T}}return{type:x,subtype:a,params:c,q:p,i}}function n7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var a=i7(n,i[p],o);if(a&&(c.s-a.s||c.q-a.q||c.o-a.o)<0)c=a}return c}function i7(n,i,o){var c=zS(n),p=0;if(!c)return null;if(i.type.toLowerCase()==c.type.toLowerCase())p|=4;else if(i.type!="*")return null;if(i.subtype.toLowerCase()==c.subtype.toLowerCase())p|=2;else if(i.subtype!="*")return null;var a=Object.keys(i.params);if(a.length>0)if(a.every(function(x){return i.params[x]=="*"||(i.params[x]||"").toLowerCase()==(c.params[x]||"").toLowerCase()}))p|=1;else return null;return{i:o,o:i.i,q:i.q,s:p}}function QS(n,i){var o=eW(n===void 0?"*/*":n||"");if(!i)return o.filter(YS).sort(GS).map(o7);var c=i.map(function p(a,x){return n7(a,o,x)});return c.filter(YS).sort(GS).map(function p(a){return i[c.indexOf(a)]})}function GS(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function o7(n){return n.type+"/"+n.subtype}function YS(n){return n.q>0}function HS(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function c7(n){var i=n.indexOf("="),o,c;if(i===-1)o=n;else o=n.substr(0,i),c=n.substr(i+1);return[o,c]}function p7(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(HS(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function a7(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(HS(i[c])%2==0)i[++c]=i[o];else i[c]+=";"+i[o];i.length=c+1;for(var o=0;o<i.length;o++)i[o]=i[o].trim();return i}});var OS=h((kB,jf)=>{/*!
6
6
  * negotiator
7
7
  * Copyright(c) 2012 Federico Romero
8
8
  * Copyright(c) 2012-2014 Isaac Z. Schlueter
9
9
  * Copyright(c) 2015 Douglas Christopher Wilson
10
10
  * MIT Licensed
11
- */var Z6=oA(),q6=xA(),e6=TA(),P6=RA();Qf.exports=On;Qf.exports.Negotiator=On;function On(n){if(!(this instanceof On))return new On(n);this.request=n}On.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};On.prototype.charsets=function n(i){return Z6(this.request.headers["accept-charset"],i)};On.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};On.prototype.encodings=function n(i){return q6(this.request.headers["accept-encoding"],i)};On.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};On.prototype.languages=function n(i){return e6(this.request.headers["accept-language"],i)};On.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};On.prototype.mediaTypes=function n(i){return P6(this.request.headers.accept,i)};On.prototype.preferredCharset=On.prototype.charset;On.prototype.preferredCharsets=On.prototype.charsets;On.prototype.preferredEncoding=On.prototype.encoding;On.prototype.preferredEncodings=On.prototype.encodings;On.prototype.preferredLanguage=On.prototype.language;On.prototype.preferredLanguages=On.prototype.languages;On.prototype.preferredMediaType=On.prototype.mediaType;On.prototype.preferredMediaTypes=On.prototype.mediaTypes});var KA=h((Sj,g6)=>{g6.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var XA=h((Aj,WA)=>{/*!
11
+ */var x7=TS(),m7=FS(),l7=XS(),f7=ES();jf.exports=Hn;jf.exports.Negotiator=Hn;function Hn(n){if(!(this instanceof Hn))return new Hn(n);this.request=n}Hn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};Hn.prototype.charsets=function n(i){return x7(this.request.headers["accept-charset"],i)};Hn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};Hn.prototype.encodings=function n(i){return m7(this.request.headers["accept-encoding"],i)};Hn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};Hn.prototype.languages=function n(i){return l7(this.request.headers["accept-language"],i)};Hn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};Hn.prototype.mediaTypes=function n(i){return f7(this.request.headers.accept,i)};Hn.prototype.preferredCharset=Hn.prototype.charset;Hn.prototype.preferredCharsets=Hn.prototype.charsets;Hn.prototype.preferredEncoding=Hn.prototype.encoding;Hn.prototype.preferredEncodings=Hn.prototype.encodings;Hn.prototype.preferredLanguage=Hn.prototype.language;Hn.prototype.preferredLanguages=Hn.prototype.languages;Hn.prototype.preferredMediaType=Hn.prototype.mediaType;Hn.prototype.preferredMediaTypes=Hn.prototype.mediaTypes});var US=h((sB,v7)=>{v7.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var uS=h((ZB,VS)=>{/*!
12
12
  * mime-db
13
13
  * Copyright(c) 2014 Jonathan Ong
14
14
  * Copyright(c) 2015-2022 Douglas Christopher Wilson
15
15
  * MIT Licensed
16
- */WA.exports=KA()});var OA=h((aW)=>{/*!
16
+ */VS.exports=US()});var BS=h((F7)=>{/*!
17
17
  * mime-types
18
18
  * Copyright(c) 2014 Jonathan Ong
19
19
  * Copyright(c) 2015 Douglas Christopher Wilson
20
20
  * MIT Licensed
21
- */var px=XA(),d6=import.meta.require("path").extname,GA=/^\s*([^;\s]*)(?:;|\s|$)/,nW=/^text\//i;aW.charset=zA;aW.charsets={lookup:zA};aW.contentType=iW;aW.extension=oW;aW.extensions=Object.create(null);aW.lookup=cW;aW.types=Object.create(null);pW(aW.extensions,aW.types);function zA(n){if(!n||typeof n!=="string")return!1;var i=GA.exec(n),o=i&&px[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&nW.test(i[1]))return"UTF-8";return!1}function iW(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?aW.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=aW.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function oW(n){if(!n||typeof n!=="string")return!1;var i=GA.exec(n),o=i&&aW.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function cW(n){if(!n||typeof n!=="string")return!1;var i=d6("x."+n).toLowerCase().substr(1);if(!i)return!1;return aW.types[i]||!1}function pW(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(px).forEach(function c(p){var a=px[p],m=a.extensions;if(!m||!m.length)return;n[p]=m;for(var x=0;x<m.length;x++){var l=m[x];if(i[l]){var f=o.indexOf(px[i[l]].source),$=o.indexOf(a.source);if(i[l]!=="application/octet-stream"&&(f>$||f===$&&i[l].substr(0,12)==="application/"))continue}i[l]=p}})}});var ax=h((Fj,HA)=>{/*!
21
+ */var lm=uS(),$7=import.meta.require("path").extname,_S=/^\s*([^;\s]*)(?:;|\s|$)/,T7=/^text\//i;F7.charset=bS;F7.charsets={lookup:bS};F7.contentType=w7;F7.extension=J7;F7.extensions=Object.create(null);F7.lookup=S7;F7.types=Object.create(null);A7(F7.extensions,F7.types);function bS(n){if(!n||typeof n!=="string")return!1;var i=_S.exec(n),o=i&&lm[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&T7.test(i[1]))return"UTF-8";return!1}function w7(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?F7.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=F7.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function J7(n){if(!n||typeof n!=="string")return!1;var i=_S.exec(n),o=i&&F7.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function S7(n){if(!n||typeof n!=="string")return!1;var i=$7("x."+n).toLowerCase().substr(1);if(!i)return!1;return F7.types[i]||!1}function A7(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(lm).forEach(function c(p){var a=lm[p],x=a.extensions;if(!x||!x.length)return;n[p]=x;for(var m=0;m<x.length;m++){var l=x[m];if(i[l]){var f=o.indexOf(lm[i[l]].source),v=o.indexOf(a.source);if(i[l]!=="application/octet-stream"&&(f>v||f===v&&i[l].substr(0,12)==="application/"))continue}i[l]=p}})}});var fm=h((qB,LS)=>{/*!
22
22
  * accepts
23
23
  * Copyright(c) 2014 Jonathan Ong
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var fW=MA(),$W=OA();HA.exports=Li;function Li(n){if(!(this instanceof Li))return new Li(n);this.headers=n.headers,this.negotiator=new fW(n)}Li.prototype.type=Li.prototype.types=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return i[0];var c=i.map(vW),p=this.negotiator.mediaTypes(c.filter(TW)),a=p[0];return a?i[c.indexOf(a)]:!1};Li.prototype.encoding=Li.prototype.encodings=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.encodings();return this.negotiator.encodings(i)[0]||!1};Li.prototype.charset=Li.prototype.charsets=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.charsets();return this.negotiator.charsets(i)[0]||!1};Li.prototype.lang=Li.prototype.langs=Li.prototype.language=Li.prototype.languages=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.languages();return this.negotiator.languages(i)[0]||!1};function vW(n){return n.indexOf("/")===-1?$W.lookup(n):n}function TW(n){return typeof n==="string"}});var Vf=h((EA,QA)=>{/*!
26
+ */var K7=OS(),X7=BS();LS.exports=Di;function Di(n){if(!(this instanceof Di))return new Di(n);this.headers=n.headers,this.negotiator=new K7(n)}Di.prototype.type=Di.prototype.types=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return i[0];var c=i.map(G7),p=this.negotiator.mediaTypes(c.filter(Y7)),a=p[0];return a?i[c.indexOf(a)]:!1};Di.prototype.encoding=Di.prototype.encodings=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.encodings();return this.negotiator.encodings(i)[0]||!1};Di.prototype.charset=Di.prototype.charsets=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.charsets();return this.negotiator.charsets(i)[0]||!1};Di.prototype.lang=Di.prototype.langs=Di.prototype.language=Di.prototype.languages=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.languages();return this.negotiator.languages(i)[0]||!1};function G7(n){return n.indexOf("/")===-1?X7.lookup(n):n}function Y7(n){return typeof n==="string"}});var Nf=h((NS,DS)=>{/*!
27
27
  * base64id v0.1.0
28
- */var Ea=import.meta.require("crypto"),bf=function(){};bf.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return Ea.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return Ea.randomBytes(n);if(this.bytesBufferIndex==null)this.bytesBufferIndex=-1;if(this.bytesBufferIndex==c)this.bytesBuffer=null,this.bytesBufferIndex=-1;if(this.bytesBufferIndex==-1||this.bytesBufferIndex>p){if(!this.isGeneratingBytes)this.isGeneratingBytes=!0,Ea.randomBytes(i,function(m,x){o.bytesBuffer=x,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return Ea.randomBytes(n)}var a=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,a};bf.prototype.generateId=function(){var n=Buffer.alloc(15);if(!n.writeInt32BE)return Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString();if(this.sequenceNumber=this.sequenceNumber+1|0,n.writeInt32BE(this.sequenceNumber,11),Ea.randomBytes)this.getRandomBytes(12).copy(n);else[0,4,8].forEach(function(i){n.writeInt32BE(Math.random()*Math.pow(2,32)|0,i)});return n.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")};EA=QA.exports=new bf});var mx=h((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.ERROR_PACKET=UA.PACKET_TYPES_REVERSE=UA.PACKET_TYPES=void 0;var Eo=Object.create(null);UA.PACKET_TYPES=Eo;Eo.open="0";Eo.close="1";Eo.ping="2";Eo.pong="3";Eo.message="4";Eo.upgrade="5";Eo.noop="6";var sA=Object.create(null);UA.PACKET_TYPES_REVERSE=sA;Object.keys(Eo).forEach((n)=>{sA[Eo[n]]=n});var wW={type:"error",data:"parser error"};UA.ERROR_PACKET=wW});var yA=h((_A)=>{Object.defineProperty(_A,"__esModule",{value:!0});_A.encodePacket=void 0;_A.encodePacketToBinary=RW;var JW=mx(),FW=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+VA(i,!0).toString("base64"));return c(JW.PACKET_TYPES[n]+(i||""))};_A.encodePacket=FW;var VA=(n,i)=>{if(Buffer.isBuffer(n)||n instanceof Uint8Array&&!i)return n;else if(n instanceof ArrayBuffer)return Buffer.from(n);else return Buffer.from(n.buffer,n.byteOffset,n.byteLength)},_f;function RW(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(VA(n.data,!1));_A.encodePacket(n,!0,(o)=>{if(!_f)_f=new TextEncoder;i(_f.encode(o))})}});var LA=h((BA)=>{Object.defineProperty(BA,"__esModule",{value:!0});BA.decodePacket=void 0;var xx=mx(),KW=(n,i)=>{if(typeof n!=="string")return{type:"message",data:jA(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:jA(c,i)}}if(!xx.PACKET_TYPES_REVERSE[o])return xx.ERROR_PACKET;return n.length>1?{type:xx.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:xx.PACKET_TYPES_REVERSE[o]}};BA.decodePacket=KW;var jA=(n,i)=>{switch(i){case"arraybuffer":if(n instanceof ArrayBuffer)return n;else if(Buffer.isBuffer(n))return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else return n.buffer;case"nodebuffer":default:if(Buffer.isBuffer(n))return n;else return Buffer.from(n)}}});var Qa=h(($x)=>{Object.defineProperty($x,"__esModule",{value:!0});$x.decodePayload=$x.decodePacket=$x.encodePayload=$x.encodePacket=$x.protocol=void 0;$x.createPacketEncoderStream=GW;$x.createPacketDecoderStream=zW;var Bf=yA();Object.defineProperty($x,"encodePacket",{enumerable:!0,get:function(){return Bf.encodePacket}});var Nf=LA();Object.defineProperty($x,"decodePacket",{enumerable:!0,get:function(){return Nf.decodePacket}});var tA=mx(),DA=String.fromCharCode(30),WW=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((a,m)=>{Bf.encodePacket(a,!1,(x)=>{if(c[m]=x,++p===o)i(c.join(DA))})})};$x.encodePayload=WW;var XW=(n,i)=>{let o=n.split(DA),c=[];for(let p=0;p<o.length;p++){let a=Nf.decodePacket(o[p],i);if(c.push(a),a.type==="error")break}return c};$x.decodePayload=XW;function GW(){return new TransformStream({transform(n,i){Bf.encodePacketToBinary(n,(o)=>{let c=o.length,p;if(c<126)p=new Uint8Array(1),new DataView(p.buffer).setUint8(0,c);else if(c<65536){p=new Uint8Array(3);let a=new DataView(p.buffer);a.setUint8(0,126),a.setUint16(1,c)}else{p=new Uint8Array(9);let a=new DataView(p.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var jf;function lx(n){return n.reduce((i,o)=>i+o.length,0)}function fx(n,i){if(n[0].length===i)return n.shift();let o=new Uint8Array(i),c=0;for(let p=0;p<i;p++)if(o[p]=n[0][c++],c===n[0].length)n.shift(),c=0;if(n.length&&c<n[0].length)n[0]=n[0].slice(c);return o}function zW(n,i){if(!jf)jf=new TextDecoder;let o=[],c=0,p=-1,a=!1;return new TransformStream({transform(m,x){o.push(m);while(!0){if(c===0){if(lx(o)<1)break;let l=fx(o,1);if(a=(l[0]&128)===128,p=l[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(lx(o)<2)break;let l=fx(o,2);p=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),c=3}else if(c===2){if(lx(o)<8)break;let l=fx(o,8),f=new DataView(l.buffer,l.byteOffset,l.length),$=f.getUint32(0);if($>Math.pow(2,21)-1){x.enqueue(tA.ERROR_PACKET);break}p=$*Math.pow(2,32)+f.getUint32(4),c=3}else{if(lx(o)<p)break;let l=fx(o,p);x.enqueue(Nf.decodePacket(a?l:jf.decode(l),i)),c=0}if(p===0||p>n){x.enqueue(tA.ERROR_PACKET);break}}}})}$x.protocol=4});var rA=h((zj,kA)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var xc=String.fromCharCode;function IA(n){var i=[],o=0,c=n.length,p,a;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(a=n.charCodeAt(o++),(a&64512)==56320)i.push(((p&1023)<<10)+(a&1023)+65536);else i.push(p),o--;else i.push(p);return i}function EW(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=xc(c>>>10&1023|55296),c=56320|c&1023;p+=xc(c)}return p}function CA(n,i){if(n>=55296&&n<=57343){if(i)throw Error("Lone surrogate U+"+n.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Lf(n,i){return xc(n>>i&63|128)}function QW(n,i){if((n&4294967168)==0)return xc(n);var o="";if((n&4294965248)==0)o=xc(n>>6&31|192);else if((n&4294901760)==0){if(!CA(n,i))n=65533;o=xc(n>>12&15|224),o+=Lf(n,6)}else if((n&4292870144)==0)o=xc(n>>18&7|240),o+=Lf(n,12),o+=Lf(n,6);return o+=xc(n&63|128),o}function sW(n,i){i=i||{};var o=i.strict!==!1,c=IA(n),p=c.length,a=-1,m,x="";while(++a<p)m=c[a],x+=QW(m,o);return x}function Sp(){if(lc>=Tx)throw Error("Invalid byte index");var n=vx[lc]&255;if(lc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function UW(n){var i,o,c,p,a;if(lc>Tx)throw Error("Invalid byte index");if(lc==Tx)return!1;if(i=vx[lc]&255,lc++,(i&128)==0)return i;if((i&224)==192)if(o=Sp(),a=(i&31)<<6|o,a>=128)return a;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Sp(),c=Sp(),a=(i&15)<<12|o<<6|c,a>=2048)return CA(a,n)?a:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Sp(),c=Sp(),p=Sp(),a=(i&7)<<18|o<<12|c<<6|p,a>=65536&&a<=1114111)return a}throw Error("Invalid UTF-8 detected")}var vx,Tx,lc;function bW(n,i){i=i||{};var o=i.strict!==!1;vx=IA(n),Tx=vx.length,lc=0;var c=[],p;while((p=UW(o))!==!1)c.push(p);return EW(c)}kA.exports={version:"2.1.2",encode:sW,decode:bW}});var oJ=h((iJ)=>{Object.defineProperty(iJ,"__esModule",{value:!0});iJ.packets=iJ.protocol=void 0;iJ.encodePacket=tf;iJ.encodeBase64Packet=eA;iJ.decodePacket=Df;iJ.decodeBase64Packet=PA;iJ.encodePayload=jW;iJ.decodePayload=NW;iJ.encodePayloadAsBinary=dA;iJ.decodePayloadAsBinary=nJ;var qA=rA();iJ.protocol=3;var VW=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};iJ.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Ap=Object.keys(iJ.packets),So={type:"error",data:"parser error"},_W=Buffer.concat([]);function tf(n,i,o,c){if(typeof i==="function")c=i,i=null;if(typeof o==="function")c=o,o=null;if(Buffer.isBuffer(n.data))return ZA(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return ZA({type:n.type,data:hf(n.data)},i,c);var p=iJ.packets[n.type];if(n.data!==void 0)p+=o?qA.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function ZA(n,i,o){if(!i)return eA(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=iJ.packets[n.type],o(Buffer.concat([p,c]))}function eA(n,i){var o=Buffer.isBuffer(n.data)?n.data:hf(n.data),c="b"+iJ.packets[n.type];return c+=o.toString("base64"),i(c)}function Df(n,i,o){if(n===void 0)return So;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return PA(n.slice(1),i);if(o){if(n=yW(n),n===!1)return So}if(Number(c)!=c||!Ap[c])return So;if(n.length>1)return{type:Ap[c],data:n.slice(1)};else return{type:Ap[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Ap[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=hf(n);return c=n[0],{type:Ap[c],data:n.slice(1)}}function yW(n){try{n=qA.decode(n,{strict:!1})}catch(i){return!1}return n}function PA(n,i){var o=Ap[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var a=0;a<p.length;a++)p[a]=c[a];c=p.buffer}return{type:o,data:c}}function jW(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&VW(n))return dA(n,o);if(!n.length)return o("0:");function c(p,a){tf(p,i,!1,function(m){a(null,BW(m))})}gA(n,c,function(p,a){return o(a.join(""))})}function BW(n){return n.length+":"+n}function gA(n,i,o){let c=new Array(n.length),p=0;for(let a=0;a<n.length;a++)i(n[a],(m,x)=>{if(c[a]=x,++p===n.length)o(null,c)})}function NW(n,i,o){if(typeof n!=="string")return nJ(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o(So,0,1);var c="",p,a,m;for(var x=0,l=n.length;x<l;x++){var f=n.charAt(x);if(f!==":"){c+=f;continue}if(c===""||c!=(p=Number(c)))return o(So,0,1);if(a=n.slice(x+1,x+1+p),c!=a.length)return o(So,0,1);if(a.length){if(m=Df(a,i,!1),So.type===m.type&&So.data===m.data)return o(So,0,1);var $=o(m,x+p,l);if($===!1)return}x+=p,c=""}if(c!=="")return o(So,0,1)}function LW(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function tW(n){var i=Buffer.allocUnsafe(n.length);for(var o=0,c=n.length;o<c;o++)i.writeUInt8(n.charCodeAt(o),o);return i}function hf(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function dA(n,i){if(!n.length)return i(_W);gA(n,DW,function(o,c){return i(Buffer.concat(c))})}function DW(n,i){function o(c){var p=""+c.length,a;if(typeof c==="string"){a=Buffer.allocUnsafe(p.length+2),a[0]=0;for(var m=0;m<p.length;m++)a[m+1]=parseInt(p[m],10);return a[a.length-1]=255,i(null,Buffer.concat([a,tW(c)]))}a=Buffer.allocUnsafe(p.length+2),a[0]=1;for(var m=0;m<p.length;m++)a[m+1]=parseInt(p[m],10);a[a.length-1]=255,i(null,Buffer.concat([a,c]))}tf(n,!0,!0,o)}function nJ(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],a;while(c.length>0){var m="",x=c[0]===0;for(a=1;;a++){if(c[a]===255)break;if(m.length>310)return o(So,0,1);m+=""+c[a]}c=c.slice(m.length+1);var l=parseInt(m,10),f=c.slice(1,l+1);if(x)f=LW(f);p.push(f),c=c.slice(l+1)}var $=p.length;for(a=0;a<$;a++){var v=p[a];o(Df(v,i,!0),a,$)}}});var pJ=h((Yj,cJ)=>{var Fp=1000,Rp=Fp*60,Mp=Rp*60,Qc=Mp*24,gW=Qc*7,dW=Qc*365.25;cJ.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return n7(n);else if(o==="number"&&isFinite(n))return i.long?o7(n):i7(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function n7(n){if(n=String(n),n.length>100)return;var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!i)return;var o=parseFloat(i[1]),c=(i[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return o*dW;case"weeks":case"week":case"w":return o*gW;case"days":case"day":case"d":return o*Qc;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Mp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Rp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Fp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function i7(n){var i=Math.abs(n);if(i>=Qc)return Math.round(n/Qc)+"d";if(i>=Mp)return Math.round(n/Mp)+"h";if(i>=Rp)return Math.round(n/Rp)+"m";if(i>=Fp)return Math.round(n/Fp)+"s";return n+"ms"}function o7(n){var i=Math.abs(n);if(i>=Qc)return wx(n,i,Qc,"day");if(i>=Mp)return wx(n,i,Mp,"hour");if(i>=Rp)return wx(n,i,Rp,"minute");if(i>=Fp)return wx(n,i,Fp,"second");return n+" ms"}function wx(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var If=h((Oj,aJ)=>{function c7(n){o.debug=o,o.default=o,o.coerce=l,o.disable=a,o.enable=p,o.enabled=m,o.humanize=pJ(),o.destroy=f,Object.keys(n).forEach(($)=>{o[$]=n[$]}),o.names=[],o.skips=[],o.formatters={};function i($){let v=0;for(let w=0;w<$.length;w++)v=(v<<5)-v+$.charCodeAt(w),v|=0;return o.colors[Math.abs(v)%o.colors.length]}o.selectColor=i;function o($){let v,w=null,F,M;function J(...X){if(!J.enabled)return;let G=J,u=Number(new Date),Q=u-(v||u);if(G.diff=Q,G.prev=v,G.curr=u,v=u,X[0]=o.coerce(X[0]),typeof X[0]!=="string")X.unshift("%O");let V=0;X[0]=X[0].replace(/%([a-zA-Z%])/g,(R,O)=>{if(R==="%%")return"%";V++;let b=o.formatters[O];if(typeof b==="function"){let H=X[V];R=b.call(G,H),X.splice(V,1),V--}return R}),o.formatArgs.call(G,X),(G.log||o.log).apply(G,X)}if(J.namespace=$,J.useColors=o.useColors(),J.color=o.selectColor($),J.extend=c,J.destroy=o.destroy,Object.defineProperty(J,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(w!==null)return w;if(F!==o.namespaces)F=o.namespaces,M=o.enabled($);return M},set:(X)=>{w=X}}),typeof o.init==="function")o.init(J);return J}function c($,v){let w=o(this.namespace+(typeof v==="undefined"?":":v)+$);return w.log=this.log,w}function p($){o.save($),o.namespaces=$,o.names=[],o.skips=[];let v,w=(typeof $==="string"?$:"").split(/[\s,]+/),F=w.length;for(v=0;v<F;v++){if(!w[v])continue;if($=w[v].replace(/\*/g,".*?"),$[0]==="-")o.skips.push(new RegExp("^"+$.slice(1)+"$"));else o.names.push(new RegExp("^"+$+"$"))}}function a(){let $=[...o.names.map(x),...o.skips.map(x).map((v)=>"-"+v)].join(",");return o.enable(""),$}function m($){if($[$.length-1]==="*")return!0;let v,w;for(v=0,w=o.skips.length;v<w;v++)if(o.skips[v].test($))return!1;for(v=0,w=o.names.length;v<w;v++)if(o.names[v].test($))return!0;return!1}function x($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function l($){if($ instanceof Error)return $.stack||$.message;return $}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}aJ.exports=c7});var xJ=h((mJ,Ax)=>{mJ.formatArgs=a7;mJ.save=m7;mJ.load=x7;mJ.useColors=p7;mJ.storage=l7();mJ.destroy=(()=>{let n=!1;return()=>{if(!n)n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();mJ.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p7(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a7(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Ax.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;n.splice(1,0,i,"color: inherit");let o=0,c=0;n[0].replace(/%[a-zA-Z%]/g,(p)=>{if(p==="%%")return;if(o++,p==="%c")c=o}),n.splice(c,0,i)}mJ.log=console.debug||console.log||(()=>{});function m7(n){try{if(n)mJ.storage.setItem("debug",n);else mJ.storage.removeItem("debug")}catch(i){}}function x7(){let n;try{n=mJ.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function l7(){try{return localStorage}catch(n){}}Ax.exports=If()(mJ);var{formatters:f7}=Ax.exports;f7.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var fJ=h((Ej,lJ)=>{lJ.exports=(n,i)=>{i=i||process.argv;let o=n.startsWith("-")?"":n.length===1?"-":"--",c=i.indexOf(o+n),p=i.indexOf("--");return c!==-1&&(p===-1?!0:c<p)}});var vJ=h((Qj,$J)=>{var F7=import.meta.require("os"),Ao=fJ(),Fi=process.env,Kp;if(Ao("no-color")||Ao("no-colors")||Ao("color=false"))Kp=!1;else if(Ao("color")||Ao("colors")||Ao("color=true")||Ao("color=always"))Kp=!0;if("FORCE_COLOR"in Fi)Kp=Fi.FORCE_COLOR.length===0||parseInt(Fi.FORCE_COLOR,10)!==0;function R7(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function M7(n){if(Kp===!1)return 0;if(Ao("color=16m")||Ao("color=full")||Ao("color=truecolor"))return 3;if(Ao("color=256"))return 2;if(n&&!n.isTTY&&Kp!==!0)return 0;let i=Kp?1:0;if(process.platform==="win32"){let o=F7.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(o[0])>=10&&Number(o[2])>=10586)return Number(o[2])>=14931?3:2;return 1}if("CI"in Fi){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((o)=>(o in Fi))||Fi.CI_NAME==="codeship")return 1;return i}if("TEAMCITY_VERSION"in Fi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Fi.TEAMCITY_VERSION)?1:0;if(Fi.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Fi){let o=parseInt((Fi.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Fi.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Fi.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Fi.TERM))return 1;if("COLORTERM"in Fi)return 1;if(Fi.TERM==="dumb")return i;return i}function Cf(n){let i=M7(n);return R7(i)}$J.exports={supportsColor:Cf,stdout:Cf(process.stdout),stderr:Cf(process.stderr)}});var AJ=h((wJ,Fx)=>{var K7=import.meta.require("tty"),Jx=import.meta.require("util");wJ.init=O7;wJ.log=z7;wJ.formatArgs=X7;wJ.save=u7;wJ.load=Y7;wJ.useColors=W7;wJ.destroy=Jx.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");wJ.colors=[6,2,3,4,5,1];try{let n=vJ();if(n&&(n.stderr||n).level>=2)wJ.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(n){}wJ.inspectOpts=Object.keys(process.env).filter((n)=>{return/^debug_/i.test(n)}).reduce((n,i)=>{let o=i.substring(6).toLowerCase().replace(/_([a-z])/g,(p,a)=>{return a.toUpperCase()}),c=process.env[i];if(/^(yes|on|true|enabled)$/i.test(c))c=!0;else if(/^(no|off|false|disabled)$/i.test(c))c=!1;else if(c==="null")c=null;else c=Number(c);return n[o]=c,n},{});function W7(){return"colors"in wJ.inspectOpts?Boolean(wJ.inspectOpts.colors):K7.isatty(process.stderr.fd)}function X7(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),a=` ${p};1m${i} \x1B[0m`;n[0]=a+n[0].split("\n").join("\n"+a),n.push(p+"m+"+Fx.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=G7()+i+" "+n[0]}function G7(){if(wJ.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function z7(...n){return process.stderr.write(Jx.formatWithOptions(wJ.inspectOpts,...n)+"\n")}function u7(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function Y7(){return process.env.DEBUG}function O7(n){n.inspectOpts={};let i=Object.keys(wJ.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=wJ.inspectOpts[i[o]]}Fx.exports=If()(wJ);var{formatters:TJ}=Fx.exports;TJ.o=function(n){return this.inspectOpts.colors=this.useColors,Jx.inspect(n,this.inspectOpts).split("\n").map((i)=>i.trim()).join(" ")};TJ.O=function(n){return this.inspectOpts.colors=this.useColors,Jx.inspect(n,this.inspectOpts)}});var mi=h((Uj,kf)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)kf.exports=xJ();else kf.exports=AJ()});var Uc=h((RJ)=>{Object.defineProperty(RJ,"__esModule",{value:!0});RJ.Transport=void 0;var _7=import.meta.require("events"),y7=Qa(),j7=oJ(),B7=mi(),JJ=B7.default("engine:transport");function N7(){}class FJ extends _7.EventEmitter{get readyState(){return this._readyState}set readyState(n){JJ("readyState updated from %s to %s (%s)",this._readyState,n,this.name),this._readyState=n}constructor(n){super();this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=n._query.EIO==="4"?4:3,this.parser=this.protocol===4?y7:j7,this.supportsBinary=!(n._query&&n._query.b64)}discard(){this.discarded=!0}onRequest(n){}close(n){if(this.readyState==="closed"||this.readyState==="closing")return;this.readyState="closing",this.doClose(n||N7)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else JJ("ignored transport error %s (%s)",n,i)}onPacket(n){this.emit("packet",n)}onData(n){this.onPacket(this.parser.decodePacket(n))}onClose(){this.readyState="closed",this.emit("close")}}RJ.Transport=FJ});var rf=h((XJ)=>{Object.defineProperty(XJ,"__esModule",{value:!0});XJ.Polling=void 0;var L7=Uc(),KJ=import.meta.require("zlib"),t7=ax(),D7=mi(),ti=D7.default("engine:polling"),h7={gzip:KJ.createGzip,deflate:KJ.createDeflate};class WJ extends L7.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.method==="GET")this.onPollRequest(n,i);else if(n.method==="POST")this.onDataRequest(n,i);else i.writeHead(500),i.end()}onPollRequest(n,i){if(this.req){ti("request overlap"),this.onError("overlap from client"),i.writeHead(400),i.end();return}ti("setting request"),this.req=n,this.res=i;let o=()=>{this.onError("poll connection closed prematurely")},c=()=>{n.removeListener("close",o),this.req=this.res=null};if(n.cleanup=c,n.on("close",o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)ti("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeHead(400),i.end();return}let o=n.headers["content-type"]==="application/octet-stream";if(o&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let c=o?Buffer.concat([]):"",p=()=>{n.removeListener("data",m),n.removeListener("end",x),n.removeListener("close",a),this.dataReq=this.dataRes=c=null},a=()=>{p(),this.onError("data request connection closed prematurely")},m=(l)=>{let f;if(o)c=Buffer.concat([c,l]),f=c.length;else c+=l,f=Buffer.byteLength(c);if(f>this.maxHttpBufferSize)i.writeHead(413).end(),p()},x=()=>{this.onData(c);let l={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,l)),i.end("ok"),p()};if(n.on("close",a),!o)n.setEncoding("utf8");n.on("data",m),n.on("end",x)}onData(n){ti('received "%s"',n);let i=(o)=>{if(o.type==="close")return ti("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)ti("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){ti('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",a={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(f)=>{a["Content-Length"]=typeof f==="string"?Buffer.byteLength(f):f.length,this.res.writeHead(200,this.headers(this.req,a)),this.res.end(f),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let l=t7(this.req).encodings(["gzip","deflate"]);if(!l){m(n);return}this.compress(n,l,(f,$)=>{if(f){this.res.writeHead(500),this.res.end(),o(f);return}a["Content-Encoding"]=l,m($)})}compress(n,i,o){ti("compressing");let c=[],p=0;h7[i](this.httpCompression).on("error",o).on("data",function(a){c.push(a),p+=a.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){ti("closing");let i;if(this.dataReq)ti("aborting ongoing data request"),this.dataReq.destroy();let o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)ti("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)ti("transport discarded - closing right away"),o();else ti("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i={}){let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}XJ.Polling=WJ});var OJ=h((uJ)=>{Object.defineProperty(uJ,"__esModule",{value:!0});uJ.JSONP=void 0;var I7=rf(),C7=import.meta.require("querystring"),k7=/\\\\n/g,r7=/(\\)?\\n/g;class zJ extends I7.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=C7.parse(n).d,typeof n==="string")n=n.replace(r7,function(i,o){return o?i:"\n"}),super.onData(n.replace(k7,"\\n"))}doWrite(n,i,o){let c=JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");n=this.head+c+this.foot,super.doWrite(n,i,o)}}uJ.JSONP=zJ});var UJ=h((QJ)=>{Object.defineProperty(QJ,"__esModule",{value:!0});QJ.WebSocket=void 0;var Z7=Uc(),q7=mi(),HJ=q7.default("engine:ws");class EJ extends Z7.Transport{constructor(n){super(n);this._doSend=(i)=>{this.socket.send(i,this._onSent)},this._doSendLast=(i)=>{this.socket.send(i,this._onSentLast)},this._onSent=(i)=>{if(i)this.onError("write error",i.stack)},this._onSentLast=(i)=>{if(i)this.onError("write error",i.stack);else this.emit("drain"),this.writable=!0,this.emit("ready")},this.socket=n.websocket,this.socket.on("message",(i,o)=>{let c=o?i:i.toString();HJ('received "%s"',c),super.onData(c)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length;if(this._canSendPreEncodedFrame(o))this.socket._sender.sendFrame(o.options.wsPreEncodedFrame,c?this._onSentLast:this._onSent);else this.parser.encodePacket(o,this.supportsBinary,c?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(n){var i,o,c;return!this.perMessageDeflate&&typeof((o=(i=this.socket)===null||i===void 0?void 0:i._sender)===null||o===void 0?void 0:o.sendFrame)==="function"&&((c=n.options)===null||c===void 0?void 0:c.wsPreEncodedFrame)!==void 0}doClose(n){HJ("closing"),this.socket.close(),n&&n()}}QJ.WebSocket=EJ});var Zf=h((VJ)=>{Object.defineProperty(VJ,"__esModule",{value:!0});VJ.WebTransport=void 0;var e7=Uc(),P7=mi(),g7=Qa(),Wp=P7.default("engine:webtransport");class bJ extends e7.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=g7.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{Wp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:a}=await o.read();if(a){Wp("session is closed");break}Wp("received chunk: %o",p),this.onPacket(p)}}catch(p){Wp("error while reading: %s",p.message)}})(),n.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(n){this.writable=!1;try{for(let i=0;i<n.length;i++){let o=n[i];await this.writer.write(o)}}catch(i){Wp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){Wp("closing WebTransport session"),this.session.close(),n&&n()}}VJ.WebTransport=bJ});var qf=h((jJ)=>{Object.defineProperty(jJ,"__esModule",{value:!0});var d7=rf(),n3=OJ(),i3=UJ(),o3=Zf();jJ.default={polling:yJ,websocket:i3.WebSocket,webtransport:o3.WebTransport};function yJ(n){if(typeof n._query.j==="string")return new n3.JSONP(n);else return new d7.Polling(n)}yJ.upgradesTo=["websocket","webtransport"]});var ef=h((NJ)=>{Object.defineProperty(NJ,"__esModule",{value:!0});NJ.Socket=void 0;var p3=import.meta.require("events"),a3=mi(),Bo=import.meta.require("timers"),rn=a3.default("engine:socket");class BJ extends p3.EventEmitter{get readyState(){return this._readyState}set readyState(n){rn("readyState updated from %s to %s",this._readyState,n),this._readyState=n}constructor(n,i,o,c,p){super();if(this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=n,this.server=i,this.request=c,this.protocol=p,c)if(c.websocket&&c.websocket._socket)this.remoteAddress=c.websocket._socket.remoteAddress;else this.remoteAddress=c.connection.remoteAddress;this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(o),this.onOpen()}onOpen(){if(this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket)this.sendPacket("message",this.server.opts.initialPacket);if(this.emit("open"),this.protocol===3)this.resetPingTimeout();else this.schedulePing()}onPacket(n){if(this.readyState!=="open")return rn("packet received with closed socket");switch(rn(`received packet ${n.type}`),this.emit("packet",n),n.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}rn("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}rn("got pong"),Bo.clearTimeout(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",n.data),this.emit("message",n.data);break}}onError(n){rn("transport error"),this.onClose("transport error",n)}schedulePing(){this.pingIntervalTimer=Bo.setTimeout(()=>{rn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){Bo.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=Bo.setTimeout(()=>{if(this.readyState==="closed")return;this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(n){let i=this.onError.bind(this),o=()=>this.flush(),c=this.onPacket.bind(this),p=this.onDrain.bind(this),a=this.onClose.bind(this,"transport close");this.transport=n,this.transport.once("error",i),this.transport.on("ready",o),this.transport.on("packet",c),this.transport.on("drain",p),this.transport.once("close",a),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",a)})}onDrain(){if(this.sentCallbackFn.length>0){rn("executing batch send callback");let n=this.sentCallbackFn.shift();if(n)for(let i=0;i<n.length;i++)n[i](this.transport)}}_maybeUpgrade(n){rn('might upgrade socket transport from "%s" to "%s"',this.transport.name,n.name),this.upgrading=!0;let i=Bo.setTimeout(()=>{if(rn("client did not complete upgrade - closing transport"),a(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(f)=>{if(f.type==="ping"&&f.data==="probe")rn("got probe ping packet, sending pong"),n.send([{type:"pong",data:"probe"}]),this.emit("upgrading",n),clearInterval(o),o=setInterval(p,100);else if(f.type==="upgrade"&&this.readyState!=="closed"){if(rn("got upgrade packet - upgrading"),a(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(n),this.emit("upgrade",n),this.flush(),this.readyState==="closing")n.close(()=>{this.onClose("forced close")})}else a(),n.close()},p=()=>{if(this.transport.name==="polling"&&this.transport.writable)rn("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}])},a=()=>{this.upgrading=!1,clearInterval(o),Bo.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",x),n.removeListener("error",m),this.removeListener("close",l)},m=(f)=>{rn("client did not complete upgrade - %s",f),a(),n.close(),n=null},x=()=>{m("transport closed")},l=()=>{m("socket closed")};n.on("packet",c),n.once("close",x),n.once("error",m),this.once("close",l)}clearTransport(){let n,i=this.cleanupFn.length;for(let o=0;o<i;o++)n=this.cleanupFn.shift(),n();this.transport.on("error",function(){rn("error triggered by discarded transport")}),this.transport.close(),Bo.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",Bo.clearTimeout(this.pingIntervalTimer),Bo.clearTimeout(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",n,i)}send(n,i,o){return this.sendPacket("message",n,i,o),this}write(n,i,o){return this.sendPacket("message",n,i,o),this}sendPacket(n,i,o={},c){if(typeof o==="function")c=o,o={};if(this.readyState!=="closing"&&this.readyState!=="closed"){rn('sending packet "%s" (%s)',n,i),o.compress=o.compress!==!1;let p={type:n,options:o};if(i)p.data=i;if(this.emit("packetCreate",p),this.writeBuffer.push(p),typeof c==="function")this.packetsFn.push(c);this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){rn("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let n=this.writeBuffer;if(this.writeBuffer=[],this.packetsFn.length)this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[];else this.sentCallbackFn.push(null);this.transport.send(n),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let n=[],i=this.server.upgrades(this.transport.name);for(let o=0;o<i.length;++o){let c=i[o];if(this.server.opts.transports.indexOf(c)!==-1)n.push(c)}return n}close(n){if(n&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(n);if(this.readyState!=="open")return;if(this.readyState="closing",this.writeBuffer.length){rn("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{rn("all packets have been sent, closing the transport"),this.closeTransport(n)});return}rn("the buffer is empty, closing the transport right away"),this.closeTransport(n)}closeTransport(n){if(rn("closing the transport (discard? %s)",!!n),n)this.transport.discard();this.transport.close(this.onClose.bind(this,"forced close"))}}NJ.Socket=BJ});var tJ=h((v3)=>{/*!
28
+ */var ua=import.meta.require("crypto"),Lf=function(){};Lf.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return ua.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return ua.randomBytes(n);if(this.bytesBufferIndex==null)this.bytesBufferIndex=-1;if(this.bytesBufferIndex==c)this.bytesBuffer=null,this.bytesBufferIndex=-1;if(this.bytesBufferIndex==-1||this.bytesBufferIndex>p){if(!this.isGeneratingBytes)this.isGeneratingBytes=!0,ua.randomBytes(i,function(x,m){o.bytesBuffer=m,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return ua.randomBytes(n)}var a=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,a};Lf.prototype.generateId=function(){var n=Buffer.alloc(15);if(!n.writeInt32BE)return Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString();if(this.sequenceNumber=this.sequenceNumber+1|0,n.writeInt32BE(this.sequenceNumber,11),ua.randomBytes)this.getRandomBytes(12).copy(n);else[0,4,8].forEach(function(i){n.writeInt32BE(Math.random()*Math.pow(2,32)|0,i)});return n.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")};NS=DS.exports=new Lf});var vm=h((hS)=>{Object.defineProperty(hS,"__esModule",{value:!0});hS.ERROR_PACKET=hS.PACKET_TYPES_REVERSE=hS.PACKET_TYPES=void 0;var Oo=Object.create(null);hS.PACKET_TYPES=Oo;Oo.open="0";Oo.close="1";Oo.ping="2";Oo.pong="3";Oo.message="4";Oo.upgrade="5";Oo.noop="6";var CS=Object.create(null);hS.PACKET_TYPES_REVERSE=CS;Object.keys(Oo).forEach((n)=>{CS[Oo[n]]=n});var z7={type:"error",data:"parser error"};hS.ERROR_PACKET=z7});var ZS=h((sS)=>{Object.defineProperty(sS,"__esModule",{value:!0});sS.encodePacket=void 0;sS.encodePacketToBinary=U7;var E7=vm(),O7=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+kS(i,!0).toString("base64"));return c(E7.PACKET_TYPES[n]+(i||""))};sS.encodePacket=O7;var kS=(n,i)=>{if(Buffer.isBuffer(n)||n instanceof Uint8Array&&!i)return n;else if(n instanceof ArrayBuffer)return Buffer.from(n);else return Buffer.from(n.buffer,n.byteOffset,n.byteLength)},Df;function U7(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(kS(n.data,!1));sS.encodePacket(n,!0,(o)=>{if(!Df)Df=new TextEncoder;i(Df.encode(o))})}});var rS=h((qS)=>{Object.defineProperty(qS,"__esModule",{value:!0});qS.decodePacket=void 0;var $m=vm(),u7=(n,i)=>{if(typeof n!=="string")return{type:"message",data:tS(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:tS(c,i)}}if(!$m.PACKET_TYPES_REVERSE[o])return $m.ERROR_PACKET;return n.length>1?{type:$m.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:$m.PACKET_TYPES_REVERSE[o]}};qS.decodePacket=u7;var tS=(n,i)=>{switch(i){case"arraybuffer":if(n instanceof ArrayBuffer)return n;else if(Buffer.isBuffer(n))return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else return n.buffer;case"nodebuffer":default:if(Buffer.isBuffer(n))return n;else return Buffer.from(n)}}});var _a=h((Jm)=>{Object.defineProperty(Jm,"__esModule",{value:!0});Jm.decodePayload=Jm.decodePacket=Jm.encodePayload=Jm.encodePacket=Jm.protocol=void 0;Jm.createPacketEncoderStream=j7;Jm.createPacketDecoderStream=y7;var If=ZS();Object.defineProperty(Jm,"encodePacket",{enumerable:!0,get:function(){return If.encodePacket}});var kf=rS();Object.defineProperty(Jm,"decodePacket",{enumerable:!0,get:function(){return kf.decodePacket}});var gS=vm(),dS=String.fromCharCode(30),_7=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((a,x)=>{If.encodePacket(a,!1,(m)=>{if(c[x]=m,++p===o)i(c.join(dS))})})};Jm.encodePayload=_7;var b7=(n,i)=>{let o=n.split(dS),c=[];for(let p=0;p<o.length;p++){let a=kf.decodePacket(o[p],i);if(c.push(a),a.type==="error")break}return c};Jm.decodePayload=b7;function j7(){return new TransformStream({transform(n,i){If.encodePacketToBinary(n,(o)=>{let c=o.length,p;if(c<126)p=new Uint8Array(1),new DataView(p.buffer).setUint8(0,c);else if(c<65536){p=new Uint8Array(3);let a=new DataView(p.buffer);a.setUint8(0,126),a.setUint16(1,c)}else{p=new Uint8Array(9);let a=new DataView(p.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var hf;function Tm(n){return n.reduce((i,o)=>i+o.length,0)}function wm(n,i){if(n[0].length===i)return n.shift();let o=new Uint8Array(i),c=0;for(let p=0;p<i;p++)if(o[p]=n[0][c++],c===n[0].length)n.shift(),c=0;if(n.length&&c<n[0].length)n[0]=n[0].slice(c);return o}function y7(n,i){if(!hf)hf=new TextDecoder;let o=[],c=0,p=-1,a=!1;return new TransformStream({transform(x,m){o.push(x);while(!0){if(c===0){if(Tm(o)<1)break;let l=wm(o,1);if(a=(l[0]&128)===128,p=l[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Tm(o)<2)break;let l=wm(o,2);p=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),c=3}else if(c===2){if(Tm(o)<8)break;let l=wm(o,8),f=new DataView(l.buffer,l.byteOffset,l.length),v=f.getUint32(0);if(v>Math.pow(2,21)-1){m.enqueue(gS.ERROR_PACKET);break}p=v*Math.pow(2,32)+f.getUint32(4),c=3}else{if(Tm(o)<p)break;let l=wm(o,p);m.enqueue(kf.decodePacket(a?l:hf.decode(l),i)),c=0}if(p===0||p>n){m.enqueue(gS.ERROR_PACKET);break}}}})}Jm.protocol=4});var cA=h((iL,oA)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var lc=String.fromCharCode;function nA(n){var i=[],o=0,c=n.length,p,a;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(a=n.charCodeAt(o++),(a&64512)==56320)i.push(((p&1023)<<10)+(a&1023)+65536);else i.push(p),o--;else i.push(p);return i}function C7(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=lc(c>>>10&1023|55296),c=56320|c&1023;p+=lc(c)}return p}function iA(n,i){if(n>=55296&&n<=57343){if(i)throw Error("Lone surrogate U+"+n.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function sf(n,i){return lc(n>>i&63|128)}function h7(n,i){if((n&4294967168)==0)return lc(n);var o="";if((n&4294965248)==0)o=lc(n>>6&31|192);else if((n&4294901760)==0){if(!iA(n,i))n=65533;o=lc(n>>12&15|224),o+=sf(n,6)}else if((n&4292870144)==0)o=lc(n>>18&7|240),o+=sf(n,12),o+=sf(n,6);return o+=lc(n&63|128),o}function I7(n,i){i=i||{};var o=i.strict!==!1,c=nA(n),p=c.length,a=-1,x,m="";while(++a<p)x=c[a],m+=h7(x,o);return m}function Fp(){if(fc>=Am)throw Error("Invalid byte index");var n=Sm[fc]&255;if(fc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function k7(n){var i,o,c,p,a;if(fc>Am)throw Error("Invalid byte index");if(fc==Am)return!1;if(i=Sm[fc]&255,fc++,(i&128)==0)return i;if((i&224)==192)if(o=Fp(),a=(i&31)<<6|o,a>=128)return a;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Fp(),c=Fp(),a=(i&15)<<12|o<<6|c,a>=2048)return iA(a,n)?a:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Fp(),c=Fp(),p=Fp(),a=(i&7)<<18|o<<12|c<<6|p,a>=65536&&a<=1114111)return a}throw Error("Invalid UTF-8 detected")}var Sm,Am,fc;function s7(n,i){i=i||{};var o=i.strict!==!1;Sm=nA(n),Am=Sm.length,fc=0;var c=[],p;while((p=k7(o))!==!1)c.push(p);return C7(c)}oA.exports={version:"2.1.2",encode:I7,decode:s7}});var TA=h(($A)=>{Object.defineProperty($A,"__esModule",{value:!0});$A.packets=$A.protocol=void 0;$A.encodePacket=Zf;$A.encodeBase64Packet=xA;$A.decodePacket=tf;$A.decodeBase64Packet=mA;$A.encodePayload=P7;$A.decodePayload=g7;$A.encodePayloadAsBinary=fA;$A.decodePayloadAsBinary=vA;var aA=cA();$A.protocol=3;var Z7=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};$A.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Mp=Object.keys($A.packets),Jo={type:"error",data:"parser error"},t7=Buffer.concat([]);function Zf(n,i,o,c){if(typeof i==="function")c=i,i=null;if(typeof o==="function")c=o,o=null;if(Buffer.isBuffer(n.data))return pA(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return pA({type:n.type,data:qf(n.data)},i,c);var p=$A.packets[n.type];if(n.data!==void 0)p+=o?aA.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function pA(n,i,o){if(!i)return xA(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=$A.packets[n.type],o(Buffer.concat([p,c]))}function xA(n,i){var o=Buffer.isBuffer(n.data)?n.data:qf(n.data),c="b"+$A.packets[n.type];return c+=o.toString("base64"),i(c)}function tf(n,i,o){if(n===void 0)return Jo;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return mA(n.slice(1),i);if(o){if(n=q7(n),n===!1)return Jo}if(Number(c)!=c||!Mp[c])return Jo;if(n.length>1)return{type:Mp[c],data:n.slice(1)};else return{type:Mp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Mp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=qf(n);return c=n[0],{type:Mp[c],data:n.slice(1)}}function q7(n){try{n=aA.decode(n,{strict:!1})}catch(i){return!1}return n}function mA(n,i){var o=Mp[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var a=0;a<p.length;a++)p[a]=c[a];c=p.buffer}return{type:o,data:c}}function P7(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&Z7(n))return fA(n,o);if(!n.length)return o("0:");function c(p,a){Zf(p,i,!1,function(x){a(null,r7(x))})}lA(n,c,function(p,a){return o(a.join(""))})}function r7(n){return n.length+":"+n}function lA(n,i,o){let c=new Array(n.length),p=0;for(let a=0;a<n.length;a++)i(n[a],(x,m)=>{if(c[a]=m,++p===n.length)o(null,c)})}function g7(n,i,o){if(typeof n!=="string")return vA(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o(Jo,0,1);var c="",p,a,x;for(var m=0,l=n.length;m<l;m++){var f=n.charAt(m);if(f!==":"){c+=f;continue}if(c===""||c!=(p=Number(c)))return o(Jo,0,1);if(a=n.slice(m+1,m+1+p),c!=a.length)return o(Jo,0,1);if(a.length){if(x=tf(a,i,!1),Jo.type===x.type&&Jo.data===x.data)return o(Jo,0,1);var v=o(x,m+p,l);if(v===!1)return}m+=p,c=""}if(c!=="")return o(Jo,0,1)}function d7(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function e7(n){var i=Buffer.allocUnsafe(n.length);for(var o=0,c=n.length;o<c;o++)i.writeUInt8(n.charCodeAt(o),o);return i}function qf(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function fA(n,i){if(!n.length)return i(t7);lA(n,nK,function(o,c){return i(Buffer.concat(c))})}function nK(n,i){function o(c){var p=""+c.length,a;if(typeof c==="string"){a=Buffer.allocUnsafe(p.length+2),a[0]=0;for(var x=0;x<p.length;x++)a[x+1]=parseInt(p[x],10);return a[a.length-1]=255,i(null,Buffer.concat([a,e7(c)]))}a=Buffer.allocUnsafe(p.length+2),a[0]=1;for(var x=0;x<p.length;x++)a[x+1]=parseInt(p[x],10);a[a.length-1]=255,i(null,Buffer.concat([a,c]))}Zf(n,!0,!0,o)}function vA(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],a;while(c.length>0){var x="",m=c[0]===0;for(a=1;;a++){if(c[a]===255)break;if(x.length>310)return o(Jo,0,1);x+=""+c[a]}c=c.slice(x.length+1);var l=parseInt(x,10),f=c.slice(1,l+1);if(m)f=d7(f);p.push(f),c=c.slice(l+1)}var v=p.length;for(a=0;a<v;a++){var $=p[a];o(tf($,i,!0),a,v)}}});var JA=h((cL,wA)=>{var Wp=1000,Kp=Wp*60,Xp=Kp*60,Uc=Xp*24,vK=Uc*7,$K=Uc*365.25;wA.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return TK(n);else if(o==="number"&&isFinite(n))return i.long?JK(n):wK(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function TK(n){if(n=String(n),n.length>100)return;var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!i)return;var o=parseFloat(i[1]),c=(i[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return o*$K;case"weeks":case"week":case"w":return o*vK;case"days":case"day":case"d":return o*Uc;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Xp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Kp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Wp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function wK(n){var i=Math.abs(n);if(i>=Uc)return Math.round(n/Uc)+"d";if(i>=Xp)return Math.round(n/Xp)+"h";if(i>=Kp)return Math.round(n/Kp)+"m";if(i>=Wp)return Math.round(n/Wp)+"s";return n+"ms"}function JK(n){var i=Math.abs(n);if(i>=Uc)return Fm(n,i,Uc,"day");if(i>=Xp)return Fm(n,i,Xp,"hour");if(i>=Kp)return Fm(n,i,Kp,"minute");if(i>=Wp)return Fm(n,i,Wp,"second");return n+" ms"}function Fm(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var Pf=h((pL,SA)=>{function SK(n){o.debug=o,o.default=o,o.coerce=l,o.disable=a,o.enable=p,o.enabled=x,o.humanize=JA(),o.destroy=f,Object.keys(n).forEach((v)=>{o[v]=n[v]}),o.names=[],o.skips=[],o.formatters={};function i(v){let $=0;for(let T=0;T<v.length;T++)$=($<<5)-$+v.charCodeAt(T),$|=0;return o.colors[Math.abs($)%o.colors.length]}o.selectColor=i;function o(v){let $,T=null,F,M;function A(...R){if(!A.enabled)return;let G=A,Q=Number(new Date),b=Q-($||Q);if(G.diff=b,G.prev=$,G.curr=Q,$=Q,R[0]=o.coerce(R[0]),typeof R[0]!=="string")R.unshift("%O");let D=0;R[0]=R[0].replace(/%([a-zA-Z%])/g,(K,E)=>{if(K==="%%")return"%";D++;let y=o.formatters[E];if(typeof y==="function"){let V=R[D];K=y.call(G,V),R.splice(D,1),D--}return K}),o.formatArgs.call(G,R),(G.log||o.log).apply(G,R)}if(A.namespace=v,A.useColors=o.useColors(),A.color=o.selectColor(v),A.extend=c,A.destroy=o.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(T!==null)return T;if(F!==o.namespaces)F=o.namespaces,M=o.enabled(v);return M},set:(R)=>{T=R}}),typeof o.init==="function")o.init(A);return A}function c(v,$){let T=o(this.namespace+(typeof $==="undefined"?":":$)+v);return T.log=this.log,T}function p(v){o.save(v),o.namespaces=v,o.names=[],o.skips=[];let $,T=(typeof v==="string"?v:"").split(/[\s,]+/),F=T.length;for($=0;$<F;$++){if(!T[$])continue;if(v=T[$].replace(/\*/g,".*?"),v[0]==="-")o.skips.push(new RegExp("^"+v.slice(1)+"$"));else o.names.push(new RegExp("^"+v+"$"))}}function a(){let v=[...o.names.map(m),...o.skips.map(m).map(($)=>"-"+$)].join(",");return o.enable(""),v}function x(v){if(v[v.length-1]==="*")return!0;let $,T;for($=0,T=o.skips.length;$<T;$++)if(o.skips[$].test(v))return!1;for($=0,T=o.names.length;$<T;$++)if(o.names[$].test(v))return!0;return!1}function m(v){return v.toString().substring(2,v.toString().length-2).replace(/\.\*\?$/,"*")}function l(v){if(v instanceof Error)return v.stack||v.message;return v}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}SA.exports=SK});var FA=h((AA,Rm)=>{AA.formatArgs=FK;AA.save=MK;AA.load=RK;AA.useColors=AK;AA.storage=WK();AA.destroy=(()=>{let n=!1;return()=>{if(!n)n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();AA.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function AK(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function FK(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Rm.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;n.splice(1,0,i,"color: inherit");let o=0,c=0;n[0].replace(/%[a-zA-Z%]/g,(p)=>{if(p==="%%")return;if(o++,p==="%c")c=o}),n.splice(c,0,i)}AA.log=console.debug||console.log||(()=>{});function MK(n){try{if(n)AA.storage.setItem("debug",n);else AA.storage.removeItem("debug")}catch(i){}}function RK(){let n;try{n=AA.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function WK(){try{return localStorage}catch(n){}}Rm.exports=Pf()(AA);var{formatters:KK}=Rm.exports;KK.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var RA=h((xL,MA)=>{MA.exports=(n,i)=>{i=i||process.argv;let o=n.startsWith("-")?"":n.length===1?"-":"--",c=i.indexOf(o+n),p=i.indexOf("--");return c!==-1&&(p===-1?!0:c<p)}});var KA=h((mL,WA)=>{var OK=import.meta.require("os"),So=RA(),Ri=process.env,Gp;if(So("no-color")||So("no-colors")||So("color=false"))Gp=!1;else if(So("color")||So("colors")||So("color=true")||So("color=always"))Gp=!0;if("FORCE_COLOR"in Ri)Gp=Ri.FORCE_COLOR.length===0||parseInt(Ri.FORCE_COLOR,10)!==0;function UK(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function VK(n){if(Gp===!1)return 0;if(So("color=16m")||So("color=full")||So("color=truecolor"))return 3;if(So("color=256"))return 2;if(n&&!n.isTTY&&Gp!==!0)return 0;let i=Gp?1:0;if(process.platform==="win32"){let o=OK.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(o[0])>=10&&Number(o[2])>=10586)return Number(o[2])>=14931?3:2;return 1}if("CI"in Ri){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((o)=>(o in Ri))||Ri.CI_NAME==="codeship")return 1;return i}if("TEAMCITY_VERSION"in Ri)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ri.TEAMCITY_VERSION)?1:0;if(Ri.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ri){let o=parseInt((Ri.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ri.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Ri.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ri.TERM))return 1;if("COLORTERM"in Ri)return 1;if(Ri.TERM==="dumb")return i;return i}function rf(n){let i=VK(n);return UK(i)}WA.exports={supportsColor:rf,stdout:rf(process.stdout),stderr:rf(process.stderr)}});var zA=h((GA,Km)=>{var uK=import.meta.require("tty"),Wm=import.meta.require("util");GA.init=NK;GA.log=yK;GA.formatArgs=bK;GA.save=BK;GA.load=LK;GA.useColors=_K;GA.destroy=Wm.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");GA.colors=[6,2,3,4,5,1];try{let n=KA();if(n&&(n.stderr||n).level>=2)GA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(n){}GA.inspectOpts=Object.keys(process.env).filter((n)=>{return/^debug_/i.test(n)}).reduce((n,i)=>{let o=i.substring(6).toLowerCase().replace(/_([a-z])/g,(p,a)=>{return a.toUpperCase()}),c=process.env[i];if(/^(yes|on|true|enabled)$/i.test(c))c=!0;else if(/^(no|off|false|disabled)$/i.test(c))c=!1;else if(c==="null")c=null;else c=Number(c);return n[o]=c,n},{});function _K(){return"colors"in GA.inspectOpts?Boolean(GA.inspectOpts.colors):uK.isatty(process.stderr.fd)}function bK(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),a=` ${p};1m${i} \x1B[0m`;n[0]=a+n[0].split("\n").join("\n"+a),n.push(p+"m+"+Km.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=jK()+i+" "+n[0]}function jK(){if(GA.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function yK(...n){return process.stderr.write(Wm.formatWithOptions(GA.inspectOpts,...n)+"\n")}function BK(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function LK(){return process.env.DEBUG}function NK(n){n.inspectOpts={};let i=Object.keys(GA.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=GA.inspectOpts[i[o]]}Km.exports=Pf()(GA);var{formatters:XA}=Km.exports;XA.o=function(n){return this.inspectOpts.colors=this.useColors,Wm.inspect(n,this.inspectOpts).split("\n").map((i)=>i.trim()).join(" ")};XA.O=function(n){return this.inspectOpts.colors=this.useColors,Wm.inspect(n,this.inspectOpts)}});var xi=h((fL,gf)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)gf.exports=FA();else gf.exports=zA()});var uc=h((EA)=>{Object.defineProperty(EA,"__esModule",{value:!0});EA.Transport=void 0;var tK=import.meta.require("events"),qK=_a(),PK=TA(),rK=xi(),QA=rK.default("engine:transport");function gK(){}class HA extends tK.EventEmitter{get readyState(){return this._readyState}set readyState(n){QA("readyState updated from %s to %s (%s)",this._readyState,n,this.name),this._readyState=n}constructor(n){super();this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=n._query.EIO==="4"?4:3,this.parser=this.protocol===4?qK:PK,this.supportsBinary=!(n._query&&n._query.b64)}discard(){this.discarded=!0}onRequest(n){}close(n){if(this.readyState==="closed"||this.readyState==="closing")return;this.readyState="closing",this.doClose(n||gK)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else QA("ignored transport error %s (%s)",n,i)}onPacket(n){this.emit("packet",n)}onData(n){this.onPacket(this.parser.decodePacket(n))}onClose(){this.readyState="closed",this.emit("close")}}EA.Transport=HA});var df=h((uA)=>{Object.defineProperty(uA,"__esModule",{value:!0});uA.Polling=void 0;var dK=uc(),UA=import.meta.require("zlib"),eK=fm(),n3=xi(),Ci=n3.default("engine:polling"),i3={gzip:UA.createGzip,deflate:UA.createDeflate};class VA extends dK.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.method==="GET")this.onPollRequest(n,i);else if(n.method==="POST")this.onDataRequest(n,i);else i.writeHead(500),i.end()}onPollRequest(n,i){if(this.req){Ci("request overlap"),this.onError("overlap from client"),i.writeHead(400),i.end();return}Ci("setting request"),this.req=n,this.res=i;let o=()=>{this.onError("poll connection closed prematurely")},c=()=>{n.removeListener("close",o),this.req=this.res=null};if(n.cleanup=c,n.on("close",o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)Ci("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeHead(400),i.end();return}let o=n.headers["content-type"]==="application/octet-stream";if(o&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let c=o?Buffer.concat([]):"",p=()=>{n.removeListener("data",x),n.removeListener("end",m),n.removeListener("close",a),this.dataReq=this.dataRes=c=null},a=()=>{p(),this.onError("data request connection closed prematurely")},x=(l)=>{let f;if(o)c=Buffer.concat([c,l]),f=c.length;else c+=l,f=Buffer.byteLength(c);if(f>this.maxHttpBufferSize)i.writeHead(413).end(),p()},m=()=>{this.onData(c);let l={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,l)),i.end("ok"),p()};if(n.on("close",a),!o)n.setEncoding("utf8");n.on("data",x),n.on("end",m)}onData(n){Ci('received "%s"',n);let i=(o)=>{if(o.type==="close")return Ci("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)Ci("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){Ci('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",a={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},x=(f)=>{a["Content-Length"]=typeof f==="string"?Buffer.byteLength(f):f.length,this.res.writeHead(200,this.headers(this.req,a)),this.res.end(f),o()};if(!this.httpCompression||!i.compress){x(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){x(n);return}let l=eK(this.req).encodings(["gzip","deflate"]);if(!l){x(n);return}this.compress(n,l,(f,v)=>{if(f){this.res.writeHead(500),this.res.end(),o(f);return}a["Content-Encoding"]=l,x(v)})}compress(n,i,o){Ci("compressing");let c=[],p=0;i3[i](this.httpCompression).on("error",o).on("data",function(a){c.push(a),p+=a.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){Ci("closing");let i;if(this.dataReq)Ci("aborting ongoing data request"),this.dataReq.destroy();let o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)Ci("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)Ci("transport discarded - closing right away"),o();else Ci("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i={}){let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}uA.Polling=VA});var BA=h((jA)=>{Object.defineProperty(jA,"__esModule",{value:!0});jA.JSONP=void 0;var o3=df(),c3=import.meta.require("querystring"),p3=/\\\\n/g,a3=/(\\)?\\n/g;class bA extends o3.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=c3.parse(n).d,typeof n==="string")n=n.replace(a3,function(i,o){return o?i:"\n"}),super.onData(n.replace(p3,"\\n"))}doWrite(n,i,o){let c=JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");n=this.head+c+this.foot,super.doWrite(n,i,o)}}jA.JSONP=bA});var hA=h((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});DA.WebSocket=void 0;var x3=uc(),m3=xi(),LA=m3.default("engine:ws");class NA extends x3.Transport{constructor(n){super(n);this._doSend=(i)=>{this.socket.send(i,this._onSent)},this._doSendLast=(i)=>{this.socket.send(i,this._onSentLast)},this._onSent=(i)=>{if(i)this.onError("write error",i.stack)},this._onSentLast=(i)=>{if(i)this.onError("write error",i.stack);else this.emit("drain"),this.writable=!0,this.emit("ready")},this.socket=n.websocket,this.socket.on("message",(i,o)=>{let c=o?i:i.toString();LA('received "%s"',c),super.onData(c)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length;if(this._canSendPreEncodedFrame(o))this.socket._sender.sendFrame(o.options.wsPreEncodedFrame,c?this._onSentLast:this._onSent);else this.parser.encodePacket(o,this.supportsBinary,c?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(n){var i,o,c;return!this.perMessageDeflate&&typeof((o=(i=this.socket)===null||i===void 0?void 0:i._sender)===null||o===void 0?void 0:o.sendFrame)==="function"&&((c=n.options)===null||c===void 0?void 0:c.wsPreEncodedFrame)!==void 0}doClose(n){LA("closing"),this.socket.close(),n&&n()}}DA.WebSocket=NA});var ef=h((kA)=>{Object.defineProperty(kA,"__esModule",{value:!0});kA.WebTransport=void 0;var l3=uc(),f3=xi(),v3=_a(),Yp=f3.default("engine:webtransport");class IA extends l3.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=v3.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{Yp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:a}=await o.read();if(a){Yp("session is closed");break}Yp("received chunk: %o",p),this.onPacket(p)}}catch(p){Yp("error while reading: %s",p.message)}})(),n.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(n){this.writable=!1;try{for(let i=0;i<n.length;i++){let o=n[i];await this.writer.write(o)}}catch(i){Yp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){Yp("closing WebTransport session"),this.session.close(),n&&n()}}kA.WebTransport=IA});var nv=h((tA)=>{Object.defineProperty(tA,"__esModule",{value:!0});var $3=df(),T3=BA(),w3=hA(),J3=ef();tA.default={polling:ZA,websocket:w3.WebSocket,webtransport:J3.WebTransport};function ZA(n){if(typeof n._query.j==="string")return new T3.JSONP(n);else return new $3.Polling(n)}ZA.upgradesTo=["websocket","webtransport"]});var iv=h((PA)=>{Object.defineProperty(PA,"__esModule",{value:!0});PA.Socket=void 0;var A3=import.meta.require("events"),F3=xi(),Lo=import.meta.require("timers"),qn=F3.default("engine:socket");class qA extends A3.EventEmitter{get readyState(){return this._readyState}set readyState(n){qn("readyState updated from %s to %s",this._readyState,n),this._readyState=n}constructor(n,i,o,c,p){super();if(this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=n,this.server=i,this.request=c,this.protocol=p,c)if(c.websocket&&c.websocket._socket)this.remoteAddress=c.websocket._socket.remoteAddress;else this.remoteAddress=c.connection.remoteAddress;this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(o),this.onOpen()}onOpen(){if(this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket)this.sendPacket("message",this.server.opts.initialPacket);if(this.emit("open"),this.protocol===3)this.resetPingTimeout();else this.schedulePing()}onPacket(n){if(this.readyState!=="open")return qn("packet received with closed socket");switch(qn(`received packet ${n.type}`),this.emit("packet",n),n.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}qn("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}qn("got pong"),Lo.clearTimeout(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",n.data),this.emit("message",n.data);break}}onError(n){qn("transport error"),this.onClose("transport error",n)}schedulePing(){this.pingIntervalTimer=Lo.setTimeout(()=>{qn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){Lo.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=Lo.setTimeout(()=>{if(this.readyState==="closed")return;this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(n){let i=this.onError.bind(this),o=()=>this.flush(),c=this.onPacket.bind(this),p=this.onDrain.bind(this),a=this.onClose.bind(this,"transport close");this.transport=n,this.transport.once("error",i),this.transport.on("ready",o),this.transport.on("packet",c),this.transport.on("drain",p),this.transport.once("close",a),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",a)})}onDrain(){if(this.sentCallbackFn.length>0){qn("executing batch send callback");let n=this.sentCallbackFn.shift();if(n)for(let i=0;i<n.length;i++)n[i](this.transport)}}_maybeUpgrade(n){qn('might upgrade socket transport from "%s" to "%s"',this.transport.name,n.name),this.upgrading=!0;let i=Lo.setTimeout(()=>{if(qn("client did not complete upgrade - closing transport"),a(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(f)=>{if(f.type==="ping"&&f.data==="probe")qn("got probe ping packet, sending pong"),n.send([{type:"pong",data:"probe"}]),this.emit("upgrading",n),clearInterval(o),o=setInterval(p,100);else if(f.type==="upgrade"&&this.readyState!=="closed"){if(qn("got upgrade packet - upgrading"),a(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(n),this.emit("upgrade",n),this.flush(),this.readyState==="closing")n.close(()=>{this.onClose("forced close")})}else a(),n.close()},p=()=>{if(this.transport.name==="polling"&&this.transport.writable)qn("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}])},a=()=>{this.upgrading=!1,clearInterval(o),Lo.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",m),n.removeListener("error",x),this.removeListener("close",l)},x=(f)=>{qn("client did not complete upgrade - %s",f),a(),n.close(),n=null},m=()=>{x("transport closed")},l=()=>{x("socket closed")};n.on("packet",c),n.once("close",m),n.once("error",x),this.once("close",l)}clearTransport(){let n,i=this.cleanupFn.length;for(let o=0;o<i;o++)n=this.cleanupFn.shift(),n();this.transport.on("error",function(){qn("error triggered by discarded transport")}),this.transport.close(),Lo.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",Lo.clearTimeout(this.pingIntervalTimer),Lo.clearTimeout(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",n,i)}send(n,i,o){return this.sendPacket("message",n,i,o),this}write(n,i,o){return this.sendPacket("message",n,i,o),this}sendPacket(n,i,o={},c){if(typeof o==="function")c=o,o={};if(this.readyState!=="closing"&&this.readyState!=="closed"){qn('sending packet "%s" (%s)',n,i),o.compress=o.compress!==!1;let p={type:n,options:o};if(i)p.data=i;if(this.emit("packetCreate",p),this.writeBuffer.push(p),typeof c==="function")this.packetsFn.push(c);this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){qn("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let n=this.writeBuffer;if(this.writeBuffer=[],this.packetsFn.length)this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[];else this.sentCallbackFn.push(null);this.transport.send(n),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let n=[],i=this.server.upgrades(this.transport.name);for(let o=0;o<i.length;++o){let c=i[o];if(this.server.opts.transports.indexOf(c)!==-1)n.push(c)}return n}close(n){if(n&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(n);if(this.readyState!=="open")return;if(this.readyState="closing",this.writeBuffer.length){qn("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{qn("all packets have been sent, closing the transport"),this.closeTransport(n)});return}qn("the buffer is empty, closing the transport right away"),this.closeTransport(n)}closeTransport(n){if(qn("closing the transport (discard? %s)",!!n),n)this.transport.discard();this.transport.close(this.onClose.bind(this,"forced close"))}}PA.Socket=qA});var gA=h((G3)=>{/*!
29
29
  * cookie
30
30
  * Copyright(c) 2012-2014 Roman Shtylman
31
31
  * Copyright(c) 2015 Douglas Christopher Wilson
32
32
  * MIT Licensed
33
- */v3.parse=l3;v3.serialize=f3;var m3=decodeURIComponent,x3=encodeURIComponent,Rx=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function l3(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=i||{},p=n.split(";"),a=c.decode||m3;for(var m=0;m<p.length;m++){var x=p[m],l=x.indexOf("=");if(l<0)continue;var f=x.substring(0,l).trim();if(o[f]==null){var $=x.substring(l+1,x.length).trim();if($[0]==='"')$=$.slice(1,-1);o[f]=$3($,a)}}return o}function f3(n,i,o){var c=o||{},p=c.encode||x3;if(typeof p!=="function")throw new TypeError("option encode is invalid");if(!Rx.test(n))throw new TypeError("argument name is invalid");var a=p(i);if(a&&!Rx.test(a))throw new TypeError("argument val is invalid");var m=n+"="+a;if(c.maxAge!=null){var x=c.maxAge-0;if(isNaN(x)||!isFinite(x))throw new TypeError("option maxAge is invalid");m+="; Max-Age="+Math.floor(x)}if(c.domain){if(!Rx.test(c.domain))throw new TypeError("option domain is invalid");m+="; Domain="+c.domain}if(c.path){if(!Rx.test(c.path))throw new TypeError("option path is invalid");m+="; Path="+c.path}if(c.expires){if(typeof c.expires.toUTCString!=="function")throw new TypeError("option expires is invalid");m+="; Expires="+c.expires.toUTCString()}if(c.httpOnly)m+="; HttpOnly";if(c.secure)m+="; Secure";if(c.sameSite){var l=typeof c.sameSite==="string"?c.sameSite.toLowerCase():c.sameSite;switch(l){case!0:m+="; SameSite=Strict";break;case"lax":m+="; SameSite=Lax";break;case"strict":m+="; SameSite=Strict";break;case"none":m+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return m}function $3(n,i){try{return i(n)}catch(o){return n}}});var IJ=h((tj,hJ)=>{var DJ=Object.getOwnPropertySymbols,S3=Object.prototype.hasOwnProperty,A3=Object.prototype.propertyIsEnumerable;function J3(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function F3(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;var i={};for(var o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(a){return i[a]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(a){p[a]=a}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(a){return!1}}hJ.exports=F3()?Object.assign:function(n,i){var o,c=J3(n),p;for(var a=1;a<arguments.length;a++){o=Object(arguments[a]);for(var m in o)if(S3.call(o,m))c[m]=o[m];if(DJ){p=DJ(o);for(var x=0;x<p.length;x++)if(A3.call(o,p[x]))c[p[x]]=o[p[x]]}}return c}});var rJ=h((Dj,Pf)=>{/*!
33
+ */G3.parse=W3;G3.serialize=K3;var M3=decodeURIComponent,R3=encodeURIComponent,Xm=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function W3(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=i||{},p=n.split(";"),a=c.decode||M3;for(var x=0;x<p.length;x++){var m=p[x],l=m.indexOf("=");if(l<0)continue;var f=m.substring(0,l).trim();if(o[f]==null){var v=m.substring(l+1,m.length).trim();if(v[0]==='"')v=v.slice(1,-1);o[f]=X3(v,a)}}return o}function K3(n,i,o){var c=o||{},p=c.encode||R3;if(typeof p!=="function")throw new TypeError("option encode is invalid");if(!Xm.test(n))throw new TypeError("argument name is invalid");var a=p(i);if(a&&!Xm.test(a))throw new TypeError("argument val is invalid");var x=n+"="+a;if(c.maxAge!=null){var m=c.maxAge-0;if(isNaN(m)||!isFinite(m))throw new TypeError("option maxAge is invalid");x+="; Max-Age="+Math.floor(m)}if(c.domain){if(!Xm.test(c.domain))throw new TypeError("option domain is invalid");x+="; Domain="+c.domain}if(c.path){if(!Xm.test(c.path))throw new TypeError("option path is invalid");x+="; Path="+c.path}if(c.expires){if(typeof c.expires.toUTCString!=="function")throw new TypeError("option expires is invalid");x+="; Expires="+c.expires.toUTCString()}if(c.httpOnly)x+="; HttpOnly";if(c.secure)x+="; Secure";if(c.sameSite){var l=typeof c.sameSite==="string"?c.sameSite.toLowerCase():c.sameSite;switch(l){case!0:x+="; SameSite=Strict";break;case"lax":x+="; SameSite=Lax";break;case"strict":x+="; SameSite=Strict";break;case"none":x+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return x}function X3(n,i){try{return i(n)}catch(o){return n}}});var nF=h((ML,eA)=>{var dA=Object.getOwnPropertySymbols,Q3=Object.prototype.hasOwnProperty,H3=Object.prototype.propertyIsEnumerable;function E3(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function O3(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;var i={};for(var o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(a){return i[a]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(a){p[a]=a}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(a){return!1}}eA.exports=O3()?Object.assign:function(n,i){var o,c=E3(n),p;for(var a=1;a<arguments.length;a++){o=Object(arguments[a]);for(var x in o)if(Q3.call(o,x))c[x]=o[x];if(dA){p=dA(o);for(var m=0;m<p.length;m++)if(H3.call(o,p[m]))c[p[m]]=o[p[m]]}}return c}});var cF=h((RL,ov)=>{/*!
34
34
  * vary
35
35
  * Copyright(c) 2014-2017 Douglas Christopher Wilson
36
36
  * MIT Licensed
37
- */Pf.exports=M3;Pf.exports.append=kJ;var R3=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function kJ(n,i){if(typeof n!=="string")throw new TypeError("header argument is required");if(!i)throw new TypeError("field argument is required");var o=!Array.isArray(i)?CJ(String(i)):i;for(var c=0;c<o.length;c++)if(!R3.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,a=CJ(n.toLowerCase());if(o.indexOf("*")!==-1||a.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var x=o[m].toLowerCase();if(a.indexOf(x)===-1)a.push(x),p=p?p+", "+o[m]:o[m]}return p}function CJ(n){var i=0,o=[],c=0;for(var p=0,a=n.length;p<a;p++)switch(n.charCodeAt(p)){case 32:if(c===i)c=i=p+1;break;case 44:o.push(n.substring(c,i)),c=i=p+1;break;default:i=p+1;break}return o.push(n.substring(c,i)),o}function M3(n,i){if(!n||!n.getHeader||!n.setHeader)throw new TypeError("res argument is required");var o=n.getHeader("Vary")||"",c=Array.isArray(o)?o.join(", "):String(o);if(o=kJ(c,i))n.setHeader("Vary",o)}});var gf=h((hj,ZJ)=>{(function(){var n=IJ(),i=rJ(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(M){return typeof M==="string"||M instanceof String}function p(M,J){if(Array.isArray(J)){for(var X=0;X<J.length;++X)if(p(M,J[X]))return!0;return!1}else if(c(J))return M===J;else if(J instanceof RegExp)return J.test(M);else return!!J}function a(M,J){var X=J.headers.origin,G=[],u;if(!M.origin||M.origin==="*")G.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(M.origin))G.push([{key:"Access-Control-Allow-Origin",value:M.origin}]),G.push([{key:"Vary",value:"Origin"}]);else u=p(X,M.origin),G.push([{key:"Access-Control-Allow-Origin",value:u?X:!1}]),G.push([{key:"Vary",value:"Origin"}]);return G}function m(M){var J=M.methods;if(J.join)J=M.methods.join(",");return{key:"Access-Control-Allow-Methods",value:J}}function x(M){if(M.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function l(M,J){var X=M.allowedHeaders||M.headers,G=[];if(!X)X=J.headers["access-control-request-headers"],G.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(X.join)X=X.join(",");if(X&&X.length)G.push([{key:"Access-Control-Allow-Headers",value:X}]);return G}function f(M){var J=M.exposedHeaders;if(!J)return null;else if(J.join)J=J.join(",");if(J&&J.length)return{key:"Access-Control-Expose-Headers",value:J};return null}function $(M){var J=(typeof M.maxAge==="number"||M.maxAge)&&M.maxAge.toString();if(J&&J.length)return{key:"Access-Control-Max-Age",value:J};return null}function v(M,J){for(var X=0,G=M.length;X<G;X++){var u=M[X];if(u){if(Array.isArray(u))v(u,J);else if(u.key==="Vary"&&u.value)i(J,u.value);else if(u.value)J.setHeader(u.key,u.value)}}}function w(M,J,X,G){var u=[],Q=J.method&&J.method.toUpperCase&&J.method.toUpperCase();if(Q==="OPTIONS")if(u.push(a(M,J)),u.push(x(M,J)),u.push(m(M,J)),u.push(l(M,J)),u.push($(M,J)),u.push(f(M,J)),v(u,X),M.preflightContinue)G();else X.statusCode=M.optionsSuccessStatus,X.setHeader("Content-Length","0"),X.end();else u.push(a(M,J)),u.push(x(M,J)),u.push(f(M,J)),v(u,X),G()}function F(M){var J=null;if(typeof M==="function")J=M;else J=function(X,G){G(null,M)};return function X(G,u,Q){J(G,function(V,z){if(V)Q(V);else{var R=n({},o,z),O=null;if(R.origin&&typeof R.origin==="function")O=R.origin;else if(R.origin)O=function(b,H){H(null,R.origin)};if(O)O(G.headers.origin,function(b,H){if(b||!H)Q(b);else R.origin=H,w(R,G,u,Q)});else Q()}})}}ZJ.exports=F})()});var df=h((iF)=>{Object.defineProperty(iF,"__esModule",{value:!0});iF.Server=iF.BaseServer=void 0;var K3=import.meta.require("querystring"),W3=import.meta.require("url"),qJ=Vf(),Mx=qf(),X3=import.meta.require("events"),eJ=ef(),G3=mi(),z3=tJ(),u3=import.meta.require("ws"),PJ=Zf(),Y3=Qa(),vn=G3.default("engine"),Xp=Symbol("responseHeaders");function O3(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class Ua extends X3.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:u3.Server,pingTimeout:20000,pingInterval:25000,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},n),n.cookie)this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:n.cookie.path!==!1,sameSite:"lax"},n.cookie);if(this.opts.cors)this.use(gf()(this.opts.cors));if(n.perMessageDeflate)this.opts.perMessageDeflate=Object.assign({threshold:1024},n.perMessageDeflate);this.init()}_computePath(n){let i=(n.path||"/engine.io").replace(/\/$/,"");if(n.addTrailingSlash!==!1)i+="/";return i}upgrades(n){if(!this.opts.allowUpgrades)return[];return Mx.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return vn('unknown transport "%s"',c),o(Hn.errors.UNKNOWN_TRANSPORT,{transport:c});if(H3(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,vn("origin header invalid"),o(Hn.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:m})}let a=n._query.sid;if(a){if(!this.clients.hasOwnProperty(a))return vn('unknown sid "%s"',a),o(Hn.errors.UNKNOWN_SID,{sid:a});let m=this.clients[a].transport.name;if(!i&&m!==c)return vn("bad request: unexpected transport without upgrade"),o(Hn.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:m})}else{if(n.method!=="GET")return o(Hn.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return vn("invalid transport upgrade"),o(Hn.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,x)=>{if(!x)return o(Hn.errors.FORBIDDEN,{message:m});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return vn("no middleware to apply, skipping"),o();let c=(p)=>{vn("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(a)=>{if(a)return o(a);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){vn("closing all open clients");for(let n in this.clients)if(this.clients.hasOwnProperty(n))this.clients[n].close(!0);return this.cleanup(),this}generateId(n){return qJ.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){vn("unsupported protocol version"),this.emit("connection_error",{req:i,code:Hn.errors.UNSUPPORTED_PROTOCOL_VERSION,message:Hn.errorMessages[Hn.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(Hn.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(x){vn("error while generating an id"),this.emit("connection_error",{req:i,code:Hn.errors.BAD_REQUEST,message:Hn.errorMessages[Hn.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:x}}),o(Hn.errors.BAD_REQUEST);return}vn('handshaking client "%s"',p);try{var a=this.createTransport(n,i);if(n==="polling")a.maxHttpBufferSize=this.opts.maxHttpBufferSize,a.httpCompression=this.opts.httpCompression;else if(n==="websocket")a.perMessageDeflate=this.opts.perMessageDeflate}catch(x){vn('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:Hn.errors.BAD_REQUEST,message:Hn.errorMessages[Hn.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:x}}),o(Hn.errors.BAD_REQUEST);return}let m=new eJ.Socket(p,this,a,i,c);return a.on("headers",(x,l)=>{if(!l._query.sid){if(this.opts.cookie)x["Set-Cookie"]=[z3.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",x,l)}this.emit("headers",x,l)}),a.onRequest(i),this.clients[p]=m,this.clientsCount++,m.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",m),a}async onWebTransportSession(n){let i=setTimeout(()=>{vn("the client failed to establish a bidirectional stream in the given period"),n.close()},this.opts.upgradeTimeout),c=await n.incomingBidirectionalStreams.getReader().read();if(c.done){vn("session is closed");return}let p=c.value,a=Y3.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(a).getReader(),{value:x,done:l}=await m.read();if(l){vn("stream is closed");return}if(clearTimeout(i),x.type!=="open")return vn("invalid WebTransport handshake"),n.close();if(x.data===void 0){let v=new PJ.WebTransport(n,p,m),w=qJ.generateId();vn('handshaking client "%s" (WebTransport)',w);let F=new eJ.Socket(w,this,v,null,4);this.clients[w]=F,this.clientsCount++,F.once("close",()=>{delete this.clients[w],this.clientsCount--}),this.emit("connection",F);return}let f=O3(x.data);if(!f)return vn("invalid WebTransport handshake"),n.close();let $=this.clients[f];if(!$)vn("upgrade attempt for closed client"),n.close();else if($.upgrading)vn("transport has already been trying to upgrade"),n.close();else if($.upgraded)vn("transport had already been upgraded"),n.close();else{vn("upgrading existing transport");let v=new PJ.WebTransport(n,p,m);$._maybeUpgrade(v)}}}iF.BaseServer=Ua;Ua.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};Ua.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class nF{constructor(n,i){this.req=n,this.socket=i,n[Xp]={}}setHeader(n,i){this.req[Xp][n]=i}getHeader(n){return this.req[Xp][n]}removeHeader(n){delete this.req[Xp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class Hn extends Ua{init(){if(!~this.opts.transports.indexOf("websocket"))return;if(this.ws)this.ws.close();if(this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on==="function")this.ws.on("headers",(n,i)=>{let o=i[Xp]||{};if(delete i[Xp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),vn("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)vn("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?K3.parse(W3.parse(n.url).query):{}}createTransport(n,i){return new Mx.default[n](i)}handleRequest(n,i){vn('handling "%s" http request "%s"',n.method,n.url),this.prepare(n),n.res=i;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:n,code:c,message:Hn.errorMessages[c],context:p}),gJ(i,c,p);return}if(n._query.sid)vn("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let a=(m,x)=>gJ(i,m,x);this.handshake(n._query.transport,n,a)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(Hn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new nF(n,i),p=(a,m)=>{if(a!==void 0){this.emit("connection_error",{req:n,code:a,message:Hn.errorMessages[a],context:m}),dJ(i,a,m);return}let x=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,x,(l)=>{this.onWebSocket(n,i,l)})};this._applyMiddlewares(n,c,(a)=>{if(a)p(Hn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Mx.default[n._query.transport]!==void 0&&!Mx.default[n._query.transport].prototype.handlesUpgrades){vn("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let a=this.clients[c];if(!a)vn("upgrade attempt for closed client"),o.close();else if(a.upgrading)vn("transport has already been trying to upgrade"),o.close();else if(a.upgraded)vn("transport had already been upgraded"),o.close();else{vn("upgrading existing transport"),o.removeListener("error",p);let m=this.createTransport(n._query.transport,n);m.perMessageDeflate=this.opts.perMessageDeflate,a._maybeUpgrade(m)}}else{let a=(m,x)=>dJ(i,m,x);this.handshake(n._query.transport,n,a)}function p(){vn("websocket error before upgrade")}}attach(n,i={}){let o=this._computePath(i),c=i.destroyUpgradeTimeout||1000;function p(m){return o===m.url.slice(0,o.length)}let a=n.listeners("request").slice(0);if(n.removeAllListeners("request"),n.on("close",this.close.bind(this)),n.on("listening",this.init.bind(this)),n.on("request",(m,x)=>{if(p(m))vn('intercepting request for path "%s"',o),this.handleRequest(m,x);else{let l=0,f=a.length;for(;l<f;l++)a[l].call(n,m,x)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,x,l)=>{if(p(m))this.handleUpgrade(m,x,l);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(x.writable&&x.bytesWritten<=0)return x.on("error",(f)=>{vn("error while destroying upgrade: %s",f.message)}),x.end()},c)})}}iF.Server=Hn;function gJ(n,i,o){let c=i===Hn.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:Hn.errorMessages[i];n.writeHead(c,{"Content-Type":"application/json"}),n.end(JSON.stringify({code:i,message:p}))}function dJ(n,i,o={}){if(n.on("error",()=>{vn("ignoring error from closed connection")}),n.writable){let c=o.message||Hn.errorMessages[i],p=Buffer.byteLength(c);n.write("HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-type: text/html\r\nContent-Length: "+p+"\r\n\r\n"+c)}n.destroy()}var sa=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function H3(n){if(n+="",n.length<1)return!1;if(!sa[n.charCodeAt(0)])return vn('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!sa[n.charCodeAt(1)])return vn('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!sa[n.charCodeAt(2)])return vn('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!sa[n.charCodeAt(3)])return vn('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!sa[n.charCodeAt(i)])return vn('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var xF=h((aF)=>{Object.defineProperty(aF,"__esModule",{value:!0});aF.Polling=void 0;var Q3=Uc(),cF=import.meta.require("zlib"),s3=ax(),U3=mi(),no=U3.default("engine:polling"),b3={gzip:cF.createGzip,deflate:cF.createDeflate};class pF extends Q3.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.getMethod()==="get")this.onPollRequest(n,i);else if(n.getMethod()==="post")this.onDataRequest(n,i);else i.writeStatus("500 Internal Server Error"),i.end()}onPollRequest(n,i){if(this.req){no("request overlap"),this.onError("overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}no("setting request"),this.req=n,this.res=i;let o=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},c=()=>{this.req=this.res=null};if(n.cleanup=c,i.onAborted(o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)no("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}let o=Number(n.headers["content-length"]);if(!o){this.onError("content-length header required"),i.writeStatus("411 Length Required").end();return}if(o>this.maxHttpBufferSize){this.onError("payload too large"),i.writeStatus("413 Payload Too Large").end();return}if(n.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let p,a=0,m={"Content-Type":"text/html"};this.headers(n,m);for(let l in m)i.writeHeader(l,String(m[l]));let x=(l)=>{this.onData(l.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((l,f)=>{let $=a+l.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(f){x(Buffer.from(l));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(l).copy(p,a),f){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}x(p);return}a=$})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(n){no('received "%s"',n);let i=(o)=>{if(o.type==="close")return no("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)no("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){no('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",a={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(f)=>{this.headers(this.req,a),this.res.cork(()=>{Object.keys(a).forEach(($)=>{this.res.writeHeader($,String(a[$]))}),this.res.end(f)}),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let l=s3(this.req).encodings(["gzip","deflate"]);if(!l){m(n);return}this.compress(n,l,(f,$)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(f);return}a["Content-Encoding"]=l,m($)})}compress(n,i,o){no("compressing");let c=[],p=0;b3[i](this.httpCompression).on("error",o).on("data",function(a){c.push(a),p+=a.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){no("closing");let i,o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)no("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)no("transport discarded - closing right away"),o();else no("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i){i=i||{};let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}aF.Polling=pF});var TF=h(($F)=>{Object.defineProperty($F,"__esModule",{value:!0});$F.WebSocket=void 0;var V3=Uc(),_3=mi(),lF=_3.default("engine:ws");class fF extends V3.Transport{constructor(n){super(n);this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length,p=(a)=>{let m=typeof a!=="string",x=this.perMessageDeflate&&Buffer.byteLength(a)>this.perMessageDeflate.threshold;if(lF('writing "%s"',a),this.socket.send(a,m,x),c)this.emit("drain"),this.writable=!0,this.emit("ready")};if(o.options&&typeof o.options.wsPreEncoded==="string")p(o.options.wsPreEncoded);else this.parser.encodePacket(o,this.supportsBinary,p)}}doClose(n){lF("closing"),n&&n(),this.socket.end()}}$F.WebSocket=fF});var SF=h((wF)=>{Object.defineProperty(wF,"__esModule",{value:!0});var y3=xF(),j3=TF();wF.default={polling:y3.Polling,websocket:j3.WebSocket}});var MF=h((FF)=>{Object.defineProperty(FF,"__esModule",{value:!0});FF.uServer=void 0;var N3=mi(),bc=df(),L3=SF(),fc=N3.default("engine:uws");class AF extends bc.BaseServer{init(){}cleanup(){}prepare(n,i){n.method=n.getMethod().toUpperCase(),n.url=n.getUrl();let o=new URLSearchParams(n.getQuery());n._query=Object.fromEntries(o.entries()),n.headers={},n.forEach((c,p)=>{n.headers[c]=p}),n.connection={remoteAddress:Buffer.from(i.getRemoteAddressAsText()).toString()},i.onAborted(()=>{fc("response has been aborted")})}createTransport(n,i){return new L3.default[n](i)}attach(n,i={}){let o=this._computePath(i);n.any(o,this.handleRequest.bind(this)).ws(o,{compression:i.compression,idleTimeout:i.idleTimeout,maxBackpressure:i.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:(c)=>{let p=c.getUserData().transport;p.socket=c,p.writable=!0,p.emit("ready")},message:(c,p,a)=>{c.getUserData().transport.onData(a?p:Buffer.from(p).toString())},close:(c,p,a)=>{c.getUserData().transport.onClose(p,a)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new JF(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){fc('handling "%s" http request "%s"',i.getMethod(),i.getUrl()),this.prepare(i,n),i.res=n;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:i,code:c,message:bc.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)fc("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let a=(m,x)=>this.abortRequest(n,m,x);this.handshake(i._query.transport,i,a)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){fc("on upgrade"),this.prepare(i,n),i.res=n;let c=async(p,a)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:bc.Server.errorMessages[p],context:a}),this.abortRequest(n,p,a);return}let m=i._query.sid,x;if(m){let l=this.clients[m];if(!l)return fc("upgrade attempt for closed client"),n.close();else if(l.upgrading)return fc("transport has already been trying to upgrade"),n.close();else if(l.upgraded)return fc("transport had already been upgraded"),n.close();else fc("upgrading existing transport"),x=this.createTransport(i._query.transport,i),l._maybeUpgrade(x)}else if(x=await this.handshake(i._query.transport,i,(l,f)=>this.abortRequest(n,l,f)),!x)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:x},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===bc.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:bc.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}FF.uServer=AF;class JF{constructor(n){this.res=n,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(n){if(!n)return;this.writeStatus(n===200?"200 OK":"204 No Content")}writeHead(n){this.statusCode=n}setHeader(n,i){if(Array.isArray(i))i.forEach((o)=>{this.writeHeader(n,o)});else this.writeHeader(n,i)}removeHeader(){}getHeader(){}writeStatus(n){if(this.isAborted)return;return this.res.writeStatus(n),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(n,i){if(this.isAborted)return;if(n==="Content-Length")return;if(this.statusWritten)this.res.writeHeader(n,i);else this.headers.push([n,i])}writeBufferedHeaders(){this.headers.forEach(([n,i])=>{this.res.writeHeader(n,i)})}end(n){if(this.isAborted)return;this.res.cork(()=>{if(!this.statusWritten)this.writeBufferedHeaders();this.res.end(n)})}onData(n){if(this.isAborted)return;this.res.onData(n)}onAborted(n){if(this.isAborted)return;this.res.onAborted(()=>{this.isAborted=!0,n()})}cork(n){if(this.isAborted)return;this.res.cork(n)}}});var zF=h((Gp)=>{Object.defineProperty(Gp,"__esModule",{value:!0});Gp.protocol=Gp.Transport=Gp.Socket=Gp.uServer=Gp.parser=Gp.transports=Gp.Server=void 0;Gp.listen=k3;Gp.attach=XF;var t3=import.meta.require("http"),KF=df();Object.defineProperty(Gp,"Server",{enumerable:!0,get:function(){return KF.Server}});var D3=qf();Gp.transports=D3.default;var WF=Qa();Gp.parser=WF;var h3=MF();Object.defineProperty(Gp,"uServer",{enumerable:!0,get:function(){return h3.uServer}});var I3=ef();Object.defineProperty(Gp,"Socket",{enumerable:!0,get:function(){return I3.Socket}});var C3=Uc();Object.defineProperty(Gp,"Transport",{enumerable:!0,get:function(){return C3.Transport}});Gp.protocol=WF.protocol;function k3(n,i,o){if(typeof i==="function")o=i,i={};let c=t3.createServer(function(a,m){m.writeHead(501),m.end("Not Implemented")}),p=XF(c,i);return p.httpServer=c,c.listen(n,o),p}function XF(n,i){let o=new KF.Server(i);return o.attach(n,i),o}});var uF=h((g3)=>{g3.Emitter=Oi;function Oi(n){if(n)return P3(n)}function P3(n){for(var i in Oi.prototype)n[i]=Oi.prototype[i];return n}Oi.prototype.on=Oi.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Oi.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this};Oi.prototype.off=Oi.prototype.removeListener=Oi.prototype.removeAllListeners=Oi.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+n];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;var c;for(var p=0;p<o.length;p++)if(c=o[p],c===i||c.fn===i){o.splice(p,1);break}if(o.length===0)delete this._callbacks["$"+n];return this};Oi.prototype.emit=function(n){this._callbacks=this._callbacks||{};var i=new Array(arguments.length-1),o=this._callbacks["$"+n];for(var c=1;c<arguments.length;c++)i[c-1]=arguments[c];if(o){o=o.slice(0);for(var c=0,p=o.length;c<p;++c)o[c].apply(this,i)}return this};Oi.prototype.emitReserved=Oi.prototype.emit;Oi.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Oi.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var n$=h((HF)=>{Object.defineProperty(HF,"__esModule",{value:!0});HF.hasBinary=HF.isBinary=void 0;var nX=typeof ArrayBuffer==="function",iX=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},YF=Object.prototype.toString,oX=typeof Blob==="function"||typeof Blob!=="undefined"&&YF.call(Blob)==="[object BlobConstructor]",cX=typeof File==="function"||typeof File!=="undefined"&&YF.call(File)==="[object FileConstructor]";function OF(n){return nX&&(n instanceof ArrayBuffer||iX(n))||oX&&n instanceof Blob||cX&&n instanceof File}HF.isBinary=OF;function Kx(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Kx(n[o]))return!0;return!1}if(OF(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Kx(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Kx(n[o]))return!0;return!1}HF.hasBinary=Kx});var UF=h((QF)=>{Object.defineProperty(QF,"__esModule",{value:!0});QF.reconstructPacket=QF.deconstructPacket=void 0;var aX=n$();function mX(n){let i=[],o=n.data,c=n;return c.data=i$(o,i),c.attachments=i.length,{packet:c,buffers:i}}QF.deconstructPacket=mX;function i$(n,i){if(!n)return n;if(aX.isBinary(n)){let o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){let o=new Array(n.length);for(let c=0;c<n.length;c++)o[c]=i$(n[c],i);return o}else if(typeof n==="object"&&!(n instanceof Date)){let o={};for(let c in n)if(Object.prototype.hasOwnProperty.call(n,c))o[c]=i$(n[c],i);return o}return n}function xX(n,i){return n.data=o$(n.data,i),delete n.attachments,n}QF.reconstructPacket=xX;function o$(n,i){if(!n)return n;if(n&&n._placeholder===!0)if(typeof n.num==="number"&&n.num>=0&&n.num<i.length)return i[n.num];else throw new Error("illegal attachments");else if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=o$(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=o$(n[o],i)}return n}});var ba=h((NF)=>{Object.defineProperty(NF,"__esModule",{value:!0});NF.Decoder=NF.Encoder=NF.PacketType=NF.protocol=void 0;var fX=uF(),_F=UF(),yF=n$(),$X=mi(),c$=$X.default("socket.io-parser"),vX=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];NF.protocol=5;var Cn;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Cn=NF.PacketType||(NF.PacketType={}));class jF{constructor(n){this.replacer=n}encode(n){if(c$("encoding packet %j",n),n.type===Cn.EVENT||n.type===Cn.ACK){if(yF.hasBinary(n))return this.encodeAsBinary({type:n.type===Cn.EVENT?Cn.BINARY_EVENT:Cn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===Cn.BINARY_EVENT||n.type===Cn.BINARY_ACK)i+=n.attachments+"-";if(n.nsp&&n.nsp!=="/")i+=n.nsp+",";if(n.id!=null)i+=n.id;if(n.data!=null)i+=JSON.stringify(n.data,this.replacer);return c$("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=_F.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}NF.Encoder=jF;function bF(n){return Object.prototype.toString.call(n)==="[object Object]"}class p$ extends fX.Emitter{constructor(n){super();this.reviver=n}add(n){let i;if(typeof n==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);let o=i.type===Cn.BINARY_EVENT;if(o||i.type===Cn.BINARY_ACK){if(i.type=o?Cn.EVENT:Cn.ACK,this.reconstructor=new BF(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(yF.isBinary(n)||n.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(i=this.reconstructor.takeBinaryData(n),i)this.reconstructor=null,super.emitReserved("decoded",i)}else throw new Error("Unknown type: "+n)}decodeString(n){let i=0,o={type:Number(n.charAt(0))};if(Cn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Cn.BINARY_EVENT||o.type===Cn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let a=n.substring(p,i);if(a!=Number(a)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(a)}if(n.charAt(i+1)==="/"){let p=i+1;while(++i){if(n.charAt(i)===",")break;if(i===n.length)break}o.nsp=n.substring(p,i)}else o.nsp="/";let c=n.charAt(i+1);if(c!==""&&Number(c)==c){let p=i+1;while(++i){let a=n.charAt(i);if(a==null||Number(a)!=a){--i;break}if(i===n.length)break}o.id=Number(n.substring(p,i+1))}if(n.charAt(++i)){let p=this.tryParse(n.substr(i));if(p$.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return c$("decoded %s as %j",n,o),o}tryParse(n){try{return JSON.parse(n,this.reviver)}catch(i){return!1}}static isPayloadValid(n,i){switch(n){case Cn.CONNECT:return bF(i);case Cn.DISCONNECT:return i===void 0;case Cn.CONNECT_ERROR:return typeof i==="string"||bF(i);case Cn.EVENT:case Cn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&vX.indexOf(i[0])===-1);case Cn.ACK:case Cn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}NF.Decoder=p$;class BF{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){let i=_F.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var IF=h((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.Client=void 0;var Wx=ba(),SX=mi(),AX=import.meta.require("url"),Jo=SX("socket.io:client");class tF{constructor(n,i){this.sockets=new Map,this.nsps=new Map,this.server=n,this.conn=i,this.encoder=n.encoder,this.decoder=new n._parser.Decoder,this.id=i.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{if(this.nsps.size===0)Jo("no namespace joined yet, close the client"),this.close();else Jo("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(n,i={}){if(this.server._nsps.has(n))return Jo("connecting to namespace %s",n),this.doConnect(n,i);this.server._checkNamespace(n,i,(o)=>{if(o)this.doConnect(n,i);else Jo("creation of namespace %s was denied",n),this._packet({type:Wx.PacketType.CONNECT_ERROR,nsp:n,data:{message:"Invalid namespace"}})})}doConnect(n,i){let o=this.server.of(n);o._add(this,i,(c)=>{if(this.sockets.set(c.id,c),this.nsps.set(o.name,c),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0})}_disconnect(){for(let n of this.sockets.values())n.disconnect();this.sockets.clear(),this.close()}_remove(n){if(this.sockets.has(n.id)){let i=this.sockets.get(n.id).nsp.name;this.sockets.delete(n.id),this.nsps.delete(i)}else Jo("ignoring remove for %s",n.id)}close(){if(this.conn.readyState==="open")Jo("forcing transport close"),this.conn.close(),this.onclose("forced server close")}_packet(n,i={}){if(this.conn.readyState!=="open"){Jo("ignoring packet write %j",n);return}let o=i.preEncoded?n:this.encoder.encode(n);this.writeToEngine(o,i)}writeToEngine(n,i){if(i.volatile&&!this.conn.transport.writable){Jo("volatile packet is discarded since the transport is not currently writable");return}let o=Array.isArray(n)?n:[n];for(let c of o)this.conn.write(c,i)}ondata(n){try{this.decoder.add(n)}catch(i){Jo("invalid packet format"),this.onerror(i)}}ondecoded(n){let i,o;if(this.conn.protocol===3){let p=AX.parse(n.nsp,!0);i=p.pathname,o=p.query}else i=n.nsp,o=n.data;let c=this.nsps.get(i);if(!c&&n.type===Wx.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==Wx.PacketType.CONNECT&&n.type!==Wx.PacketType.CONNECT_ERROR)process.nextTick(function(){c._onpacket(n)});else Jo("invalid state (packet type: %s)",n.type),this.close()}onerror(n){for(let i of this.sockets.values())i._onerror(n);this.conn.close()}onclose(n,i){Jo("client close with reason %s",n),this.destroy();for(let o of this.sockets.values())o._onclose(n,i);this.sockets.clear(),this.decoder.destroy()}destroy(){if(this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0}}DF.Client=tF});var Xx=h((kF)=>{Object.defineProperty(kF,"__esModule",{value:!0});kF.StrictEventEmitter=void 0;var JX=import.meta.require("events");class CF extends JX.EventEmitter{on(n,i){return super.on(n,i)}once(n,i){return super.once(n,i)}emit(n,...i){return super.emit(n,...i)}emitReserved(n,...i){return super.emit(n,...i)}emitUntyped(n,...i){return super.emit(n,...i)}listeners(n){return super.listeners(n)}}kF.StrictEventEmitter=CF});var a$=h((ZF)=>{Object.defineProperty(ZF,"__esModule",{value:!0});ZF.RESERVED_EVENTS=void 0;ZF.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var x$=h((eF)=>{Object.defineProperty(eF,"__esModule",{value:!0});eF.RemoteSocket=eF.BroadcastOperator=void 0;var FX=a$(),RX=ba();class No{constructor(n,i=new Set,o=new Set,c={}){this.adapter=n,this.rooms=i,this.exceptRooms=o,this.flags=c}to(n){let i=new Set(this.rooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new No(this.adapter,i,this.exceptRooms,this.flags)}in(n){return this.to(n)}except(n){let i=new Set(this.exceptRooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new No(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new No(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new No(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new No(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new No(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(FX.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:RX.PacketType.EVENT,data:o};if(typeof o[o.length-1]!=="function")return this.adapter.broadcast(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let a=o.pop(),m=!1,x=[],l=setTimeout(()=>{m=!0,a.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:x])},this.flags.timeout),f=-1,$=0,v=0,w=()=>{if(!m&&f===$&&x.length===v)clearTimeout(l),a.apply(this,[null,this.flags.expectSingleResponse?x[0]:x])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(F)=>{v+=F,$++,w()},(F)=>{x.push(F),w()}),this.adapter.serverCount().then((F)=>{f=F,w()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,a)=>{if(p)return p.responses=a,c(p);else return o(a)}),this.emit(n,...i)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((n)=>{return n.map((i)=>{if(i.server)return i;else return new m$(this.adapter,i)})})}socketsJoin(n){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}socketsLeave(n){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}disconnectSockets(n=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},n)}}eF.BroadcastOperator=No;class m${constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new No(n,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(n){return this.operator.timeout(n)}emit(n,...i){return this.operator.emit(n,...i)}join(n){return this.operator.socketsJoin(n)}leave(n){return this.operator.socketsLeave(n)}disconnect(n=!1){return this.operator.disconnectSockets(n),this}}eF.RemoteSocket=m$});var l$=h((zp)=>{var nR=zp&&zp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(zp,"__esModule",{value:!0});zp.Socket=void 0;var io=ba(),KX=nR(mi()),WX=Xx(),gF=nR(Vf()),XX=x$(),GX=a$(),Ri=KX.default("socket.io:socket"),zX=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function dF(){}class iR extends WX.StrictEventEmitter{constructor(n,i,o,c){super();if(this.nsp=n,this.client=i,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=n.server,this.adapter=this.nsp.adapter,c)this.id=c.sid,this.pid=c.pid,c.rooms.forEach((p)=>this.join(p)),this.data=c.data,c.missedPackets.forEach((p)=>{this.packet({type:io.PacketType.EVENT,data:p})}),this.recovered=!0;else{if(i.conn.protocol===3)this.id=n.name!=="/"?n.name+"#"+i.id:i.id;else this.id=gF.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=gF.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",dF)}buildHandshake(n){var i,o,c,p;return{headers:((i=this.request)===null||i===void 0?void 0:i.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!((o=this.request)===null||o===void 0?void 0:o.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(c=this.request)===null||c===void 0?void 0:c.url,query:((p=this.request)===null||p===void 0?void 0:p._query)||{},auth:n}}emit(n,...i){if(GX.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:io.PacketType.EVENT,data:o};if(typeof o[o.length-1]==="function"){let a=this.nsp._ids++;Ri("emitting packet with ack id %d",a),this.registerAckCallback(a,o.pop()),c.id=a}let p=Object.assign({},this.flags);if(this.flags={},this.nsp.server.opts.connectionStateRecovery)this.adapter.broadcast(c,{rooms:new Set([this.id]),except:new Set,flags:p});else this.notifyOutgoingListeners(c),this.packet(c,p);return!0}emitWithAck(n,...i){let o=this.flags.timeout!==void 0;return new Promise((c,p)=>{i.push((a,m)=>{if(o)return a?p(a):c(m);else return c(a)}),this.emit(n,...i)})}registerAckCallback(n,i){let o=this.flags.timeout;if(o===void 0){this.acks.set(n,i);return}let c=setTimeout(()=>{Ri("event with ack id %d has timed out after %d ms",n,o),this.acks.delete(n),i.call(this,new Error("operation has timed out"))},o);this.acks.set(n,(...p)=>{clearTimeout(c),i.apply(this,[null,...p])})}to(n){return this.newBroadcastOperator().to(n)}in(n){return this.newBroadcastOperator().in(n)}except(n){return this.newBroadcastOperator().except(n)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}packet(n,i={}){n.nsp=this.nsp.name,i.compress=i.compress!==!1,this.client._packet(n,i)}join(n){return Ri("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Ri("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Ri("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3)this.packet({type:io.PacketType.CONNECT});else this.packet({type:io.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(n){switch(Ri("got packet %j",n),n.type){case io.PacketType.EVENT:this.onevent(n);break;case io.PacketType.BINARY_EVENT:this.onevent(n);break;case io.PacketType.ACK:this.onack(n);break;case io.PacketType.BINARY_ACK:this.onack(n);break;case io.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(n){let i=n.data||[];if(Ri("emitting event %j",i),n.id!=null)Ri("attaching ack callback to event"),i.push(this.ack(n.id));if(this._anyListeners&&this._anyListeners.length){let o=this._anyListeners.slice();for(let c of o)c.apply(this,i)}this.dispatch(i)}ack(n){let i=this,o=!1;return function(){if(o)return;let c=Array.prototype.slice.call(arguments);Ri("sending ack %j",c),i.packet({id:n,type:io.PacketType.ACK,data:c}),o=!0}}onack(n){let i=this.acks.get(n.id);if(typeof i=="function")Ri("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Ri("bad ack %s",n.id)}ondisconnect(){Ri("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Ri("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&zX.has(n))Ri("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data});this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",n,i);return}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=dF}_error(n){this.packet({type:io.PacketType.CONNECT_ERROR,data:n})}disconnect(n=!1){if(!this.connected)return this;if(n)this.client._disconnect();else this.packet({type:io.PacketType.DISCONNECT}),this._onclose("server namespace disconnect");return this}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(n){return this.flags.timeout=n,this}dispatch(n){Ri("dispatching an event %j",n),this.run(n,(i)=>{process.nextTick(()=>{if(i)return this._onerror(i);if(this.connected)super.emitUntyped.apply(this,n);else Ri("ignore packet received after disconnection")})})}use(n){return this.fns.push(n),this}run(n,i){if(!this.fns.length)return i();let o=this.fns.slice(0);function c(p){o[p](n,(a)=>{if(a)return i(a);if(!o[p+1])return i();c(p+1)})}c(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){let i=this._anyListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){let i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let o of i)o.apply(this,n.data)}}newBroadcastOperator(){let n=Object.assign({},this.flags);return this.flags={},new XX.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}zp.Socket=iR});var f$=h((Lo)=>{var uX=Lo&&Lo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.Namespace=Lo.RESERVED_EVENTS=void 0;var oR=l$(),YX=Xx(),OX=uX(mi()),Di=x$(),Va=OX.default("socket.io:namespace");Lo.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class cR extends YX.StrictEventEmitter{constructor(n,i){super();this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=n,this.name=i,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(n){return this._fns.push(n),this}run(n,i){if(!this._fns.length)return i();let o=this._fns.slice(0);function c(p){o[p](n,(a)=>{if(a)return i(a);if(!o[p+1])return i();c(p+1)})}c(0)}to(n){return new Di.BroadcastOperator(this.adapter).to(n)}in(n){return new Di.BroadcastOperator(this.adapter).in(n)}except(n){return new Di.BroadcastOperator(this.adapter).except(n)}async _add(n,i,o){var c;Va("adding socket to nsp %s",this.name);let p=await this._createSocket(n,i);if(this._preConnectSockets.set(p.id,p),((c=this.server.opts.connectionStateRecovery)===null||c===void 0?void 0:c.skipMiddlewares)&&p.recovered&&n.conn.readyState==="open")return this._doConnect(p,o);this.run(p,(a)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Va("next called after client was closed - ignoring socket"),p._cleanup();return}if(a)if(Va("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(a.data||a.message);else return p._error({message:a.message,data:a.data});this._doConnect(p,o)})})}async _createSocket(n,i){let{pid:o,offset:c}=i;if(this.server.opts.connectionStateRecovery&&typeof o==="string"&&typeof c==="string"){let p;try{p=await this.adapter.restoreSession(o,c)}catch(a){Va("error while restoring session: %s",a)}if(p)return Va("connection state recovered for sid %s",p.sid),new oR.Socket(this,n,i,p)}return new oR.Socket(this,n,i)}_doConnect(n,i){if(this._preConnectSockets.delete(n.id),this.sockets.set(n.id,n),n._onconnect(),i)i(n);this.emitReserved("connect",n),this.emitReserved("connection",n)}_remove(n){this.sockets.delete(n.id)||this._preConnectSockets.delete(n.id)}emit(n,...i){return new Di.BroadcastOperator(this.adapter).emit(n,...i)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}serverSideEmit(n,...i){if(Lo.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);return i.unshift(n),this.adapter.serverSideEmit(i),!0}serverSideEmitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,a)=>{if(p)return p.responses=a,c(p);else return o(a)}),this.serverSideEmit(n,...i)})}_onServerSideEmit(n){super.emitUntyped.apply(this,n)}allSockets(){return new Di.BroadcastOperator(this.adapter).allSockets()}compress(n){return new Di.BroadcastOperator(this.adapter).compress(n)}get volatile(){return new Di.BroadcastOperator(this.adapter).volatile}get local(){return new Di.BroadcastOperator(this.adapter).local}timeout(n){return new Di.BroadcastOperator(this.adapter).timeout(n)}fetchSockets(){return new Di.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(n){return new Di.BroadcastOperator(this.adapter).socketsJoin(n)}socketsLeave(n){return new Di.BroadcastOperator(this.adapter).socketsLeave(n)}disconnectSockets(n=!1){return new Di.BroadcastOperator(this.adapter).disconnectSockets(n)}}Lo.Namespace=cR});var $R=h((lR)=>{Object.defineProperty(lR,"__esModule",{value:!0});lR.yeast=lR.decode=lR.encode=void 0;var mR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Gx=64,xR={},pR=0,$c=0,aR;function $$(n){let i="";do i=mR[n%Gx]+i,n=Math.floor(n/Gx);while(n>0);return i}lR.encode=$$;function HX(n){let i=0;for($c=0;$c<n.length;$c++)i=i*Gx+xR[n.charAt($c)];return i}lR.decode=HX;function EX(){let n=$$(+new Date);if(n!==aR)return pR=0,aR=n;return n+"."+$$(pR++)}lR.yeast=EX;for(;$c<Gx;$c++)xR[mR[$c]]=$c});var w$=h((TR)=>{var v$;Object.defineProperty(TR,"__esModule",{value:!0});TR.SessionAwareAdapter=TR.Adapter=void 0;var UX=import.meta.require("events"),bX=$R(),zx=import.meta.require("ws"),VX=typeof((v$=zx===null||zx===void 0?void 0:zx.Sender)===null||v$===void 0?void 0:v$.frame)==="function";class T$ extends UX.EventEmitter{constructor(n){super();this.nsp=n,this.rooms=new Map,this.sids=new Map,this.encoder=n.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(n,i){if(!this.sids.has(n))this.sids.set(n,new Set);for(let o of i){if(this.sids.get(n).add(o),!this.rooms.has(o))this.rooms.set(o,new Set),this.emit("create-room",o);if(!this.rooms.get(o).has(n))this.rooms.get(o).add(n),this.emit("join-room",o,n)}}del(n,i){if(this.sids.has(n))this.sids.get(n).delete(i);this._del(i,n)}_del(n,i){let o=this.rooms.get(n);if(o!=null){if(o.delete(i))this.emit("leave-room",n,i);if(o.size===0&&this.rooms.delete(n))this.emit("delete-room",n)}}delAll(n){if(!this.sids.has(n))return;for(let i of this.sids.get(n))this._del(i,n);this.sids.delete(n)}broadcast(n,i){let o=i.flags||{},c={preEncoded:!0,volatile:o.volatile,compress:o.compress};n.nsp=this.nsp.name;let p=this._encode(n,c);this.apply(i,(a)=>{if(typeof a.notifyOutgoingListeners==="function")a.notifyOutgoingListeners(n);a.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},a={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let m=this._encode(n,a),x=0;this.apply(i,(l)=>{if(x++,l.acks.set(n.id,c),typeof l.notifyOutgoingListeners==="function")l.notifyOutgoingListeners(n);l.client.writeToEngine(m,a)}),o(x)}_encode(n,i){let o=this.encoder.encode(n);if(VX&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=zx.Sender.frame(c,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return o}sockets(n){let i=new Set;return this.apply({rooms:n},(o)=>{i.add(o.id)}),Promise.resolve(i)}socketRooms(n){return this.sids.get(n)}fetchSockets(n){let i=[];return this.apply(n,(o)=>{i.push(o)}),Promise.resolve(i)}addSockets(n,i){this.apply(n,(o)=>{o.join(i)})}delSockets(n,i){this.apply(n,(o)=>{i.forEach((c)=>o.leave(c))})}disconnectSockets(n,i){this.apply(n,(o)=>{o.disconnect(i)})}apply(n,i){let o=n.rooms,c=this.computeExceptSids(n.except);if(o.size){let p=new Set;for(let a of o){if(!this.rooms.has(a))continue;for(let m of this.rooms.get(a)){if(p.has(m)||c.has(m))continue;let x=this.nsp.sockets.get(m);if(x)i(x),p.add(m)}}}else for(let[p]of this.sids){if(c.has(p))continue;let a=this.nsp.sockets.get(p);if(a)i(a)}}computeExceptSids(n){let i=new Set;if(n&&n.size>0){for(let o of n)if(this.rooms.has(o))this.rooms.get(o).forEach((c)=>i.add(c))}return i}serverSideEmit(n){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(n){}restoreSession(n,i){return null}}TR.Adapter=T$;class vR extends T${constructor(n){super(n);this.nsp=n,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=n.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let o=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((c,p)=>{if(c.disconnectedAt<o)this.sessions.delete(p)});for(let c=this.packets.length-1;c>=0;c--)if(this.packets[c].emittedAt<o){this.packets.splice(0,c+1);break}},60000).unref()}persistSession(n){n.disconnectedAt=Date.now(),this.sessions.set(n.pid,n)}restoreSession(n,i){let o=this.sessions.get(n);if(!o)return null;if(o.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(n),null;let p=this.packets.findIndex((m)=>m.id===i);if(p===-1)return null;let a=[];for(let m=p+1;m<this.packets.length;m++){let x=this.packets[m];if(_X(o.rooms,x.opts))a.push(x.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:a}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,a=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&a){let m=bX.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}TR.SessionAwareAdapter=vR;function _X(n,i){let o=i.rooms.size===0||n.some((p)=>i.rooms.has(p)),c=n.every((p)=>!i.except.has(p));return o&&c}});var AR=h((Fo)=>{var jX=Fo&&Fo.__rest||function(n,i){var o={};for(var c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0)o[c]=n[c];if(n!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var p=0,c=Object.getOwnPropertySymbols(n);p<c.length;p++)if(i.indexOf(c[p])<0&&Object.prototype.propertyIsEnumerable.call(n,c[p]))o[c[p]]=n[c[p]]}return o};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ClusterAdapterWithHeartbeat=Fo.ClusterAdapter=Fo.MessageType=void 0;var BX=w$(),NX=mi(),LX=import.meta.require("crypto"),Zn=NX.debug("socket.io-adapter"),tX="emitter",ux=5000;function Yp(){return LX.randomBytes(8).toString("hex")}var pn;(function(n){n[n.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",n[n.HEARTBEAT=2]="HEARTBEAT",n[n.BROADCAST=3]="BROADCAST",n[n.SOCKETS_JOIN=4]="SOCKETS_JOIN",n[n.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",n[n.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",n[n.FETCH_SOCKETS=7]="FETCH_SOCKETS",n[n.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",n[n.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",n[n.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",n[n.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",n[n.BROADCAST_ACK=12]="BROADCAST_ACK",n[n.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(pn=Fo.MessageType||(Fo.MessageType={}));function Vc(n){return{rooms:[...n.rooms],except:[...n.except],flags:n.flags}}function up(n){return{rooms:new Set(n.rooms),except:new Set(n.except),flags:n.flags}}class S$ extends BX.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Yp()}onMessage(n,i){if(n.uid===this.uid)return Zn("[%s] ignore message from self",this.uid);switch(Zn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case pn.BROADCAST:{if(n.data.requestId!==void 0)super.broadcastWithAck(n.data.packet,up(n.data.opts),(c)=>{Zn("[%s] waiting for %d client acknowledgements",this.uid,c),this.publishResponse(n.uid,{type:pn.BROADCAST_CLIENT_COUNT,data:{requestId:n.data.requestId,clientCount:c}})},(c)=>{Zn("[%s] received acknowledgement with value %j",this.uid,c),this.publishResponse(n.uid,{type:pn.BROADCAST_ACK,data:{requestId:n.data.requestId,packet:c}})});else{let c=n.data.packet,p=up(n.data.opts);this.addOffsetIfNecessary(c,p,i),super.broadcast(c,p)}break}case pn.SOCKETS_JOIN:super.addSockets(up(n.data.opts),n.data.rooms);break;case pn.SOCKETS_LEAVE:super.delSockets(up(n.data.opts),n.data.rooms);break;case pn.DISCONNECT_SOCKETS:super.disconnectSockets(up(n.data.opts),n.data.close);break;case pn.FETCH_SOCKETS:{Zn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(up(n.data.opts)).then((o)=>{this.publishResponse(n.uid,{type:pn.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:a}=p,m=jX(p,["sessionStore"]);return{id:c.id,handshake:m,rooms:[...c.rooms],data:c.data}})}})});break}case pn.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,a=(m)=>{if(p)return;p=!0,Zn("[%s] calling acknowledgement with %j",this.uid,m),this.publishResponse(n.uid,{type:pn.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:m}})};this.nsp._onServerSideEmit([...o,a]);break}case pn.BROADCAST_CLIENT_COUNT:case pn.BROADCAST_ACK:case pn.FETCH_SOCKETS_RESPONSE:case pn.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(n);break;default:Zn("[%s] unknown message type: %s",this.uid,n.type)}}onResponse(n){var i,o;let c=n.data.requestId;switch(Zn("[%s] received response %s to request %s",this.uid,n.type,c),n.type){case pn.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case pn.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case pn.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((a)=>p.responses.push(a)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case pn.SERVER_SIDE_EMIT_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,p.responses.push(n.data.packet),p.current===p.expected)clearTimeout(p.timeout),p.resolve(null,p.responses),this.requests.delete(c);break}default:Zn("[%s] unknown response type: %s",this.uid,n.type)}}async broadcast(n,i){var o;if(!((o=i.flags)===null||o===void 0?void 0:o.local))try{let p=await this.publishAndReturnOffset({type:pn.BROADCAST,data:{packet:n,opts:Vc(i)}});this.addOffsetIfNecessary(n,i,p)}catch(p){return Zn("[%s] error while broadcasting message: %s",this.uid,p.message)}super.broadcast(n,i)}addOffsetIfNecessary(n,i,o){var c;if(!this.nsp.server.opts.connectionStateRecovery)return;let p=n.type===2,a=n.id===void 0,m=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&a&&m)n.data.push(o)}broadcastWithAck(n,i,o,c){var p;if(!((p=i===null||i===void 0?void 0:i.flags)===null||p===void 0?void 0:p.local)){let m=Yp();this.ackRequests.set(m,{clientCountCallback:o,ack:c}),this.publish({type:pn.BROADCAST,data:{packet:n,requestId:m,opts:Vc(i)}}),setTimeout(()=>{this.ackRequests.delete(m)},i.flags.timeout)}super.broadcastWithAck(n,i,o,c)}async addSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:pn.SOCKETS_JOIN,data:{opts:Vc(n),rooms:i}})}catch(p){Zn("[%s] error while publishing message: %s",this.uid,p.message)}super.addSockets(n,i)}async delSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:pn.SOCKETS_LEAVE,data:{opts:Vc(n),rooms:i}})}catch(p){Zn("[%s] error while publishing message: %s",this.uid,p.message)}super.delSockets(n,i)}async disconnectSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:pn.DISCONNECT_SOCKETS,data:{opts:Vc(n),close:i}})}catch(p){Zn("[%s] error while publishing message: %s",this.uid,p.message)}super.disconnectSockets(n,i)}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets(n),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let a=Yp();return new Promise((m,x)=>{let l=setTimeout(()=>{let $=this.requests.get(a);if($)x(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(a)},n.flags.timeout||ux),f={type:pn.FETCH_SOCKETS,resolve:m,timeout:l,current:0,expected:p,responses:o};this.requests.set(a,f),this.publish({type:pn.FETCH_SOCKETS,data:{opts:Vc(n),requestId:a}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:pn.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=await this.serverCount()-1;if(Zn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Yp(),a=setTimeout(()=>{let x=this.requests.get(p);if(x)o(new Error(`timeout reached: only ${x.current} responses received out of ${x.expected}`),x.responses),this.requests.delete(p)},ux),m={type:pn.SERVER_SIDE_EMIT,resolve:o,timeout:a,current:0,expected:c,responses:[]};this.requests.set(p,m),this.publish({type:pn.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}publish(n){this.publishAndReturnOffset(n).catch((i)=>{Zn("[%s] error while publishing message: %s",this.uid,i)})}publishAndReturnOffset(n){return n.uid=this.uid,n.nsp=this.nsp.name,this.doPublish(n)}publishResponse(n,i){i.uid=this.uid,i.nsp=this.nsp.name,this.doPublishResponse(n,i).catch((o)=>{Zn("[%s] error while publishing response: %s",this.uid,o)})}}Fo.ClusterAdapter=S$;class SR extends S${constructor(n,i){super(n);this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5000,heartbeatTimeout:1e4},i),this.cleanupTimer=setInterval(()=>{let o=Date.now();this.nodesMap.forEach((c,p)=>{if(o-c>this._opts.heartbeatTimeout)Zn("[%s] node %s seems down",this.uid,p),this.removeNode(p)})},1000)}init(){this.publish({type:pn.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:pn.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:pn.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer)clearInterval(this.cleanupTimer)}onMessage(n,i){if(n.uid===this.uid)return Zn("[%s] ignore message from self",this.uid);if(n.uid&&n.uid!==tX)this.nodesMap.set(n.uid,Date.now());switch(Zn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case pn.INITIAL_HEARTBEAT:this.publish({type:pn.HEARTBEAT});break;case pn.HEARTBEAT:break;case pn.ADAPTER_CLOSE:this.removeNode(n.uid);break;default:super.onMessage(n,i)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(n){return this.scheduleHeartbeat(),super.publish(n)}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:pn.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=this.nodesMap.size;if(Zn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Yp(),a=setTimeout(()=>{let x=this.customRequests.get(p);if(x)o(new Error(`timeout reached: missing ${x.missingUids.size} responses`),x.responses),this.customRequests.delete(p)},ux),m={type:pn.SERVER_SIDE_EMIT,resolve:o,timeout:a,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,m),this.publish({type:pn.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets({rooms:n.rooms,except:n.except,flags:{local:!0}}),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let a=Yp();return new Promise((m,x)=>{let l=setTimeout(()=>{let $=this.customRequests.get(a);if($)x(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(a)},n.flags.timeout||ux),f={type:pn.FETCH_SOCKETS,resolve:m,timeout:l,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(a,f),this.publish({type:pn.FETCH_SOCKETS,data:{opts:Vc(n),requestId:a}})})}onResponse(n){let i=n.data.requestId;switch(Zn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case pn.FETCH_SOCKETS_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(n.data.sockets.forEach((c)=>o.responses.push(c)),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(o.responses),this.customRequests.delete(i);break}case pn.SERVER_SIDE_EMIT_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(o.responses.push(n.data.packet),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(null,o.responses),this.customRequests.delete(i);break}default:super.onResponse(n)}}removeNode(n){this.customRequests.forEach((i,o)=>{if(i.missingUids.delete(n),i.missingUids.size===0){if(clearTimeout(i.timeout),i.type===pn.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===pn.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}Fo.ClusterAdapterWithHeartbeat=SR});var Yx=h((_c)=>{Object.defineProperty(_c,"__esModule",{value:!0});_c.MessageType=_c.ClusterAdapterWithHeartbeat=_c.ClusterAdapter=_c.SessionAwareAdapter=_c.Adapter=void 0;var JR=w$();Object.defineProperty(_c,"Adapter",{enumerable:!0,get:function(){return JR.Adapter}});Object.defineProperty(_c,"SessionAwareAdapter",{enumerable:!0,get:function(){return JR.SessionAwareAdapter}});var A$=AR();Object.defineProperty(_c,"ClusterAdapter",{enumerable:!0,get:function(){return A$.ClusterAdapter}});Object.defineProperty(_c,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return A$.ClusterAdapterWithHeartbeat}});Object.defineProperty(_c,"MessageType",{enumerable:!0,get:function(){return A$.MessageType}})});var KR=h((Op)=>{var hX=Op&&Op.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Op,"__esModule",{value:!0});Op.ParentNamespace=void 0;var FR=f$(),IX=Yx(),CX=hX(mi()),RR=CX.default("socket.io:parent-namespace");class Ox extends FR.Namespace{constructor(n){super(n,"/_"+Ox.count++);this.children=new Set}_initAdapter(){this.adapter=new MR(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){RR("creating child namespace %s",n);let i=new FR.Namespace(this.server,n);if(this._fns.forEach((o)=>i.use(o)),this.listeners("connect").forEach((o)=>i.on("connect",o)),this.listeners("connection").forEach((o)=>i.on("connection",o)),this.children.add(i),this.server._opts.cleanupEmptyChildNamespaces){let o=i._remove;i._remove=(c)=>{if(o.call(i,c),i.sockets.size===0)RR("closing child namespace %s",n),i.adapter.close(),this.server._nsps.delete(i.name),this.children.delete(i)}}return this.server._nsps.set(n,i),this.server.sockets.emitReserved("new_namespace",i),i}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}Op.ParentNamespace=Ox;Ox.count=0;class MR extends IX.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var YR=h((jc)=>{var kX=jc&&jc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(jc,"__esModule",{value:!0});jc.patchAdapter=ZX;jc.restoreAdapter=qX;jc.serveFile=PX;var yc=Yx(),WR=import.meta.require("fs"),rX=kX(mi()),Hx=rX.default("socket.io:adapter-uws"),J$="\x1F",{addAll:GR,del:zR,broadcast:uR}=yc.Adapter.prototype;function ZX(n){yc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);GR.call(this,i,o);let p=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(!p)return;if(p.conn.transport.name==="websocket"){XR(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let a=this.sids.get(i);if(a)XR(this.nsp.name,p,c,a)})},yc.Adapter.prototype.del=function(i,o){zR.call(this,i,o);let c=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(c&&c.conn.transport.name==="websocket"){let p=c.conn.id,a=c.conn.transport.socket,m=`${this.nsp.name}${J$}${o}`;Hx("unsubscribe connection %s from topic %s",p,m),a.unsubscribe(m)}},yc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){uR.call(this,i,o);return}let p=o.flags||{},a={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let m=this.encoder.encode(i),x=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${J$}${o.rooms.keys().next().value}`;Hx("fast publish to %s",x),m.forEach((l)=>{let f=typeof l!=="string";n.publish(x,f?l:"4"+l,f)}),this.apply(o,(l)=>{if(l.conn.transport.name!=="websocket")l.client.writeToEngine(m,a)})}}function XR(n,i,o,c){let p=i.conn.id,a=i.conn.transport.socket;if(o)Hx("subscribe connection %s to topic %s",p,n),a.subscribe(n);c.forEach((m)=>{let x=`${n}${J$}${m}`;Hx("subscribe connection %s to topic %s",p,x),a.subscribe(x)})}function qX(){yc.Adapter.prototype.addAll=GR,yc.Adapter.prototype.del=zR,yc.Adapter.prototype.broadcast=uR}var eX=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function PX(n,i){let{size:o}=WR.statSync(i),c=WR.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),a=(x)=>{throw p(),x},m=(x)=>{let l=eX(x);n.cork(()=>{let f=n.getWriteOffset(),[$,v]=n.tryEnd(l,o);if(!v&&!$)c.pause(),n.onWritable((w)=>{let[F,M]=n.tryEnd(l.slice(w-f),o);if(!M&&F)c.resume();return F})})};n.onAborted(p),c.on("data",m).on("error",a).on("end",p)}});var OR=h((KB,gX)=>{gX.exports={name:"socket.io",version:"4.8.0",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":"prettier --check \"lib/**/*.ts\" \"test/**/*.ts\"","format:fix":"prettier --write \"lib/**/*.ts\" \"test/**/*.ts\"",prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.3.2","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var yR=h((Mi,_a)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.0/node_modules/socket.io/dist",dX=Mi&&Mi.__createBinding||(Object.create?function(n,i,o,c){if(c===void 0)c=o;var p=Object.getOwnPropertyDescriptor(i,o);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable))p={enumerable:!0,get:function(){return i[o]}};Object.defineProperty(n,c,p)}:function(n,i,o,c){if(c===void 0)c=o;n[c]=i[o]}),n5=Mi&&Mi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),i5=Mi&&Mi.__importStar||function(n){if(n&&n.__esModule)return n;var i={};if(n!=null){for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o))dX(i,n,o)}return n5(i,n),i},VR=Mi&&Mi.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.Namespace=Mi.Socket=Mi.Server=void 0;var o5=import.meta.require("http"),c5=import.meta.require("fs"),F$=import.meta.require("zlib"),p5=ax(),Ex=import.meta.require("stream"),HR=import.meta.require("path"),ER=zF(),a5=IF(),QR=import.meta.require("events"),M$=f$();Object.defineProperty(Mi,"Namespace",{enumerable:!0,get:function(){return M$.Namespace}});var m5=KR(),sR=Yx(),x5=i5(ba()),l5=VR(mi()),_R=l$();Object.defineProperty(Mi,"Socket",{enumerable:!0,get:function(){return _R.Socket}});var f5=Xx(),R$=YR(),$5=VR(gf()),bi=l5.default("socket.io:server"),UR=OR().version,bR=/\.map/;class Hp extends f5.StrictEventEmitter{constructor(n,i={}){super();if(this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof n==="object"&&n instanceof Object&&!n.listen)i=n,n=void 0;if(this.path(i.path||"/socket.io"),this.connectTimeout(i.connectTimeout||45000),this.serveClient(i.serveClient!==!1),this._parser=i.parser||x5,this.encoder=new this._parser.Encoder,this.opts=i,i.connectionStateRecovery)i.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120000,skipMiddlewares:!0},i.connectionStateRecovery),this.adapter(i.adapter||sR.SessionAwareAdapter);else this.adapter(i.adapter||sR.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=$5.default(this.opts.cors)}get _opts(){return this.opts}serveClient(n){if(!arguments.length)return this._serveClient;return this._serveClient=n,this}_checkNamespace(n,i,o){if(this.parentNsps.size===0)return o(!1);let c=this.parentNsps.keys(),p=()=>{let a=c.next();if(a.done)return o(!1);a.value(n,i,(m,x)=>{if(m||!x)return p();if(this._nsps.has(n))return bi("dynamic namespace %s already exists",n),o(this._nsps.get(n));let l=this.parentNsps.get(a.value).createChild(n);bi("dynamic namespace %s was created",n),o(l)})};p()}path(n){if(!arguments.length)return this._path;this._path=n.replace(/\/$/,"");let i=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+i+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(n){if(n===void 0)return this._connectTimeout;return this._connectTimeout=n,this}adapter(n){if(!arguments.length)return this._adapter;this._adapter=n;for(let i of this._nsps.values())i._initAdapter();return this}listen(n,i={}){return this.attach(n,i)}attach(n,i={}){if(typeof n=="function")throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.");if(Number(n)==n)n=Number(n);if(typeof n=="number"){bi("creating http server and binding to %d",n);let o=n;n=o5.createServer((c,p)=>{p.writeHead(404),p.end()}),n.listen(o)}return Object.assign(i,this.opts),i.path=i.path||this._path,this.initEngine(n,i),this}attachApp(n,i={}){Object.assign(i,this.opts),i.path=i.path||this._path,bi("creating uWebSockets.js-based engine with opts %j",i);let o=new ER.uServer(i);if(o.attach(n,i),this.bind(o),this._serveClient)n.get(`${this._path}/*`,(c,p)=>{if(!this.clientPathRegex.test(p.getUrl())){p.setYield(!0);return}let a=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),m=bR.test(a),x=m?"map":"source",l='"'+UR+'"',f="W/"+l,$=p.getHeader("if-none-match");if($){if(l===$||f===$){bi("serve client %s 304",x),c.writeStatus("304 Not Modified"),c.end();return}}bi("serve client %s",x),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",l);let v=HR.join(__dirname,"../client-dist/",a);R$.serveFile(c,v)});R$.patchAdapter(n)}initEngine(n,i){if(bi("creating engine.io instance with opts %j",i),this.eio=ER.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){bi("attaching client serving req handler");let i=n.listeners("request").slice(0);n.removeAllListeners("request"),n.on("request",(o,c)=>{if(this.clientPathRegex.test(o.url))if(this._corsMiddleware)this._corsMiddleware(o,c,()=>{this.serve(o,c)});else this.serve(o,c);else for(let p=0;p<i.length;p++)i[p].call(n,o,c)})}serve(n,i){let o=n.url.replace(this._path,"").replace(/\?.*$/,""),c=bR.test(o),p=c?"map":"source",a='"'+UR+'"',m="W/"+a,x=n.headers["if-none-match"];if(x){if(a===x||m===x){bi("serve client %s 304",p),i.writeHead(304),i.end();return}}bi("serve client %s",p),i.setHeader("Cache-Control","public, max-age=0"),i.setHeader("Content-Type","application/"+(c?"json":"javascript")+"; charset=utf-8"),i.setHeader("ETag",a),Hp.sendFile(o,n,i)}static sendFile(n,i,o){let c=c5.createReadStream(HR.join(__dirname,"../client-dist/",n)),p=p5(i).encodings(["br","gzip","deflate"]),a=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),Ex.pipeline(c,F$.createBrotliCompress(),o,a);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),Ex.pipeline(c,F$.createGzip(),o,a);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),Ex.pipeline(c,F$.createDeflate(),o,a);break;default:o.writeHead(200),Ex.pipeline(c,o,a)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){bi("incoming connection with id %s",n.id);let i=new a5.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new m5.ParentNamespace(this);if(bi("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,a,m)=>m(null,n.test(p)),c),this.parentNamespacesFromRegExp.set(n,c);if(i)c.on("connect",i);return c}if(String(n)[0]!=="/")n="/"+n;let o=this._nsps.get(n);if(!o){for(let[c,p]of this.parentNamespacesFromRegExp)if(c.test(n))return bi("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(bi("initializing namespace %s",n),o=new M$.Namespace(this,n),this._nsps.set(n,o),n!=="/")this.sockets.emitReserved("new_namespace",o)}if(i)o.on("connect",i);return o}async close(n){if(await Promise.allSettled([...this._nsps.values()].map(async(i)=>{i.sockets.forEach((o)=>{o._onclose("server shutting down")}),await i.adapter.close()})),this.engine.close(),R$.restoreAdapter(),this.httpServer)this.httpServer.close(n);else n&&n()}use(n){return this.sockets.use(n),this}to(n){return this.sockets.to(n)}in(n){return this.sockets.in(n)}except(n){return this.sockets.except(n)}send(...n){return this.sockets.emit("message",...n),this}write(...n){return this.sockets.emit("message",...n),this}serverSideEmit(n,...i){return this.sockets.serverSideEmit(n,...i)}serverSideEmitWithAck(n,...i){return this.sockets.serverSideEmitWithAck(n,...i)}allSockets(){return this.sockets.allSockets()}compress(n){return this.sockets.compress(n)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(n){return this.sockets.timeout(n)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(n){return this.sockets.socketsJoin(n)}socketsLeave(n){return this.sockets.socketsLeave(n)}disconnectSockets(n=!1){return this.sockets.disconnectSockets(n)}}Mi.Server=Hp;var v5=Object.keys(QR.EventEmitter.prototype).filter(function(n){return typeof QR.EventEmitter.prototype[n]==="function"});v5.forEach(function(n){Hp.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});_a.exports=(n,i)=>new Hp(n,i);_a.exports.Server=Hp;_a.exports.Namespace=M$.Namespace;_a.exports.Socket=_R.Socket});import{createHash as DM}from"crypto";import{createServer as W9}from"http";import{createServer as X9}from"https";function Pc(n=Math.random){return n().toString(36).slice(2)}class na extends Promise{fate;resolve;reject;done=!1;constructor(n){let i,o;super((c,p)=>{i=c,o=p});this.resolve=i,this.reject=o,this.use(n instanceof Promise?n:new Promise(n))}pass(n,i){if(n===this.fate)this.resolve(i),this.done=!0}fail(n,i){if(n===this.fate)this.reject(i),this.done=!0}use(n){if(n instanceof Promise){let i=n;this.fate=i,i.then((o)=>{this.pass(i,o)},(o)=>{this.fail(i,o)})}else this.resolve(n),this.fate=void 0}}function Xv(n){return Object.entries(n)}var Gv=(n,i,o=on.STORE)=>{return ia(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function U(n){while(n.child!==null)n=n.child;return n}function zv(n){while(n.parent!==null)n=n.parent;return n}class mn{Subscriber;subscribers=new Map;subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){let i=this.subscribers.values();for(let o of i)o(n)}}class ml extends mn{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function Co(n,i,o){let c={key:i.key,type:"atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","atom_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new mn,x=Object.assign((l)=>{let f=P(l),$={key:i.key,subKey:f},v=`${i.key}(${f})`,w=U(n),F=i.default,M={key:v,default:F instanceof Function?F(l):F};if(i.effects)M.effects=i.effects(l);let J=ko(w,M,$);return a.next({type:"state_creation",token:J}),J},c,{subject:a,install:(l)=>Co(l,i),internalRoles:o});return n.families.set(i.key,x),n.defaults.set(i.key,i.default),c}function uv(n,i){if("mutable"in i)return oa(n,i);return Co(n,i)}function ro(n,i,o){let c={key:i.key,type:"readonly_selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","readonly_selector_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new mn,x=Object.assign((l)=>{let f=P(l),$={key:i.key,subKey:f},v=`${i.key}(${f})`,w=U(n),F=ca(w,{key:v,get:i.get(l)},$);return a.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:a,install:(l)=>ro(l,i),default:(l)=>{return i.get(l)({get:(...$)=>Wn(n,...$),find:($,v)=>Jn(n,$,v),seek:($,v)=>jn(n,$,v),json:($)=>Pn(n,$)})}});return n.families.set(i.key,x),c}function xl(n,i){if("set"in i)return pa(n,i);return ro(n,i)}var h4={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function gc(n,i){let o=P(i),c=`${n.key}(${o})`,p=h4[n.type],a={key:c,type:p};if(p==="molecule")Object.assign(a,{key:i,family:n});else Object.assign(a,{family:{key:n.key,subKey:o}});return Object.assign(a,{counterfeit:!0}),a}function Ci(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class yi{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(n,i)=>`${n}:${i}`;warn;getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let o=this.relations.get(n),c=this.relations.get(i);if(o)o.add(i);else o=new Set([i]),this.relations.set(n,o);if(c)c.add(n);else c=new Set([n]),this.relations.set(i,c)}deleteRelation(n,i){let o=this.relations.get(n);if(o){if(o.delete(i),o.size===0)this.relations.delete(n);let c=this.relations.get(i);if(c){if(c.delete(n),c.size===0)this.relations.delete(i)}}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(let o of i){let c=new Set().add(n);this.relations.set(o,c)}}replaceRelationsSafely(n,i){let o=this.relations.get(n),c=this.isAType?.(n)?n:void 0,p=c===void 0?n:void 0;if(o)for(let a of o){c??=a,p??=a;let m=this.relations.get(a);if(m){if(m.size===1)this.relations.delete(a);else m.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let a of i){let m=this.relations.get(a);if(m)m.add(n);else m=new Set().add(n),this.relations.set(a,m)}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}constructor(n,i){if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,!i?.externalStore)this.relations=new Map(n.relations?.map(([o,c])=>[o,new Set(c)])),this.contents=new Map(n.contents);if(this.isAType=i?.isAType??null,this.isBType=i?.isBType??null,this.isContent=i?.isContent??null,i?.makeContentKey)this.makeContentKey=i.makeContentKey;if(i?.externalStore){let o=i.externalStore;if(this.has=(c,p)=>o.has(c,p),this.addRelation=(c,p)=>{o.addRelation(c,p)},this.deleteRelation=(c,p)=>{o.deleteRelation(c,p)},this.replaceRelationsSafely=(c,p)=>{o.replaceRelationsSafely(c,p)},this.replaceRelationsUnsafely=(c,p)=>{o.replaceRelationsUnsafely(c,p)},this.getRelatedKeys=(c)=>o.getRelatedKeys(c),o.getContent)this.getContentInternal=(c)=>{return o.getContent(c)},this.setContent=(c,p)=>{o.setContent(c,p)},this.deleteContent=(c)=>{o.deleteContent(c)};for(let[c,p]of n.relations??[]){let a=this.isAType?.(c)?c:void 0,m=a===void 0?c:void 0;for(let x of p)a??=x,m??=x,this.addRelation(a,m)}for(let[c,p]of n.contents??[])this.setContent(c,p)}if(i?.warn)this.warn=i.warn}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(n,...i){let o=typeof i[0]==="string"?i[0]:n[this.b],c=i[1]??typeof i[0]==="string"?void 0:i[0];switch(n=typeof n==="string"?n:n[this.a],this.cardinality){case"1:1":{let p=this.getRelatedKey(n);if(p&&p!==o)this.delete(n,p)}case"1:n":{let p=this.getRelatedKey(o);if(p&&p!==n)this.delete(p,o)}}if(c){let p=this.makeContentKey(n,o);this.setContent(p,c)}return this.addRelation(n,o),this}delete(n,i){i=typeof i==="string"?i:n[this.b];let o=typeof n==="string"?n:n[this.a];if(o===void 0&&typeof i==="string"){let c=this.getRelatedKeys(i);if(c)for(let p of c)this.delete(p,i)}if(typeof o==="string"&&i===void 0){let c=this.getRelatedKeys(o);if(c)for(let p of c)this.delete(o,p)}if(typeof o==="string"&&typeof i==="string"){this.deleteRelation(o,i);let c=this.makeContentKey(o,i);this.deleteContent(c)}return this}getRelatedKey(n){let i=this.getRelatedKeys(n);if(i){if(i.size>1)this.warn?.(`${i.size} related keys were found for key "${n}": (${[...i].map((c)=>`"${c}"`).join(", ")}). Only one related key was expected.`);let o;for(let c of i){o=c;break}return o}}replaceRelations(n,i,o){let c=!Array.isArray(i),p=c?Object.keys(i):i;if(o?.reckless)this.replaceRelationsUnsafely(n,p);else this.replaceRelationsSafely(n,p);if(c)for(let a of p){let m=this.makeContentKey(n,a),x=i[a];this.setContent(m,x)}return this}getContent(n,i){let o=this.makeContentKey(n,i);return this.getContentInternal(o)}getRelationEntries(n){let i=n[this.a],o=n[this.b];if(i!==void 0&&o===void 0){let c=this.getRelatedKeys(i);if(c)return[...c].map((p)=>{return[p,this.getContent(i,p)]})}if(i===void 0&&o!==void 0){let c=this.getRelatedKeys(o);if(c)return[...c].map((p)=>{return[p,this.getContent(p,o)]})}return[]}has(n,i){if(i)return this.getRelatedKeys(n)?.has(i)??!1;return this.relations.has(n)}}function kn(n){return"epoch"in n.transactionMeta}function An(n){return"phase"in n.transactionMeta}var Yv=(n)=>{let i=U(n);if(!An(i)){n.logger.warn("\uD83D\uDC1E","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.logger.info("\uD83E\uDE82","transaction",i.transactionMeta.update.key,"Aborting transaction"),i.parent.child=null};var I4=(n)=>n[0].toUpperCase()+n.slice(1);function mo(n){return n.type.split("_").map(I4).join(" ")}class Qi extends Error{constructor(...n){let i=n[0],o=n.length===2?n[1]:n[2];if(n.length===2)super(`${mo(i)} ${P(i.key)} not found in store "${o.config.name}".`);else{let c=n[1];super(`${mo(i)} "${i.key}" member ${P(c)} not found in store "${o.config.name}".`)}}}function Zo(n,i,o){return(...c)=>{let p=d(n,o);if(p)return p.run(c,i);throw new Qi(n,o)}}var pm=(n)=>(i)=>n instanceof Function?n(i):n;var qo=(n,i)=>{if(i.valueMap.has(n.key))return i.logger.info("\uD83D\uDCD6",n.type,n.key,"reading cached value"),Ov(n,i);if(n.type==="selector"||n.type==="readonly_selector")return i.logger.info("\uD83E\uDDEE",n.type,n.key,"computing value"),n.get();let o=n.default instanceof Function?n.default():n.default;return i.logger.info("\uD83D\uDC81","atom",n.key,"could not find cached value; using default",o),n.default instanceof Function?n.default():n.default};var Hv=(n,i)=>{if(n.operation.open){let o=performance.now();return n.logger.info("\u2757",i.type,i.key,`deferring setState at T-${o} until setState for "${n.operation.token.key}" is done`),o}n.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:i},n.logger.info("\u2B55",i.type,i.key,`operation start in store "${n.config.name}"${!An(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},Ev=(n)=>{if(n.operation.open)n.logger.info("\uD83D\uDD34",n.operation.token.type,n.operation.token.key,`operation done in store "${n.config.name}"`);n.operation={open:!1},n.on.operationClose.next(n.operation)},Qv=(n,i)=>{if(!n.operation.open)return n.logger.error("\uD83D\uDC1E","unknown",i,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0;return n.operation.done.has(i)},dc=(n,i)=>{if(!n.operation.open){n.logger.error("\uD83D\uDC1E","unknown",i,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}n.operation.done.add(i)};var sv=(n,i,o)=>{switch(n.type){case"mutable_atom":o.logger.info("\uD83D\uDCE2",n.type,n.key,"is now (",i.newValue,") subscribers:",n.subject.subscribers);break;default:o.logger.info("\uD83D\uDCE2",n.type,n.key,"went (",i.oldValue,"->",i.newValue,") subscribers:",n.subject.subscribers)}n.subject.next(i)};var ll=(n,i)=>{let o=U(i),c=o.selectorAtoms.getRelatedKeys(n.key);if(o.logger.info("\uD83E\uDDF9",n.type,n.key,c?`evicting ${c.size} states downstream:`:"no downstream states",c??"to evict"),c){if(o.operation.open)o.logger.info("\uD83E\uDDF9",n.type,n.key,`[ ${[...o.operation.done].join(", ")} ] already done`);for(let p of c){if(Qv(o,p))continue;Uv(p,o),dc(o,p)}}};function C4(n,i){if(Vv(i.newValue))return!1;if(n.includes("\uD83D\uDD0D"))return!1;return!0}var bv=(n,i,o)=>{let{key:c}=n,p=U(o);if(!An(p)||p.transactionMeta.phase!=="building"){o.logger.error("\uD83D\uDC1E","atom",c,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!C4(c,i))return;let m={type:"atom_update",key:c,...i};if(n.family)m.family=n.family;p.transactionMeta.update.updates.push(m),o.logger.info("\uD83D\uDCC1","atom",c,"stowed (",i.oldValue,"->",i.newValue,")")};var _v=(n,i,o)=>{let c=qo(n,o),p=c;if(n.type==="mutable_atom"&&An(o)){let{parent:m}=o;p=aa(n,m,o)}if(p=pm(i)(p),o.logger.info("\uD83D\uDCDD","atom",n.key,"set to",p),p=ki(n.key,p,n.subject,o),yv(n.key,o))jv(n.key,o);dc(o,n.key),ll(n,o);let a={oldValue:c,newValue:p};if(kn(o))sv(n,a,o);else if(o.parent){if(o.on.transactionApplying.state===null)bv(n,a,o);else if(n.key.startsWith("*")){let m=n.key.slice(1),x=o.atoms.get(m),l=o.valueMap.get(m);if(x.type==="mutable_atom"&&An(o)){let{parent:$}=o;l=aa(x,$,o)}if(l.do(a.newValue)===null)ll(x,o)}}};var am=(n,i,o)=>{switch(n.type){case"atom":case"mutable_atom":_v(n,i,o);break;case"selector":n.set(i);break}};function mm(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function un(n,...i){let o,c,p,a;if(i.length===2){if(o=i[0],a=i[1],c=mm(n,o)??null,c)p=o.family?oi(o.family.subKey):null,o=Jn(n,c,p)}else c=i[0],p=i[1],a=i[2],o=Jn(n,c,p);if("counterfeit"in o){let l=n.disposalTraces.buffer.find((f)=>f?.key===o.key);n.logger.error("\u274C",o.type,o.key,`could not be set because it was not found in the store "${n.config.name}".`,l?`This state was previously disposed:\n${l.trace}`:"No previous disposal trace was found.");return}let m=Hv(n,o);if(m){let l=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${m}`,()=>{l(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${m}`),un(n,o,a)});return}let x=d(o,n);am(x,a,n),Ev(n)}function xm(n,i,o){let{key:c,newValue:p,oldValue:a}=i,m=n==="newValue"?p:a,x={key:c,type:"atom"};if(i.family)Object.assign(x,{family:i.family});un(o,x,m)}function Bv(n,i){let o=new mn,c={type:"molecule_family",key:i.key,dependsOn:i.dependsOn??"all"},p={...c,subject:o,new:i.new};return n.moleculeFamilies.set(i.key,p),c}function xo(n,i,o){let c=bo(o,i,n.key);n.tokens.set(c.key,c);let p=An(o)&&o.transactionMeta.phase==="building",a=o.moleculeInProgress===n.key;if(!p&&!a)n.subject.next({type:"state_creation",token:c});return c}class ci extends Set{mode="record";subject=new mn;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof ci)this.parent=n,this.cacheUpdateNumber=n.cacheUpdateNumber;if(i)this.cacheLimit=i,this.cache=new Array(i),this.subscribe("auto cache",(o)=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=o})}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(n){let i=new ci(n.members,n.cacheLimit);return i.cache=n.cache,i.cacheIdx=n.cacheIdx,i.cacheUpdateNumber=n.cacheUpdateNumber,i}add(n){let i=super.add(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`add:${P(n)}`);return i}clear(){let n=this.mode==="record"?[...this]:null;if(super.clear(),n)this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(n)}`)}delete(n){let i=super.delete(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`del:${P(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new ci(this);let i=this.child._subscribe("transaction",(o)=>{this.transactionUpdates?.push(o)});try{if(n(this.child)){for(let c of this.transactionUpdates)this.doStep(c);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(o){throw console.error("Failed to apply transaction to SetRTX:",o),o}finally{i(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(n,i){return this.subject.subscribe(n,i)}subscribe(n,i){return this.subject.subscribe(n,(o)=>{i(`${this.cacheUpdateNumber}=${o}`)})}emit(n){this.subject.next(n)}doStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.add(JSON.parse(c));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(c));break;case"tx":for(let p of c.split(";"))this.doStep(p)}}getUpdateNumber(n){let i=n.indexOf("=");return Number(n.substring(0,i))}do(n){let i=n.indexOf("="),o=Number(n.substring(0,i)),c=o-this.cacheUpdateNumber;if(c>0){if(c===1){this.mode="playback";let a=n.substring(i+1);return this.doStep(a),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let a=this.cacheIdx+c;if(this.cache[a]===n)return null;this.mode="playback";let x=!1;while(!x){this.cacheIdx%=this.cacheLimit;let f=this.cache[this.cacheIdx];if(this.cacheIdx--,!f)return"OUT_OF_RANGE";this.undo(f),x=this.cacheIdx===a-1}let l=n.substring(i+1);return this.doStep(l),this.mode="record",this.cacheUpdateNumber=o,null}return"OUT_OF_RANGE"}undoStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.delete(JSON.parse(c));break;case"del":this.add(JSON.parse(c));break;case"clear":{let p=JSON.parse(c);for(let a of p)this.add(a);break}case"tx":{let p=c.split(";");for(let a=p.length-1;a>=0;a--)this.undoStep(p[a])}}}undo(n){let i=n.indexOf("=");if(Number(n.substring(0,i))===this.cacheUpdateNumber){this.mode="playback";let c=n.substring(i+1);return this.undoStep(c),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}function Bn(n){return n[0].toUpperCase()+n.slice(1)}class vl{options;defaultContent;toolkit;retrieve;molecules=new Map;relations;states;core;transact(n,i){let o=this.toolkit;this.toolkit=n,i(this),this.toolkit=o}store;alternates;[Symbol.dispose](){this.alternates.delete(this.store.config.name)}in(n){let i=n.config.name,o=this.alternates.get(i);if(o)return o;let c=new vl(this.options,this.defaultContent,n);return this.alternates.set(i,c),c.alternates=this.alternates,c}constructor(n,i,o=on.STORE){this.store=o,this.options=n,this.defaultContent=i,this.alternates=new Map,this.alternates.set(o.config.name,this),this.store.miscResources.set(`join:${n.key}`,this),this.retrieve=(z,R)=>{let O=this.toolkit.seek(z,R);if(O)return O;let b=this.store.molecules.get(P(R));if(b){let H=d(z,o);return xo(b,H,o)}if(o.config.lifespan==="immortal")throw new Qi(z,R,o);return bo(o,z,R)},this.toolkit={get:(...z)=>Wn(o,...z),set:(...z)=>{un(o,...z)},find:this.retrieve,seek:(...z)=>jn(o,...z),json:(z)=>Pn(o,z),dispose:(...z)=>{Gi(o,...z)}};let c=n.between[0],p=n.between[1],a=oa(o,{key:`${n.key}/relatedKeys`,default:()=>new ci,mutable:!0,fromJson:(z)=>ci.fromJSON(z),toJson:(z)=>z.toJSON()},["join","relations"]);this.core={findRelatedKeysState:a};let m=({get:z},R)=>z(this.retrieve(a,R)),x=(z,R,O)=>{let{set:b}=z,H=this.retrieve(a,R),K=this.retrieve(a,O);b(H,(L)=>L.add(O)),b(K,(L)=>L.add(R))},l=(z,R,O)=>{let{set:b}=z,H=this.retrieve(a,R),K=this.retrieve(a,O),L,_;b(H,(q)=>{if(q.delete(O),q.size===0)L=`"${R}"`;return q}),b(K,(q)=>{if(q.delete(R),q.size===0)_=`"${O}"`;return q})},f=(z,R,O)=>{let{get:b,set:H}=z,K=this.retrieve(a,R),L=b(K);for(let _ of L){if(O.includes(_))continue;let cn=this.retrieve(a,_);H(cn,(xn)=>{return xn.delete(R),xn})}H(K,(_)=>{return _.transaction((q)=>{q.clear();for(let cn of O){let xn=m(z,cn),sn=xn.has(R);if(this.relations.cardinality==="1:n"){let _i=[];for(let E of xn){if(E===R)continue;let k=m(z,E);if(k.delete(cn),k.size===0)_i.push(E)}if(!sn&&xn.size>0)xn.clear();for(let E of _i){let k=[cn,E].sort(),wn=`"${k[0]}:${k[1]}"`;this.molecules.delete(wn)}}if(!sn)xn.add(R);q.add(cn)}return!0}),_})},$=(z,R,O)=>{let{set:b}=z,H=this.retrieve(a,R);b(H,(K)=>{return K.transaction((L)=>{for(let _ of O)L.add(_);return!0}),K});for(let K of O){let L=this.retrieve(a,K);b(L,(_)=>{return _.add(R),_})}return!0},v=(z,R,O)=>{let b=m(z,R);return O?b.has(O):b.size>0},w={getRelatedKeys:(z)=>m(this.toolkit,z),addRelation:(z,R)=>{x(this.toolkit,z,R)},deleteRelation:(z,R)=>{l(this.toolkit,z,R)},replaceRelationsSafely:(z,R)=>{f(this.toolkit,z,R)},replaceRelationsUnsafely:(z,R)=>{$(this.toolkit,z,R)},has:(z,R)=>v(this.toolkit,z,R)},F,M,J;if(i){M=Co(o,{key:`${n.key}/content`,default:i},["join","content"]),J=Bv(o,{key:`${n.key}/content-molecules`,new:class H{L;constructor(K,L){this.key=L}}});let z=({get:H},K)=>H(this.retrieve(M,K)),R=({set:H},K,L)=>{H(this.retrieve(M,K),L)},O=(H,K)=>{let L=o.molecules.get(`"${K}"`);if(L)this.toolkit.dispose(L),this.molecules.delete(`"${K}"`)};F=Object.assign(w,{getContent:(H)=>{return z(this.toolkit,H)},setContent:(H,K)=>{R(this.toolkit,H,K)},deleteContent:(H)=>{O(this.toolkit,H)}})}else F=w;let X=new yi(n,{externalStore:F,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...z)=>{let R=z.sort(),O=`${R[0]}:${R[1]}`,[b,H]=R.map((K)=>this.molecules.get(P(K)));if(o.config.lifespan==="immortal"&&b&&H){let K=U(o),L=Vo(K,[b,H],J,O);this.molecules.set(`"${O}"`,d(L,K))}return O}}),G=()=>ro(o,{key:`${n.key}/singleRelatedKey`,get:(z)=>({get:R})=>{let O=this.retrieve(a,z),b=R(O);for(let H of b)return H;return null}},["join","keys"]),u=()=>{return ro(o,{key:`${n.key}/multipleRelatedKeys`,get:(z)=>({get:R})=>{let O=$l(a,o),b=this.retrieve(O,z);return R(b).members}},["join","keys"])},Q=()=>ro(o,{key:`${n.key}/singleRelatedEntry`,get:(z)=>({get:R})=>{let O=this.retrieve(a,z),b=R(O);for(let H of b){let K=X.isAType?.(z)?z:void 0,L=K===void 0?z:void 0;K??=H,L??=H;let _=X.makeContentKey(K,L),q=this.retrieve(M,_),cn=R(q);return[H,cn]}return null}},["join","entries"]),V=()=>ro(o,{key:`${n.key}/multipleRelatedEntries`,get:(z)=>({get:R})=>{let O=$l(a,o),b=this.retrieve(O,z);return R(b).members.map((K)=>{let L=X.isAType?.(z)?z:void 0,_=L===void 0?z:void 0;L??=K,_??=K;let q=X.makeContentKey(L,_),cn=this.retrieve(M,q),xn=R(cn);return[K,xn]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let z=G(),R=`${c}KeyOf${Bn(p)}`,O=`${p}KeyOf${Bn(c)}`,b={[R]:z,[O]:z},H;if(i){let K=Q(),L=`${c}EntryOf${Bn(p)}`,_=`${p}EntryOf${Bn(c)}`,q={[L]:K,[_]:K};H=Object.assign(b,q)}else H=b;this.relations=X,this.states=H;break}case"1:n":{let z=G(),R=u(),O=`${c}KeyOf${Bn(p)}`,b=`${p}KeysOf${Bn(c)}`,H={[O]:z,[b]:R},K;if(i){let L=Q(),_=V(),q=`${c}EntryOf${Bn(p)}`,cn=`${p}EntriesOf${Bn(c)}`,xn={[q]:L,[cn]:_};K=Object.assign(H,xn)}else K=H;this.relations=X,this.states=K;break}default:{let z=u(),R=`${c}KeysOf${Bn(p)}`,O=`${p}KeysOf${Bn(c)}`,b={[R]:z,[O]:z},H;if(i){let K=V(),L=`${c}EntriesOf${Bn(p)}`,_=`${p}EntriesOf${Bn(c)}`,q={[L]:K,[_]:K};H=Object.assign(b,q)}else H=b;this.relations=X,this.states=H}}}}function lm(n,i,o=on.STORE){return fl(o).set(n.key,new vl(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function fl(n){if("joins"in n&&n.joins instanceof Map)return n.joins;let i=new Map;return n.joins=i,i}function ma(n,i){let o=fl(i),c=o.get(n.key);if(c===void 0){if(c=fl(on.STORE).get(n.key)?.in(i),c===void 0)throw new Error(`Join "${n.key}" not found in store "${i.config.name}"`);o.set(n.key,c)}return c}function np(n,i,o){let c=ma(n,o),p;switch(n.cardinality){case"1:1":{let a=`${n.a}KeyOf${Bn(n.b)}`,m=`${n.b}KeyOf${Bn(n.a)}`;p={get[a](){let l=c.states[a];return c.retrieve(l,i)},get[m](){let l=c.states[m];return c.retrieve(l,i)}};let x=`${n.a}EntryOf${Bn(n.b)}`;if(x in c.states){let l=`${n.b}EntryOf${Bn(n.a)}`;Object.assign(p,{get[x](){let f=c.states[x];return c.retrieve(f,i)},get[l](){let f=c.states[l];return c.retrieve(f,i)}})}break}case"1:n":{let a=`${n.a}KeyOf${Bn(n.b)}`,m=`${n.b}KeysOf${Bn(n.a)}`;p={get[a](){let l=c.states[a];return c.retrieve(l,i)},get[m](){let l=c.states[m];return c.retrieve(l,i)}};let x=`${n.a}EntryOf${Bn(n.b)}`;if(x in c.states){let l=`${n.b}EntriesOf${Bn(n.a)}`;Object.assign(p,{get[x](){let f=c.states[x];return c.retrieve(f,i)},get[l](){let f=c.states[l];return c.retrieve(f,i)}})}break}case"n:n":{let a=`${n.a}KeysOf${Bn(n.b)}`,m=`${n.b}KeysOf${Bn(n.a)}`;p={get[a](){let l=c.states[a];return c.retrieve(l,i)},get[m](){let l=c.states[m];return c.retrieve(l,i)}};let x=`${n.a}EntriesOf${Bn(n.b)}`;if(x in c.states){let l=`${n.b}EntriesOf${Bn(n.a)}`;Object.assign(p,{get[x](){let f=c.states[x];return c.retrieve(f,i)},get[l](){let f=c.states[l];return c.retrieve(f,i)}})}}}return p}function Nv(n,i){return np(n,i,on.STORE)}function Fc(n,i,o){let c=ma(n,o),p=U(o);if(An(p)){let{toolkit:a}=p.transactionMeta;c.transact(a,({relations:m})=>{i(m)})}else i(c.relations)}function k4(n,i){return ma(n,i).core.findRelatedKeysState}function Lv(n){return k4(n,on.STORE)}function fm(n){return{store:n}}function Wn(n,...i){let o,c,p;if(i.length===1){if(o=i[0],o.type!=="molecule"){if(c=mm(n,o)??null,c)p=o.family?oi(o.family.subKey):null,o=Jn(n,c,p)}}else{c=i[0],p=i[1];let a;if(c.type==="molecule_family")a=jn(n,c,p)??gc(c,p);else a=Jn(n,c,p);o=a}if("counterfeit"in o&&"family"in o){c=o.type==="molecule"?d(o.family,n):n.families.get(o.family.key);let a=o.type==="molecule"?o.key:o.family.subKey,m=n.disposalTraces.buffer.find((x)=>x?.key===o.key);switch(n.logger.error("\u274C",o.type,o.key,`could not be retrieved because it was not found in the store "${n.config.name}".`,m?`This state was previously disposed:\n${m.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":case"mutable_atom_family":return n.defaults.get(c.key);case"selector_family":case"readonly_selector_family":{if(n.defaults.has(c.key))return n.defaults.get(o.family.key);let x=d(c,n).default(a);return n.defaults.set(c.key,x),x}case"molecule_family":throw new Qi(c,a,n)}}switch(o.type){case"atom":case"mutable_atom":case"selector":case"readonly_selector":return qo(d(o,n),n);case"molecule":return d(o,n).instance}}class ip{i;type="molecule";stringKey;family;_dependsOn;get dependsOn(){if(this.family)return this.family.dependsOn;return this._dependsOn}subject=new mn;tokens=new Map;above=new Map;below=new Map;joins=new Map;instance;constructor(n,i,o){this.key=i;if(this.stringKey=P(i),o)this.family=o,this._dependsOn=o.dependsOn;if(n)for(let c of n)this.above.set(c.stringKey,c)}}function tv(n){return n[0].toUpperCase()+n.slice(1)}function Vo(n,i,o,c,...p){let a=zv(n),m=U(n),x=P(c);m.moleculeInProgress=x;let l=Array.isArray(i)?i:[i],f=l.map((X)=>{if(X instanceof ip)return X;let G=P(X.key),u=n.molecules.get(G);if(!u)throw new Error(`Molecule ${G} not found in store "${n.config.name}"`);return u}),$=new ip(f,c,o);m.molecules.set(x,$);for(let X of f)X.below.set($.stringKey,$);let v={get:(...X)=>Wn(U(a),...X),set:(...X)=>{un(U(a),...X)},seek:(X,G)=>jn(U(a),X,G),json:(X)=>Pn(U(a),X),run:(X,G=Pc())=>Zo(X,G,U(n)),make:(X,G,u,...Q)=>Vo(U(a),X,G,u,...Q),dispose:(X)=>{Gi(U(a),X)},env:()=>fm(U(a)),bond:(X,G)=>{if(X.type==="join"){let{as:u}=G,Q=ma(X,a);Q.molecules.set(x,$),$.joins.set(X.key,Q);let V=w.subject.subscribe(`join:${X.key}-${x}`,(K)=>{if(K.type==="molecule_disposal"){if(P(K.token.key)===x)V(),Q.molecules.delete(x)}});if(u===null)return;let z=X.a===u?X.b:X.a,R=Nv(X,c),O=R[`${z}KeysOf${tv(u)}`],b=R[`${z}EntriesOf${tv(u)}`],H={relatedKeys:O};if(b)H=Object.assign(H,{relatedEntries:b});return H}return xo($,d(X,a),U(a))},claim:(X,G)=>{let{exclusive:u}=G,Q=U(n).molecules.get(P(X.key));if(Q)if(u){for(let V of Q.above.values())V.below.delete(Q.stringKey);Q.above.clear(),Q.above.set($.stringKey,$),$.below.set(Q.stringKey,Q)}else Q.above.set($.stringKey,$),$.below.set(Q.stringKey,Q)},spawn:(X,G,...u)=>Vo(U(n),[$],d(X,n),G,...u)},w=d(o,n),F=w.new;$.instance=new F(v,c,...p);let M={type:"molecule",key:c,family:o},J={type:"molecule_creation",subType:"classic",token:M,family:o,context:l,params:p};if(kn(m))w.subject.next(J);else if(An(m)&&m.on.transactionApplying.state===null)m.transactionMeta.update.updates.push(J);return m.moleculeInProgress=null,M}function wl(n,i,o){switch(i){case"newValue":{Dv(n,o);break}case"oldValue":{Gi(o,n.token);break}}}function Sl(n,i,o){switch(i){case"newValue":{Gi(o,n.token);break}case"oldValue":{Dv(n,o),o.valueMap.set(n.token.key,n.value);break}}}function Dv(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)Jn(i,c,oi(o.subKey))}}function Al(n,i,o){switch(i){case"newValue":switch(n.subType){case"classic":Vo(o,n.context,n.family,n.token.key,...n.params);break;case"modern":Tl(o,n.provenance,n.key);break}break;case"oldValue":switch(n.subType){case"classic":Gi(o,n.token);break;case"modern":xa(o,n.key);break}break}}function Jl(n,i,o){switch(i){case"newValue":switch(n.subType){case"classic":Gi(o,n.token);break;case"modern":xa(o,n.key);break}break;case"oldValue":switch(n.subType){case"classic":{let c=Vo(o,n.context,n.family,n.token.key);for(let[p,a]of n.values){let m=`${p}(${P(c.key)})`,x=d(c,o),l=x.tokens.has(m),f=o.families.get(p);if(f&&!l)xo(x,f,o);o.valueMap.set(m,a)}}break;case"modern":{Tl(o,n.provenance,n.key);for(let[c,p]of n.values){let a=o.families.get(c);if(a){Jn(o,a,n.key);let m=`${c}(${P(n.key)})`;o.valueMap.set(m,p)}}}}break}}function $m(n,i,o){let c=n==="newValue"?i.updates:[...i.updates].reverse();for(let p of c)switch(p.type){case"atom_update":case"selector_update":xm(n,p,o);break;case"state_creation":wl(p,n,o);break;case"state_disposal":Sl(p,n,o);break;case"molecule_creation":Al(p,n,o);break;case"molecule_disposal":Jl(p,n,o);break;case"transaction_update":$m(n,p,o);break}}function hv(n,i,o){if(kn(o)&&n)o.transactionMeta.epoch.set(n,i)}function Iv(n,i,o){if(!kn(o))return;let p=o.transactionMeta.actionContinuities.getRelatedKey(n);if(p!==void 0)o.transactionMeta.epoch.set(p,i)}var Cv=(n,i)=>{let o=U(i),{parent:c}=o;if(c===null||!An(o)||o.transactionMeta?.phase!=="building"){i.logger.warn("\uD83D\uDC1E","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}o.transactionMeta.phase="applying",o.transactionMeta.update.output=n,c.child=null,c.on.transactionApplying.next(o.transactionMeta);let{updates:p}=o.transactionMeta.update;if(i.logger.info("\uD83D\uDEC4","transaction",o.transactionMeta.update.key,`Applying transaction with ${p.length} updates:`,p),$m("newValue",o.transactionMeta.update,c),kn(c))Iv(o.transactionMeta.update.key,o.transactionMeta.update.epoch,c),d({key:o.transactionMeta.update.key,type:"transaction"},i)?.subject.next(o.transactionMeta.update),i.logger.info("\uD83D\uDEEC","transaction",o.transactionMeta.update.key,"Finished applying transaction.");else if(An(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function kv(n,i,o){if(!kn(o))return;let{epoch:p,actionContinuities:a}=o.transactionMeta;if(a.set(n,i),!p.has(n))p.set(n,-1)}class ri extends Map{n;deleted=new Set;constructor(n){super();this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n);return}set(n,i){return this.deleted.delete(n),super.set(n,i)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}var rv=(n,i,o,c)=>{let p=U(o),a={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new ri(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new ri(p.families),operation:{open:!1},readonlySelectors:new ri(p.readonlySelectors),timelines:new ri(p.timelines),timelineTopics:new yi(p.timelineTopics.toJSON()),trackers:new Map,transactions:new ri(p.transactions),selectorAtoms:new yi(p.selectorAtoms.toJSON()),selectorGraph:new yi(p.selectorGraph.toJSON(),{makeContentKey:(...f)=>f.sort().join(":")}),selectors:new ri(p.selectors),valueMap:new ri(p.valueMap),defaults:p.defaults,disposalTraces:o.disposalTraces.copy(),molecules:new ri(p.molecules),moleculeFamilies:new ri(p.moleculeFamilies),moleculeInProgress:p.moleculeInProgress,miscResources:new ri(p.miscResources)},m=Zv(n,o),x={phase:"building",update:{type:"transaction_update",key:n,id:c,epoch:m===void 0?Number.NaN:m+1,updates:[],params:i,output:void 0},toolkit:{get:(...f)=>Wn(l,...f),set:(...f)=>{un(l,...f)},run:(f,$=Pc())=>Zo(f,$,l),find:(f,$)=>Jn(l,f,$),seek:(f,$)=>jn(l,f,$),json:(f)=>Pn(l,f),make:(f,$,v,...w)=>Vo(l,f,$,v,...w),dispose:(...f)=>{Gi(l,...f)},env:()=>fm(l)}},l=Object.assign(a,{transactionMeta:x});return p.child=l,o.logger.info("\uD83D\uDEEB","transaction",n,"Building transaction with params:",i),l};function Fl(n,i){let o={key:n.key,type:"transaction",run:(a,m)=>{let x=rv(n.key,a,i,m);try{let l=U(i),{toolkit:f}=x.transactionMeta,$=n.do(f,...a);return Cv($,l),$}catch(l){throw Yv(c),i.logger.warn("\uD83D\uDCA5","transaction",n.key,"caught:",l),l}},install:(a)=>Fl(n,a),subject:new mn},c=U(i);c.transactions.set(o.key,o);let p=Ci(o);return i.on.transactionCreation.next(p),p}function Zv(n,i){let o=kn(i),c=o?i.transactionMeta.actionContinuities.getRelatedKey(n):void 0;return o&&c!==void 0?i.transactionMeta.epoch.get(c):void 0}class vm{_buffer;_index=0;constructor(n){let i;if(typeof n==="number")i=n;else i=n.length;this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){let n=new vm([...this._buffer]);return n._index=this._index,n}}class qv{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new yi({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new yi({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});trackers=new Map;families=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new yi({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new yi({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new vm(100);molecules=new Map;moleculeFamilies=new Map;moleculeInProgress=null;miscResources=new Map;on={atomCreation:new mn,atomDisposal:new mn,selectorCreation:new mn,selectorDisposal:new mn,timelineCreation:new mn,transactionCreation:new mn,transactionApplying:new ml(null),operationClose:new mn,moleculeCreationStart:new mn,moleculeCreationDone:new mn,moleculeDisposal:new mn};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Rc("warn",(n,i,o)=>!o.includes("\uD83D\uDD0D"))];logger={error:(...n)=>{for(let i of this.loggers)i.error(...n)},info:(...n)=>{for(let i of this.loggers)i.info(...n)},warn:(...n)=>{for(let i of this.loggers)i.warn(...n)}};constructor(n,i=null){if(this.config={...i?.config,...n},i!==null){if(this.valueMap=new Map(i?.valueMap),this.operation={...i?.operation},kn(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new yi(i?.transactionMeta.actionContinuities.toJSON())};for(let[,c]of i.families){if(c.internalRoles?.includes("mutable")||c.internalRoles?.includes("join"))continue;c.install(this)}let o=new Set;for(let[,c]of i.atoms){if(o.has(c.key))continue;if(c.install(this),c.type==="mutable_atom"){let p=Pn(i,c),a=_o(c);o.add(p.key),o.add(a.key)}}for(let[,c]of i.readonlySelectors)c.install(this);for(let[,c]of i.selectors){if(o.has(c.key))continue;c.install(this)}for(let[,c]of i.transactions)c.install(this);for(let[,c]of i.timelines)c.install(this)}}}var on={get STORE(){if(!globalThis.ATOM_IO_IMPLICIT_STORE)globalThis.ATOM_IO_IMPLICIT_STORE=new qv({name:"IMPLICIT_STORE",lifespan:"ephemeral"});return globalThis.ATOM_IO_IMPLICIT_STORE}};function d(n,i){let o,c=i;while(c!==null){switch(n.type){case"atom":case"mutable_atom":o=c.atoms.get(n.key);break;case"selector":o=c.selectors.get(n.key);break;case"readonly_selector":o=c.readonlySelectors.get(n.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":o=c.families.get(n.key);break;case"timeline":o=c.timelines.get(n.key);break;case"transaction":o=c.transactions.get(n.key);break;case"molecule":o=c.molecules.get(P(n.key));break;case"molecule_family":o=c.moleculeFamilies.get(n.key);break}if(o)return o;c=c.child}throw new Qi(n,i)}function Tm(n,i){let o;o=d(n,i);let{family:c}=n;for(let m of o.joins.values())m.relations.delete(o.key),m.molecules.delete(o.stringKey);let p=[];for(let m of o.above.values())p.push(Ci(m));let a=[];for(let m of o.tokens.values()){let x=m.family;a.push([x.key,i.valueMap.get(m.key)])}if(c){let m=d(c,i),x={type:"molecule_disposal",subType:"classic",token:n,family:c,context:p,values:a};if(n.family)x.family=n.family;for(let f of o.tokens.values())Gi(i,f);for(let f of o.below.values())if(f.dependsOn==="all")Tm(f,i);else if(f.above.delete(o.stringKey),f.above.size===0)Tm(f,i);if(o.below.clear(),An(i)&&i.transactionMeta.phase==="building")i.transactionMeta.update.updates.push(x);else m.subject.next(x);i.molecules.delete(o.stringKey)}for(let m of o.above.values())m.below.delete(o.stringKey)}function bo(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Qi(i,n);let p=c(o),a=U(n);if(p.family&&a.moleculeInProgress===null){if(kn(a))switch(p.type){case"atom":case"mutable_atom":n.on.atomCreation.next(p);break;case"selector":case"readonly_selector":n.on.selectorCreation.next(p);break}else if(An(a)&&a.on.transactionApplying.state===null)a.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function jn(n,i,o){let c=P(o),p=`${i.key}(${c})`,a=U(n),m;switch(i.type){case"atom_family":case"mutable_atom_family":m=a.atoms.get(p);break;case"selector_family":m=a.selectors.get(p);break;case"readonly_selector_family":m=a.readonlySelectors.get(p);break;case"molecule_family":m=a.molecules.get(P(o))}if(m)return Ci(m);return m}function Jn(n,i,o){let c=jn(n,i,o);if(c)return c;let p=n.molecules.get(P(o));if(p)return xo(p,i,n);if(n.config.lifespan==="immortal"){let a=gc(i,o);return n.logger.error("\u274C",a.type,a.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),a}return c=bo(n,i,o),c}function Gi(n,...i){let o,c;if(i.length===1)o=i[0],c=o.key;else{let a=i[0],m=i[1];o=a.type==="molecule_family"?jn(n,a,m)??gc(a,m):Jn(n,a,m)}try{d(o,n)}catch(a){let m=n.disposalTraces.buffer.find((x)=>x?.key===o.key);n.logger.error("\u274C",o.type,o.key,`could not be disposed because it was not found in the store "${n.config.name}".`,m?`\n This state was most recently disposed\n${m.trace}`:"No previous disposal trace was found.");return}switch(o.type){case"atom":case"mutable_atom":Rl(o,n);break;case"selector":case"readonly_selector":ev(o,n);break;case"molecule":Tm(o,n);break}let{stack:p}=new Error;if(p){let a=p?.split("\n")?.slice(3)?.join("\n");n.disposalTraces.add({key:o.key,trace:a})}}var wm=(n,i)=>U(i).atoms.has(n),r4=(n,i)=>U(i).selectors.has(n),Z4=(n,i)=>U(i).readonlySelectors.has(n),Pv=(n,i)=>wm(n,i)||r4(n,i)||Z4(n,i);var Sm=(n,i)=>{return U(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>Pv(c,i))};var Ml=(n,i,o)=>{let c=[],p=Sm(n,o);while(p.length>0){let a=p.shift();if(i.has(a))continue;if(i.add(a),!wm(a,o))p.push(...Sm(a,o));else if(!c.includes(a))c.push(a)}return c},gv=(n,i)=>{let o=n.key,c=Sm(o,i),p=new Set;return c.flatMap((a)=>wm(a,i)?a:Ml(a,p,i))};var dv=(n,i,o,c)=>{let p=U(c);if(i.type==="atom"||i.type==="mutable_atom")p.selectorAtoms.set({selectorKey:n,atomKey:i.key}),c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atom "${i.key}"`);else{let a=Ml(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${a.map((m)=>`"${m}"`).join(", ")} ]`);for(let m of a)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:m})}o.add(i.key)};var Am=(n,i,o)=>({get:(...c)=>{let p=U(o),a;if(c.length===2){let[l,f]=c;switch(l.type){case"molecule_family":return Wn(o,l,f);default:if(o.config.lifespan==="ephemeral")a=Jn(o,l,f);else{let $=jn(o,l,f);if($)a=$;else throw new Qi(l,f,o)}}}else[a]=c;if(a.type==="molecule")return Wn(o,a);let m=d(a,o),x=qo(m,o);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${a.key}" =`,x,")"),p.selectorGraph.set({upstreamSelectorKey:a.key,downstreamSelectorKey:n},{source:a.key}),dv(n,a,i,o),x},set:(...c)=>{let p,a;if(c.length===2)p=c[0],a=c[1];else{let l=c[0],f=c[1];a=c[2];let $=o.config.lifespan==="ephemeral"?Jn(o,l,f):jn(o,l,f);if(!$)throw new Qi(l,f,o);p=$}let m=U(o),x=d(p,m);am(x,a,m)},find:(c,p)=>Jn(o,c,p),seek:(c,p)=>jn(o,c,p),json:(c)=>Pn(o,c)});var ca=(n,i,o)=>{let c=U(n),p=new mn,a=new Set,{get:m,find:x,seek:l,json:f}=Am(i.key,a,c),$=()=>{let M=i.get({get:m,find:x,seek:l,json:f});return ki(i.key,M,p,U(n)),a.clear(),M},v={...i,subject:p,install:(M)=>ca(M,i,o),get:$,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,v);let w=$();n.logger.info("\u2728",v.type,v.key,"=",w);let F={key:i.key,type:"readonly_selector"};if(o)F.family=o;return F};var la=(n,i,o)=>{let c=U(n),p=new mn,a=new Set,m=Am(i.key,a,c),{find:x,get:l,seek:f,json:$}=m,v={find:x,get:l,seek:f,json:$},w=(G=i.get,u=U(n))=>{let Q=G(v);return ki(i.key,Q,p,u),a.clear(),Q},M={...i,subject:p,install:(G)=>la(G,i,o),get:w,set:(G)=>{let u=U(n),Q=w(i.get,u),V=pm(G)(Q);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",Q,"->",V,")"),ki(i.key,V,p,u),dc(u,i.key),kn(u))p.next({newValue:V,oldValue:Q});i.set(m,V)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,M);let J=w();n.logger.info("\u2728",M.type,M.key,"=",J);let X={key:i.key,type:"selector"};if(o)X.family=o;return X};function ia(n,i){if("set"in i){let p=la(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=ca(n,i,void 0);return n.on.selectorCreation.next(c),c}function ev(n,i){let o=U(i),{key:c}=n,p=d(n,o);if(!p.family)i.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{let a=o.molecules.get(p.family.subKey);if(a)a.tokens.delete(c);switch(n.type){case"selector":o.selectors.delete(c),d({key:p.family.key,type:"selector_family"},i).subject.next({type:"state_disposal",token:n});break;case"readonly_selector":o.readonlySelectors.delete(c),d({key:p.family.key,type:"readonly_selector_family"},i).subject.next({type:"state_disposal",token:n});break}if(o.valueMap.delete(c),o.selectorAtoms.delete(c),o.selectorGraph.delete(c),i.logger.info("\uD83D\uDD25",n.type,c,"deleted"),An(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.selectorDisposal.next(n)}}function pa(n,i,o){let c={key:i.key,type:"selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","selector_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new mn,x=Object.assign((l)=>{let f=P(l),$={key:i.key,subKey:f},v=`${i.key}(${f})`,w=U(n),F=la(w,{key:v,get:i.get(l),set:i.set(l)},$);return a.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:a,install:(l)=>pa(l,i),default:(l)=>{return i.get(l)({get:(...$)=>Wn(n,...$),find:($,v)=>Jn(n,$,v),seek:($,v)=>jn(n,$,v),json:($)=>Pn(n,$)})}});return n.families.set(i.key,x),c}function nT(n,i,o=on.STORE){let c=pa(o,{key:`${n.key}:JSON`,get:(a)=>({seek:m,get:x})=>{let l=m(n,a);if(l)return i.toJson(x(l));let f=P(a),$=o.molecules.get(f);if($){let w=xo($,n,o);return i.toJson(x(w))}if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${f}"`);let v=bo(o,n,a);return i.toJson(x(v))},set:(a)=>({seek:m,set:x},l)=>{let f=m(n,a);if(f)x(f,i.fromJson(l));else{let $=P(a),v=o.molecules.get($);if(v){let w=xo(v,n,o);x(w,i.fromJson(l))}else{if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${$}"`);x(bo(o,n,a),i.fromJson(l))}}}},["mutable","json"]);return d(n,o).subject.subscribe(`store=${o.config.name}::json-selector-family`,(a)=>{if(a.token.family)jn(o,c,oi(a.token.family.subKey))}),c}var oi=(n)=>JSON.parse(n),P=(n)=>JSON.stringify(n),vH=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var iT=(n,i)=>{let o=U(i);if(o.operation.open)return o.operation.prev.get(n.key);return o.valueMap.get(n.key)};var Xl=(n,i)=>{let o=U(i);return gv(n,i).map((p)=>{let a=o.atoms.get(p);if(a===void 0)throw new Error(`Atom "${p}", a dependency of selector "${n.key}", not found in store "${i.config.name}".`);return a.subject.subscribe(`${n.type}:${n.key}`,(m)=>{i.logger.info("\uD83D\uDCE2",n.type,n.key,"root",p,"went",m.oldValue,"->",m.newValue);let x=iT(n,o),l=qo(n,o);i.logger.info("\u2728",n.type,n.key,"went",x,"->",l),n.subject.next({newValue:l,oldValue:x})})})};function zi(n,i,o,c){function p(v){if(c.operation.open){let w=c.on.operationClose.subscribe(`state subscription ${o}`,()=>{w(),i(v)})}else i(v)}let a=d(n,c);c.logger.info("\uD83D\uDC40",a.type,a.key,`Adding subscription "${o}"`);let m=a.type==="selector"||a.type==="readonly_selector",x=null,l=p;if(m)x=Xl(a,c),l=(v)=>{if(x)x.length=0,x.push(...Xl(a,c));p(v)};let f=a.subject.subscribe(o,l);return()=>{if(c.logger.info("\uD83D\uDE48",a.type,a.key,`Removing subscription "${o}"`),f(),x)for(let v of x)v()}}var Kl=(n,i,o,c)=>{let p=d(n,c);c.logger.info("\uD83D\uDC40","timeline",n.key,`Adding subscription "${o}"`);let a=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","timeline",n.key,`Removing subscription "${o}" from timeline`),a()}};var Wl=(n,i,o,c)=>{let p=d(n,c);c.logger.info("\uD83D\uDC40","transaction",n.key,`Adding subscription "${o}"`);let a=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","transaction",n.key,`Removing subscription "${o}"`),a()}};class eo{Update;initializeState(n,i){let o=`*${n.key}`;i.atoms.delete(o),i.valueMap.delete(o);let c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,p=ko(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let a=i.parent.valueMap.get(o);i.valueMap.set(o,a)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${An(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=Wn(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(a)=>{un(o,i,a)}),this.unsubscribeFromState=zi(n,(a)=>{if(a.newValue!==a.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=a.newValue.subscribe(c,(m)=>{un(o,i,m)})},c,o)}updateCore(n,i,o){let c=`tracker:${o.config.name}:${An(o)?o.transactionMeta.update.key:"main"}:${n.key}`;zi(i,({newValue:p,oldValue:a})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let f=Kl({key:m,type:"timeline"},($)=>{f(),un(o,n,(v)=>{if($==="redo"&&p)v.do(p);else if($==="undo"&&a)v.undo(a);return v})},c,o);return}}let x=o.on.operationClose.subscribe(c,()=>{x();let l=Wn(o,n),f=p===null?-1:l.getUpdateNumber(p),$=f-l.cacheUpdateNumber;if(p&&$===1)un(o,n,(v)=>(v.do(p),v));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${l.cacheUpdateNumber+1}, but got ${f}`)})},c,o)}mutableState;latestUpdateState;dispose;constructor(n,i){this.mutableState=n;let o=U(i);this.latestUpdateState=this.initializeState(n,o),this.observeCore(n,this.latestUpdateState,o),this.updateCore(n,this.latestUpdateState,o),o.trackers.set(n.key,this),this.dispose=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),o.trackers.delete(n.key)}}}function fa(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=U(n),p=c.atoms.get(i.key);if(p&&p.type==="mutable_atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),Ci(p);let a=new mn,m={...i,type:"mutable_atom",install:(f)=>{return f.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${f.config.name}"`),fa(f,i,o)},subject:a};if(o)m.family=o;let x=i.default();c.atoms.set(m.key,m),Jm(i.key,n),ki(i.key,x,a,c);let l=Ci(m);if(i.effects){let f=0,$=[];for(let v of i.effects){let w=v({setSelf:(F)=>{un(n,l,F)},onSet:(F)=>zi(l,F,`effect[${f}]`,n)});if(w)$.push(w);++f}m.cleanup=()=>{for(let v of $)v()}}if(new eo(l,n),!o)Gv(l,i,n);return l}class Gl{Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=Co(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=d(o,i),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=oi(c.token.family.subKey);jn(i,this.latestUpdateAtoms,p),new eo(c.token,i)}}),this.latestUpdateAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=oi(c.token.family.subKey),a=jn(i,this.mutableAtoms,p);if(a)new eo(a,i)}})}}function oa(n,i,o){let c={key:i.key,type:"mutable_atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","mutable_atom_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new mn,x=Object.assign((l)=>{let f=P(l),$={key:i.key,subKey:f},v=`${i.key}(${f})`,w=U(n),F={key:v,default:()=>i.default(l),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)F.effects=i.effects(l);let M=fa(w,F,$);return a.next({type:"state_creation",token:M}),M},c,{subject:a,install:(l)=>oa(l,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,x),nT(x,i,n),new Gl(x,n),c}var $l=(n,i)=>{let o=U(i),c=`${n.key}:JSON`;return o.families.get(c)};var Pn=(n,i)=>{if(i.family){let c=U(n),a={key:`${i.family.key}:JSON`,type:"selector_family"},m=d(a,c),x=JSON.parse(i.family.subKey);return Jn(n,m,x)}return{type:"selector",key:`${i.key}:JSON`}};var _o=(n)=>{let o={type:"atom",key:`*${n.key}`};if(n.family)o.family={key:`*${n.family.key}`,subKey:n.family.subKey};return o};function Vv(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function aa(n,i,o){let c=i.valueMap.get(n.key),p=o.valueMap.get(n.key);if(c===p){if(c===void 0)return typeof n.default==="function"?n.default():n.default;i.logger.info("\uD83D\uDCC3","atom",n.key,"copying");let a=n.toJson(c),m=n.fromJson(a);return o.valueMap.set(n.key,m),new eo(n,i),m}return p}function ki(n,i,o,c){let p=c.valueMap.get(n);if(p instanceof na)p.use(i);if(i instanceof Promise){let a=new na(i);return c.valueMap.set(n,a),a.then((m)=>{ki(n,m,o,c),o.next({newValue:m,oldValue:a})}).catch((m)=>{c.logger.error("\uD83D\uDCA5","state",n,"rejected:",m)}),a}return c.valueMap.set(n,i),i}var Ov=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&An(i)){let{parent:c}=i;o=aa(n,c,i)}return o},Uv=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof na){let c=o,p=i.selectors.get(n)??i.readonlySelectors.get(n);if(p)c.use(p.get());return}if(i.operation.open)i.operation.prev.set(n,o);i.valueMap.delete(n),i.logger.info("\uD83D\uDDD1","state",n,"evicted")};var yv=(n,i)=>{return U(i).atomsThatAreDefault.has(n)},Jm=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(n)},jv=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(U(i).atomsThatAreDefault),o.atomsThatAreDefault.delete(n)};function ko(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=U(n),p=c.atoms.get(i.key);if(p&&p.type==="atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),Ci(p);let a=new mn,m={...i,type:"atom",install:(f)=>{return f.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${f.config.name}"`),ko(f,i,o)},subject:a};if(o)m.family=o;let x=i.default;if(i.default instanceof Function)x=i.default();c.atoms.set(m.key,m),Jm(i.key,n),ki(i.key,x,a,c);let l=Ci(m);if(i.effects){let f=0,$=[];for(let v of i.effects){let w=v({setSelf:(F)=>{un(n,l,F)},onSet:(F)=>zi(l,F,`effect[${f}]`,n)});if(w)$.push(w);++f}m.cleanup=()=>{for(let v of $)v()}}return l}function oT(n,i){if("mutable"in i){let p=fa(n,i,void 0);return n.on.atomCreation.next(p),p}let c=ko(n,i,void 0);return n.on.atomCreation.next(c),c}function Rl(n,i){let o=U(i),{key:c}=n,p=d(n,o);if(!p.family)i.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{p.cleanup?.();let a=i.valueMap.get(p.key);d({key:p.family.key,type:"atom_family"},i).subject.next({type:"state_disposal",token:n,value:a});let x=o.molecules.get(p.family.subKey);if(x)x.tokens.delete(c);if(o.atoms.delete(c),o.valueMap.delete(c),o.selectorAtoms.delete(c),o.atomsThatAreDefault.delete(c),i.timelineTopics.delete(c),n.type==="mutable_atom"){let l=_o(n);Rl(l,i),i.trackers.delete(c)}if(i.logger.info("\uD83D\uDD25","atom",c,"deleted"),An(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.atomDisposal.next(n)}}var DQ=Symbol("provenance");function Tl(n,i,o){let c=P(o);try{let p=[],a;if(i==="root")p.push(n.molecules.get('"root"')),a="all";else if(typeof i==="string"&&i.startsWith(q4)){a="any";let $=P(i),v=n.molecules.get($);if(!v)throw new Error(`Molecule ${$} not found in store "${n.config.name}"`);p.push(v)}else if(o.startsWith("T$--")){a="all";for(let v of i){let w=P(v),F=n.molecules.get(w);if(!F)throw new Error(`Molecule ${w} not found in store "${n.config.name}"`);p.push(F)}}else{a="any";let v=P(i),w=n.molecules.get(v);if(!w)throw new Error(`Molecule ${v} not found in store "${n.config.name}"`);p.push(w)}let m=new ip(p,o);m._dependsOn=a,n.molecules.set(c,m);for(let $ of p)$.below.set(m.stringKey,m);let x={type:"molecule_creation",subType:"modern",key:m.key,provenance:i},l=U(n);if(An(l)&&l.transactionMeta.phase==="building")l.transactionMeta.update.updates.push(x);else l.on.moleculeCreationStart.next(x)}catch(p){if(p instanceof Error)n.logger.error("\u274C","molecule",c,"allocation failed:",p.message)}return o}function xa(n,i){let o=P(i),c=n.molecules.get(o);if(!c)throw new Error(`Molecule ${o} not found in store "${n.config.name}"`);for(let f of c.joins.values())f.relations.delete(c.key),f.molecules.delete(c.stringKey);let p;if(c.above.size===1)p=c.above.values().next().value.key;else p=[...c.above.values()].map(({key:f})=>f);let a=[];for(let f of c.tokens.values()){let $=f.family;a.push([$.key,n.valueMap.get(f.key)])}for(let f of c.tokens.values())Gi(n,f);for(let f of c.below.values())if(f.dependsOn==="all")xa(n,f.key);else if(f.above.delete(c.stringKey),f.above.size===0)xa(n,f.key);c.below.clear();let m={type:"molecule_disposal",subType:"modern",key:c.key,values:a,provenance:p},x=U(n);if(An(x)&&x.transactionMeta.phase==="building")x.transactionMeta.update.updates.push(m);else x.on.moleculeDisposal.next(m);x.molecules.delete(c.stringKey);for(let f of c.above.values())f.below.delete(c.stringKey)}var q4="T$";function Po(n){return oT(on.STORE,n)}function Mc(n){return uv(on.STORE,n)}var zl=(n)=>(i,o,c,p,...a)=>{console[n](`${i} ${o} "${c}" ${p}`,...a)},e4={error:zl("error"),info:zl("info"),warn:zl("warn")};class Rc{n;i;o;constructor(n,i,o=e4){this.logLevel=n;this.filter=i;this.logger=o}error=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!==null)this.logger.error(...n)};info=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel==="info")this.logger.info(...n)};warn=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!=="error"&&this.logLevel!==null)this.logger.warn(...n)}}function Fm(n){return xl(on.STORE,n)}function Kc(n){return Fl(n,on.STORE)}class op{n;listeners;globalListeners;handleEvent(n,...i){for(let c of this.globalListeners)c(n,...i);let o=this.listeners.get(n);if(o)for(let c of o)c(...i)}id="no_id_retrieved";constructor(n){this.emit=n;this.listeners=new Map,this.globalListeners=new Set}on(n,i){let o=this.listeners.get(n);if(o)o.add(i);else this.listeners.set(n,new Set([i]));return this}onAny(n){return this.globalListeners.add(n),this}off(n,i){let o=this.listeners.get(n);if(o)if(i)o.delete(i);else this.listeners.delete(n);return this}offAny(n){return this.globalListeners.delete(n),this}}class $a extends op{n;i;o;incompleteData="";unprocessedEvents=[];incompleteLog="";unprocessedLogs=[];id="#####";handleLog(n){if(Array.isArray(n)){let[i,...o]=n;switch(i){case"i":this.logger.info(this.id,this.key,...o);break;case"w":this.logger.warn(this.id,this.key,...o);break;case"e":this.logger.error(this.id,this.key,...o);break}}}constructor(n,i,o=console){super((c,...p)=>{let a=JSON.stringify([c,...p])+"\x03",m=(x)=>{if(x.code==="EPIPE")console.error("EPIPE error during write",this.process.stdin);this.process.stdin.removeListener("error",m)};return this.process.stdin.once("error",m),this.process.stdin.write(a),this});this.process=n;this.key=i;this.logger=o;if(this.process=n,this.process.stdout.on("data",(c)=>{let p=c.toString();if(p==="\u2728")return;this.unprocessedEvents.push(...p.split("\x03"));let a=this.unprocessedEvents.shift();this.incompleteData+=a??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let m=oi(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let x=this.unprocessedEvents.shift();if(x){if(this.unprocessedEvents.length===0)this.incompleteData=x;m=oi(x),this.handleEvent(...m)}}this.incompleteData=""}catch(m){console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.warn(this.incompleteData),console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.error(m)}}),this.process.stderr.on("data",(c)=>{let p=c.toString();this.unprocessedLogs.push(...p.split("\x03"));let a=this.unprocessedLogs.shift();this.incompleteLog+=a??"";try{let m=oi(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=oi(this.incompleteLog),this.handleLog(m)}catch(m){console.error("\u274C\u274C\u274C"),console.error(this.incompleteLog),console.error(m),console.error("\u274C\u274C\u274C\uFE0F")}}),n.pid)this.id=n.pid.toString()}}class cT extends op{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new mn,this.out=new mn,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class ul extends op{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(P(n.map((i)=>i instanceof ci?`{ ${i.toJSON().members.join(" | ")} }`:i))+"\x03")}logger={info:(...n)=>{this.log("i",...n)},warn:(...n)=>{this.log("w",...n)},error:(...n)=>{this.log("e",...n)}};constructor(){super((n,...i)=>{let o=JSON.stringify([n,...i]);return this.process.stdout.write(o+"\x03"),this});if(this.process=process,this.process.stdin.resume(),this.relays=new Map,this.relayServices=[],this.process.stdin.on("data",(n)=>{let i=n.toString();this.unprocessedEvents.push(...i.split("\x03"));let o=this.unprocessedEvents.shift();this.incompleteData+=o??"";try{let c=oi(this.incompleteData);this.logger.info("\uD83C\uDFB0","received",c),this.handleEvent(...c);while(this.unprocessedEvents.length>0){let p=this.unprocessedEvents.shift();if(p){if(this.unprocessedEvents.length===0)this.incompleteData=p;let a=oi(p);this.handleEvent(...a)}}this.incompleteData=""}catch(c){if(c instanceof Error)this.logger.error("\u2757",c.message,c.cause,c.stack)}}),this.on("exit",()=>{this.logger.info("\uD83D\uDD25",this.id,'received "exit"'),process.exit(0)}),process.on("exit",(n)=>{this.logger.info("\uD83D\uDD25",this.id,`exited with code ${n}`)}),process.on("end",()=>{this.logger.info("\uD83D\uDD25",this.id,"ended"),process.exit(0)}),process.on("SIGTERM",()=>{this.logger.error("\uD83D\uDD25",this.id,"terminated"),process.exit(0)}),process.on("SIGINT",()=>{this.logger.error("\uD83D\uDD25",this.id,"interrupted"),process.exit(0)}),process.pid)this.id=process.pid?.toString();this.on("user-joins",(n)=>{this.logger.info("\uD83D\uDC64","user",n,"joined");let i=new cT(`user:${n}`);this.relays.set(n,i),this.logger.info("\uD83D\uDD17","attaching services:",`[${[...this.relayServices.keys()].join(", ")}]`);for(let o of this.relayServices){let c=o(i);if(c)i.disposalFunctions.push(c)}this.on(`user:${n}`,(...o)=>{i.in.next(o)}),i.out.subscribe("socket",(o)=>{this.emit(...o)})}),this.on("user-leaves",(n)=>{let i=this.relays.get(n);if(this.off(`relay:${n}`),i)i.dispose(),this.relays.delete(n)}),process.stdout.write("\u2728")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}class pT extends Map{set(n,i){if(this.has(n))return console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this;return super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}class Rm{n;type="continuity";globals=[];actions=[];perspectives=[];constructor(n){this.key=n}static existing=new pT;static create(n,i){let o=new Rm(n),{type:c,globals:p,actions:a,perspectives:m}=i(o),x={type:c,key:n,globals:p,actions:a,perspectives:m};return Rm.existing.set(n,x),x}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function aT(n){let{key:i,config:o}=n,c=Rm.create(i,o),{actions:p}=c;for(let a of p)kv(i,a.key,on.STORE);return hv(i,-1,on.STORE),c}var Rs=Po({key:"usersInRoomIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Yl=Po({key:"roomIndex",default:()=>new ci,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),P4={enteredAtEpoch:0},va=lm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},P4),Ms=Fm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=Lv(va);return[i(o,n)]}});import{spawn as g4}from"child_process";var Ol=Mc({key:"roomArguments",default:["echo",["Hello World!"]]}),mT=Fm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Ol,n),p=i(c),[a,m]=p,x=await new Promise((l)=>{let f=g4(a,m,{env:process.env}),$=(v)=>{if(v.toString()==="\u2728")f.stdout.off("data",$),l(f)};f.stdout.on("data",$)});return new $a(x,n)}});var bs=Kc({key:"createRoom",do:({get:n,set:i,find:o},c,p,a)=>{let m=a?[p,a]:[p],x=o(Ol,c);i(x,m),i(Yl,($)=>$.add(c));let l=o(mT,c);return n(l)}}),Vs=Kc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return Fc(va,(a)=>{a.set({room:i,user:o},p)},n.env().store),p}}),_s=Kc({key:"leaveRoom",do:(n,i,o)=>{Fc(va,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),ys=Kc({key:"destroyRoom",do:(n,i)=>{Fc(va,(o)=>{o.delete({room:i})},n.env().store),n.set(Yl,(o)=>(o.delete(i),o))}});function Hl(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Hl(n,o.updates);return{...o,updates:c}}default:return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":return n.includes(o.token.key);case"molecule_creation":return!0;case"transaction_update":return!0}})}var Ns=Mc({key:"transactionRedactor",default:{occlude:(n)=>n}}),xT=Mc({key:"unacknowledgedUpdates",default:()=>[]});var Mm=Mc({key:"sockets",default:null}),El=Po({key:"socketsIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Ql=Po({key:"usersIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Wc=lm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function lT({socket:n,store:i=on.STORE}){return function o(c){let p=n,a=c.key,m=np(Wc,`socket::${p.id}`,i).userKeyOfSocket,x=Wn(i,m);if(!x)return i.logger.error("\u274C","continuity",a,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let l=np(Wc,x,i).socketKeyOfUser;zi(l,({newValue:G})=>{if(i.logger.info("\uD83D\uDC4B","continuity",a,`seeing ${x} on new socket ${G}`),G===null){i.logger.warn("\u274C","continuity",a,`User (${x}) is not connected to a socket, waiting for them to reappear.`);return}let u=Jn(i,Mm,G);p=Wn(i,u);for(let V of $)p?.emit(`tx-new:${a}`,V)},`sync-continuity:${a}:${x}`,i);let f=Jn(i,xT,x),$=Wn(i,f),v=[],F=(()=>{let G=[];for(let u of c.perspectives){let{viewAtoms:Q}=u,V=Jn(i,Q,x),z=zi(V,({oldValue:R,newValue:O})=>{let b=R.map((_)=>_.key),H=O.map((_)=>_.key),K=R.filter((_)=>!H.includes(_.key)),L=O.filter((_)=>!b.includes(_.key)).flatMap((_)=>{let q=_.type==="mutable_atom"?Pn(i,_):_,cn=Wn(i,q);return[q,cn]});if(i.logger.info("\uD83D\uDC41","atom",u.resourceAtoms.key,`${x} has a new perspective`,{oldKeys:b,newKeys:H,revealed:L,concealed:K}),L.length>0)p?.emit(`reveal:${a}`,L);if(K.length>0)p?.emit(`conceal:${a}`,K)},`sync-continuity:${a}:${x}:perspective:${u.resourceAtoms.key}`,i);G.push(z)}return()=>{for(let u of G)u()}})(),M=()=>{let G=[];for(let Q of c.globals){let V=Q.type==="mutable_atom"?Pn(i,Q):Q,z=Wn(i,V);G.push(V,z)}for(let Q of c.perspectives){let{viewAtoms:V,resourceAtoms:z}=Q,R=Jn(i,V,x),O=Wn(i,R);i.logger.info("\uD83D\uDC41","atom",z.key,`${x} can see`,{viewAtoms:V,resourceAtoms:z,userView:O});for(let b of O){let H=b.type==="mutable_atom"?Pn(i,b):b,K=Wn(i,H);G.push(H,K)}}let u=kn(i)?i.transactionMeta.epoch.get(a)??null:null;p?.emit(`continuity-init:${a}`,u,G);for(let Q of c.actions){let V=Wl(Q,(z)=>{try{let R=c.globals.map((H)=>{if(H.type==="atom")return H.key;return _o(H).key}).concat(c.perspectives.flatMap((H)=>{let{viewAtoms:K}=H,L=Jn(i,K,x);return Wn(i,L).map((q)=>{return q.type==="mutable_atom"?"*"+q.key:q.key})})),O=Hl(R,z.updates),b={...z,updates:O};un(i,f,(H)=>{if(b)H.push(b),H.sort((K,L)=>K.epoch-L.epoch);return H}),p?.emit(`tx-new:${a}`,b)}catch(R){if(R instanceof Error)i.logger.error("\u274C","continuity",a,`failed to send update from transaction ${Q.key} to ${x}`,R.message)}},`sync-continuity:${a}:${x}`,i);v.push(V)}};p.off(`get:${a}`,M),p.on(`get:${a}`,M);let J=(G)=>{i.logger.info("\uD83D\uDECE\uFE0F","continuity",a,"received",G);let{key:u,id:Q}=G,V=`tx-run:${u}:${Q}`,z=`${V}:start`,R=`${V}:end`;performance.mark(z);try{Zo({type:"transaction",key:u},Q,i)(...G.params)}catch(L){if(L instanceof Error)i.logger.error("\u274C","continuity",a,`failed to run transaction ${u} with update ${Q}`,L.message)}performance.mark(R);let O=performance.measure(V,z,R);i?.logger.info("\uD83D\uDE80","transaction",u,Q,O.duration);let b=`valuesOfCardsView("${x}")`,H=i.selectorAtoms.getRelatedKeys(b),K=i.valueMap.get(b);i.logger.info("\uD83D\uDC41","continuity",a,`seeing ${x} card values`,{valuesOfCardsViewKey:b,rootsOfCardValueView:H,myCardValueView:K})};p.off(`tx-run:${a}`,J),p.on(`tx-run:${a}`,J);let X=(G)=>{if(i.logger.info("\uD83D\uDC4D","continuity",a,`${x} acknowledged epoch ${G}`),$[0]?.epoch===G)un(i,f,(Q)=>{return Q.shift(),Q})};return p?.on(`ack:${a}`,X),()=>{for(let G of v)G();p?.off(`ack:${a}`,X),F(),p?.off(`get:${a}`,M),p?.off(`tx-run:${a}`,J)}}}var IM=al(af(),1);var S=Symbol.for("drizzle:entityKind"),UU=Symbol.for("drizzle:hasOwnEntityKind");function Y(n,i){if(!n||typeof n!=="object")return!1;if(n instanceof i)return!0;if(!Object.prototype.hasOwnProperty.call(i,S))throw new Error(`Class "${i.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let o=Object.getPrototypeOf(n).constructor;if(o)while(o){if(S in o&&o[S]===i[S])return!0;o=Object.getPrototypeOf(o)}return!1}class Vn{constructor(n,i){this.table=n,this.config=i,this.name=i.name,this.keyAsName=i.keyAsName,this.notNull=i.notNull,this.default=i.default,this.defaultFn=i.defaultFn,this.onUpdateFn=i.onUpdateFn,this.hasDefault=i.hasDefault,this.primary=i.primaryKey,this.isUnique=i.isUnique,this.uniqueName=i.uniqueName,this.uniqueType=i.uniqueType,this.dataType=i.dataType,this.columnType=i.columnType,this.generated=i.generated,this.generatedIdentity=i.generatedIdentity}static[S]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(n){return n}mapToDriverValue(n){return n}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class mf{static[S]="ColumnBuilder";config;constructor(n,i,o){this.config={name:n,keyAsName:n==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:i,columnType:o,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(n){return this.config.default=n,this.config.hasDefault=!0,this}$defaultFn(n){return this.config.defaultFn=n,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(n){return this.config.onUpdateFn=n,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(n){if(this.config.name!=="")return;this.config.name=n}}var vo=Symbol.for("drizzle:Name");class xf{static[S]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(n,i){if(this.reference=()=>{let{name:o,columns:c,foreignColumns:p}=n();return{name:o,columns:c,foreignTable:p[0].table,foreignColumns:p}},i)this._onUpdate=i.onUpdate,this._onDelete=i.onDelete}onUpdate(n){return this._onUpdate=n===void 0?"no action":n,this}onDelete(n){return this._onDelete=n===void 0?"no action":n,this}build(n){return new Tw(n,this)}}class Tw{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[S]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:n,columns:i,foreignColumns:o}=this.reference(),c=i.map((m)=>m.name),p=o.map((m)=>m.name),a=[this.table[vo],...c,o[0].table[vo],...p];return n??`${a.join("_")}_fk`}}function Nm(n,...i){return n(...i)}function ww(n,i){return`${n[vo]}_${i.join("_")}_unique`}function Sw(n,i,o){for(let c=i;c<n.length;c++){let p=n[c];if(p==="\\"){c++;continue}if(p==='"')return[n.slice(i,c).replace(/\\/g,""),c+1];if(o)continue;if(p===","||p==="}")return[n.slice(i,c).replace(/\\/g,""),c]}return[n.slice(i).replace(/\\/g,""),n.length]}function Aw(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let a=n[c];if(a===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,a==="\\"){c+=2;continue}if(a==='"'){let[l,f]=Sw(n,c+1,!0);o.push(l),c=f;continue}if(a==="}")return[o,c+1];if(a==="{"){let[l,f]=Aw(n,c+1);o.push(l),c=f;continue}let[m,x]=Sw(n,c,!1);o.push(m),c=x}return[o,c]}function Jw(n){let[i]=Aw(n,1);return i}function lf(n){return`{${n.map((i)=>{if(Array.isArray(i))return lf(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return`${i}`}).join(",")}}`}class I extends mf{foreignKeyConfigs=[];static[S]="PgColumnBuilder";array(n){return new Rw(this.config.name,this,n)}references(n,i={}){return this.foreignKeyConfigs.push({ref:n,actions:i}),this}unique(n,i){return this.config.isUnique=!0,this.config.uniqueName=n,this.config.uniqueType=i?.nulls,this}generatedAlwaysAs(n){return this.config.generated={as:n,type:"always",mode:"stored"},this}buildForeignKeys(n,i){return this.foreignKeyConfigs.map(({ref:o,actions:c})=>{return Nm((p,a)=>{let m=new xf(()=>{let x=p();return{columns:[n],foreignColumns:[x]}});if(a.onUpdate)m.onUpdate(a.onUpdate);if(a.onDelete)m.onDelete(a.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new Fw(n,this.config)}}class y extends Vn{constructor(n,i){if(!i.uniqueName)i.uniqueName=ww(n,[i.name]);super(n,i);this.table=n}static[S]="PgColumn"}class Fw extends y{static[S]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(n){return this.indexConfig.opClass=n,this}}class Xa{static[S]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class Rw extends I{static[S]="PgArrayBuilder";constructor(n,i,o){super(n,"array","PgArray");this.config.baseBuilder=i,this.config.size=o}build(n){let i=this.config.baseBuilder.build(n);return new ff(n,this.config,i)}}class ff extends y{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[S]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=Jw(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:Y(this.baseColumn,ff)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return lf(o)}}var $f=Symbol.for("drizzle:isPgEnum");function Mw(n){return!!n&&typeof n==="function"&&$f in n&&n[$f]===!0}class Kw extends I{static[S]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new Ww(n,this.config)}}class Ww extends y{static[S]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(n,i){super(n,i);this.enum=i.enum}getSQLType(){return this.enum.enumName}}function Lm(n,i){return F6(n,i,void 0)}function F6(n,i,o){let c=Object.assign((p)=>new Kw(p??"",c),{enumName:n,enumValues:i,schema:o,[$f]:!0});return c}class li{static[S]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Ga extends li{static[S]="WithSubquery"}var Xw="0.35.3";var vf,Tf,Qn={startActiveSpan(n,i){if(!vf)return i();if(!Tf)Tf=vf.trace.getTracer("drizzle-orm",Xw);return Nm((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(a){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:a instanceof Error?a.message:"Unknown error"}),a}finally{p.end()}}),vf,Tf)}};var Dn=Symbol.for("drizzle:ViewBaseConfig");var tm=Symbol.for("drizzle:Schema"),Gw=Symbol.for("drizzle:Columns"),zw=Symbol.for("drizzle:ExtraConfigColumns"),wf=Symbol.for("drizzle:OriginalName"),Sf=Symbol.for("drizzle:BaseName"),uw=Symbol.for("drizzle:IsAlias"),Yw=Symbol.for("drizzle:ExtraConfigBuilder"),R6=Symbol.for("drizzle:IsDrizzleTable");class t{static[S]="Table";static Symbol={Name:vo,Schema:tm,OriginalName:wf,Columns:Gw,ExtraConfigColumns:zw,BaseName:Sf,IsAlias:uw,ExtraConfigBuilder:Yw};[vo];[wf];[tm];[Gw];[zw];[Sf];[uw]=!1;[R6]=!0;[Yw]=void 0;constructor(n,i,o){this[vo]=this[wf]=n,this[tm]=i,this[Sf]=o}}function gi(n){return n[vo]}function Hc(n){return`${n[tm]??"public"}.${n[vo]}`}function Af(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function M6(n){let i={sql:"",params:[]};for(let o of n)if(i.sql+=o.sql,i.params.push(...o.params),o.typings?.length){if(!i.typings)i.typings=[];i.typings.push(...o.typings)}return i}class pi{static[S]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new C([this])}}class C{constructor(n){this.queryChunks=n}static[S]="SQL";decoder=Hw;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return Qn.startActiveSpan("drizzle.buildSQL",(i)=>{let o=this.buildQueryFromSourceParams(this.queryChunks,n);return i?.setAttributes({"drizzle.query.text":o.sql,"drizzle.query.params":JSON.stringify(o.params)}),o})}buildQueryFromSourceParams(n,i){let o=Object.assign({},i,{inlineParams:i.inlineParams||this.shouldInlineParams,paramStartIndex:i.paramStartIndex||{value:0}}),{casing:c,escapeName:p,escapeParam:a,prepareTyping:m,inlineParams:x,paramStartIndex:l}=o;return M6(n.map((f)=>{if(Y(f,pi))return{sql:f.value.join(""),params:[]};if(Y(f,Dm))return{sql:p(f.value),params:[]};if(f===void 0)return{sql:"",params:[]};if(Array.isArray(f)){let $=[new pi("(")];for(let[v,w]of f.entries())if($.push(w),v<f.length-1)$.push(new pi(", "));return $.push(new pi(")")),this.buildQueryFromSourceParams($,o)}if(Y(f,C))return this.buildQueryFromSourceParams(f.queryChunks,{...o,inlineParams:x||f.shouldInlineParams});if(Y(f,t)){let $=f[t.Symbol.Schema],v=f[t.Symbol.Name];return{sql:$===void 0?p(v):p($)+"."+p(v),params:[]}}if(Y(f,Vn)){let $=c.getColumnCasing(f);if(i.invokeSource==="indexes")return{sql:p($),params:[]};return{sql:p(f.table[t.Symbol.Name])+"."+p($),params:[]}}if(Y(f,si)){let $=f[Dn].schema,v=f[Dn].name;return{sql:$===void 0?p(v):p($)+"."+p(v),params:[]}}if(Y(f,Bi)){if(Y(f.value,cc))return{sql:a(l.value++,f),params:[f],typings:["none"]};let $=f.value===null?null:f.encoder.mapToDriverValue(f.value);if(Y($,C))return this.buildQueryFromSourceParams([$],o);if(x)return{sql:this.mapInlineParam($,o),params:[]};let v=["none"];if(m)v=[m(f.encoder)];return{sql:a(l.value++,$),params:[$],typings:v}}if(Y(f,cc))return{sql:a(l.value++,f),params:[f],typings:["none"]};if(Y(f,C.Aliased)&&f.fieldAlias!==void 0)return{sql:p(f.fieldAlias),params:[]};if(Y(f,li)){if(f._.isWith)return{sql:p(f._.alias),params:[]};return this.buildQueryFromSourceParams([new pi("("),f._.sql,new pi(") "),new Dm(f._.alias)],o)}if(Mw(f)){if(f.schema)return{sql:p(f.schema)+"."+p(f.enumName),params:[]};return{sql:p(f.enumName),params:[]}}if(Af(f)){if(f.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([f.getSQL()],o);return this.buildQueryFromSourceParams([new pi("("),f.getSQL(),new pi(")")],o)}if(x)return{sql:this.mapInlineParam(f,o),params:[]};return{sql:a(l.value++,f),params:[f],typings:["none"]}}))}mapInlineParam(n,{escapeString:i}){if(n===null)return"null";if(typeof n==="number"||typeof n==="boolean")return n.toString();if(typeof n==="string")return i(n);if(typeof n==="object"){let o=n.toString();if(o==="[object Object]")return i(JSON.stringify(n));return i(o)}throw new Error("Unexpected param value: "+n)}getSQL(){return this}as(n){if(n===void 0)return this;return new C.Aliased(this,n)}mapWith(n){return this.decoder=typeof n==="function"?{mapFromDriverValue:n}:n,this}inlineParams(){return this.shouldInlineParams=!0,this}if(n){return n?this:void 0}}class Dm{constructor(n){this.value=n}static[S]="Name";brand;getSQL(){return new C([this])}}function Ow(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var Hw={mapFromDriverValue:(n)=>n},Ew={mapToDriverValue:(n)=>n},Kb={...Hw,...Ew};class Bi{constructor(n,i=Ew){this.value=n,this.encoder=i}static[S]="Param";brand;getSQL(){return new C([this])}}function A(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new pi(n[0]));for(let[c,p]of i.entries())o.push(p,new pi(n[c+1]));return new C(o)}((n)=>{function i(){return new C([])}n.empty=i;function o(l){return new C(l)}n.fromList=o;function c(l){return new C([new pi(l)])}n.raw=c;function p(l,f){let $=[];for(let[v,w]of l.entries()){if(v>0&&f!==void 0)$.push(f);$.push(w)}return new C($)}n.join=p;function a(l){return new Dm(l)}n.identifier=a;function m(l){return new cc(l)}n.placeholder=m;function x(l,f){return new Bi(l,f)}n.param=x})(A||(A={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[S]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(C||(C={}));class cc{constructor(n){this.name=n}static[S]="Placeholder";getSQL(){return new C([this])}}function Jf(n,i){return n.map((o)=>{if(Y(o,cc)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(Y(o,Bi)&&Y(o.value,cc)){if(!(o.value.name in i))throw new Error(`No value for placeholder "${o.value.name}" was provided`);return o.encoder.mapToDriverValue(i[o.value.name])}return o})}class si{static[S]="View";[Dn];constructor({name:n,schema:i,selectedFields:o,query:c}){this[Dn]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new C([this])}}Vn.prototype.getSQL=function(){return new C([this])};t.prototype.getSQL=function(){return new C([this])};li.prototype.getSQL=function(){return new C([this])};class wp{constructor(n){this.table=n}static[S]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class za{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[S]="TableAliasProxyHandler";get(n,i){if(i===t.Symbol.IsAlias)return!0;if(i===t.Symbol.Name)return this.alias;if(this.replaceOriginalName&&i===t.Symbol.OriginalName)return this.alias;if(i===Dn)return{...n[Dn],name:this.alias,isAlias:!0};if(i===t.Symbol.Columns){let c=n[t.Symbol.Columns];if(!c)return c;let p={};return Object.keys(c).map((a)=>{p[a]=new Proxy(c[a],new wp(new Proxy(n,this)))}),p}let o=n[i];if(Y(o,Vn))return new Proxy(o,new wp(new Proxy(n,this)));return o}}function hm(n,i){return new Proxy(n,new za(i,!1))}function Oo(n,i){return new Proxy(n,new wp(new Proxy(n.table,new za(i,!1))))}function Ff(n,i){return new C.Aliased(ua(n.sql,i),n.fieldAlias)}function ua(n,i){return A.join(n.queryChunks.map((o)=>{if(Y(o,Vn))return Oo(o,i);if(Y(o,C))return ua(o,i);if(Y(o,C.Aliased))return Ff(o,i);return o}))}class Im extends Error{static[S]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Rf extends Im{static[S]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function Ui(n,i){if(Ow(i)&&!Af(n)&&!Y(n,Bi)&&!Y(n,cc)&&!Y(n,Vn)&&!Y(n,t)&&!Y(n,si))return new Bi(n,i);return n}var Ho=(n,i)=>{return A`${n} = ${Ui(i,n)}`},Qw=(n,i)=>{return A`${n} <> ${Ui(i,n)}`};function Ec(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new C(i);return new C([new pi("("),A.join(i,new pi(" and ")),new pi(")")])}function sw(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new C(i);return new C([new pi("("),A.join(i,new pi(" or ")),new pi(")")])}function Uw(n){return A`not ${n}`}var Cm=(n,i)=>{return A`${n} > ${Ui(i,n)}`},bw=(n,i)=>{return A`${n} >= ${Ui(i,n)}`},Vw=(n,i)=>{return A`${n} < ${Ui(i,n)}`},_w=(n,i)=>{return A`${n} <= ${Ui(i,n)}`};function yw(n,i){if(Array.isArray(i)){if(i.length===0)return A`false`;return A`${n} in ${i.map((o)=>Ui(o,n))}`}return A`${n} in ${Ui(i,n)}`}function jw(n,i){if(Array.isArray(i)){if(i.length===0)return A`true`;return A`${n} not in ${i.map((o)=>Ui(o,n))}`}return A`${n} not in ${Ui(i,n)}`}function Bw(n){return A`${n} is null`}function Nw(n){return A`${n} is not null`}function Lw(n){return A`exists ${n}`}function tw(n){return A`not exists ${n}`}function Dw(n,i,o){return A`${n} between ${Ui(i,n)} and ${Ui(o,n)}`}function hw(n,i,o){return A`${n} not between ${Ui(i,n)} and ${Ui(o,n)}`}function Iw(n,i){return A`${n} like ${i}`}function Cw(n,i){return A`${n} not like ${i}`}function kw(n,i){return A`${n} ilike ${i}`}function rw(n,i){return A`${n} not ilike ${i}`}function Zw(n){return A`${n} asc`}function qw(n){return A`${n} desc`}class ew{static[S]="ConsoleLogWriter";write(n){console.log(n)}}class Mf{static[S]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new ew}logQuery(n,i){let o=i.map((p)=>{try{return JSON.stringify(p)}catch{return String(p)}}),c=o.length?` -- params: [${o.join(", ")}]`:"";this.writer.write(`Query: ${n}${c}`)}}class Kf{static[S]="NoopLogger";logQuery(){}}class Yi{static[S]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}then(n,i){return this.execute().then(n,i)}}function Pw(n,i,o){let c={},p=n.reduce((a,{path:m,field:x},l)=>{let f;if(Y(x,Vn))f=x;else if(Y(x,C))f=x.decoder;else f=x.sql.decoder;let $=a;for(let[v,w]of m.entries())if(v<m.length-1){if(!(w in $))$[w]={};$=$[w]}else{let F=i[l],M=$[w]=F===null?null:f.mapFromDriverValue(F);if(o&&Y(x,Vn)&&m.length===2){let J=m[0];if(!(J in c))c[J]=M===null?gi(x.table):!1;else if(typeof c[J]==="string"&&c[J]!==gi(x.table))c[J]=!1}}return a},{});if(o&&Object.keys(c).length>0){for(let[a,m]of Object.entries(c))if(typeof m==="string"&&!o[m])p[a]=null}return p}function di(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let a=i?[...i,c]:[c];if(Y(p,Vn)||Y(p,C)||Y(p,C.Aliased))o.push({path:a,field:p});else if(Y(p,t))o.push(...di(p[t.Symbol.Columns],a));else o.push(...di(p,a));return o},[])}function Wf(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,a]of o.entries())if(a!==c[p])return!1;return!0}function km(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(Y(p,C))return[c,p];else return[c,new Bi(p,n[t.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function gw(n,i){for(let o of i)for(let c of Object.getOwnPropertyNames(o.prototype)){if(c==="constructor")continue;Object.defineProperty(n.prototype,c,Object.getOwnPropertyDescriptor(o.prototype,c)||Object.create(null))}}function dw(n){return n[t.Symbol.Columns]}function Xf(n){return Y(n,li)?n._.alias:Y(n,si)?n[Dn].name:Y(n,C)?void 0:n[t.Symbol.IsAlias]?n[t.Symbol.Name]:n[t.Symbol.BaseName]}function Sn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function nS(n){if(typeof n!=="object"||n===null)return!1;if(n.constructor.name!=="Object")return!1;if("logger"in n){let i=typeof n.logger;if(i!=="boolean"&&(i!=="object"||typeof n.logger.logQuery!=="function")&&i!=="undefined")return!1;return!0}if("schema"in n){let i=typeof n.logger;if(i!=="object"&&i!=="undefined")return!1;return!0}if("casing"in n){let i=typeof n.logger;if(i!=="string"&&i!=="undefined")return!1;return!0}if("mode"in n){if(n.mode!=="default"||n.mode!=="planetscale"||n.mode!==void 0)return!1;return!0}if("connection"in n){let i=typeof n.connection;if(i!=="string"&&i!=="object"&&i!=="undefined")return!1;return!0}if("client"in n){let i=typeof n.client;if(i!=="object"&&i!=="undefined")return!1;return!0}if(Object.keys(n).length===0)return!0;return!1}class pc extends I{static[S]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"always",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"byDefault",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}class iS extends pc{static[S]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new oS(n,this.config)}}class oS extends y{static[S]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class cS extends pc{static[S]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new pS(n,this.config)}}class pS extends y{static[S]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function aS(n,i){let{name:o,config:c}=Sn(n,i);if(c.mode==="number")return new iS(o);return new cS(o)}class mS extends I{static[S]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new xS(n,this.config)}}class xS extends y{static[S]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class lS extends I{static[S]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new fS(n,this.config)}}class fS extends y{static[S]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function $S(n,i){let{name:o,config:c}=Sn(n,i);if(c.mode==="number")return new mS(o);return new lS(o)}class vS extends I{static[S]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new TS(n,this.config)}}class TS extends y{static[S]="PgBoolean";getSQLType(){return"boolean"}}function Ya(n){return new vS(n??"")}class wS extends I{static[S]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new SS(n,this.config)}}class SS extends y{static[S]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function AS(n,i={}){let{name:o,config:c}=Sn(n,i);return new wS(o,c)}class JS extends I{static[S]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new FS(n,this.config)}}class FS extends y{static[S]="PgCidr";getSQLType(){return"cidr"}}function RS(n){return new JS(n??"")}class MS extends I{static[S]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new KS(n,this.config)}}class KS extends y{static[S]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(n,i){super(n,i);this.sqlName=i.customTypeParams.dataType(i.fieldConfig),this.mapTo=i.customTypeParams.toDriver,this.mapFrom=i.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(n){return typeof this.mapFrom==="function"?this.mapFrom(n):n}mapToDriverValue(n){return typeof this.mapTo==="function"?this.mapTo(n):n}}function WS(n){return(i,o)=>{let{name:c,config:p}=Sn(i,o);return new MS(c,p,n)}}class jo extends I{static[S]="PgDateColumnBaseBuilder";defaultNow(){return this.default(A`now()`)}}class XS extends jo{static[S]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new rm(n,this.config)}}class rm extends y{static[S]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class GS extends jo{static[S]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new Zm(n,this.config)}}class Zm extends y{static[S]="PgDateString";getSQLType(){return"date"}}function zS(n,i){let{name:o,config:c}=Sn(n,i);if(c?.mode==="date")return new XS(o);return new GS(o)}class uS extends I{static[S]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new YS(n,this.config)}}class YS extends y{static[S]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function OS(n){return new uS(n??"")}class HS extends I{static[S]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new ES(n,this.config)}}class ES extends y{static[S]="PgInet";getSQLType(){return"inet"}}function QS(n){return new HS(n??"")}class sS extends pc{static[S]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new US(n,this.config)}}class US extends y{static[S]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function qm(n){return new sS(n??"")}class bS extends I{static[S]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new VS(n,this.config)}}class VS extends y{static[S]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let n=this.fields?` ${this.fields}`:"",i=this.precision?`(${this.precision})`:"";return`interval${n}${i}`}}function _S(n,i={}){let{name:o,config:c}=Sn(n,i);return new bS(o,c)}class yS extends I{static[S]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new em(n,this.config)}}class em extends y{static[S]="PgJson";constructor(n,i){super(n,i)}getSQLType(){return"json"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function jS(n){return new yS(n??"")}class BS extends I{static[S]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new Pm(n,this.config)}}class Pm extends y{static[S]="PgJsonb";constructor(n,i){super(n,i)}getSQLType(){return"jsonb"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function NS(n){return new BS(n??"")}class LS extends I{static[S]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new tS(n,this.config)}}class tS extends y{static[S]="PgLine";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o),Number.parseFloat(c)]}mapToDriverValue(n){return`{${n[0]},${n[1]},${n[2]}}`}}class DS extends I{static[S]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new hS(n,this.config)}}class hS extends y{static[S]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return{a:Number.parseFloat(i),b:Number.parseFloat(o),c:Number.parseFloat(c)}}mapToDriverValue(n){return`{${n.a},${n.b},${n.c}}`}}function IS(n,i){let{name:o,config:c}=Sn(n,i);if(!c?.mode||c.mode==="tuple")return new LS(o);return new DS(o)}class CS extends I{static[S]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new kS(n,this.config)}}class kS extends y{static[S]="PgMacaddr";getSQLType(){return"macaddr"}}function rS(n){return new CS(n??"")}class ZS extends I{static[S]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new qS(n,this.config)}}class qS extends y{static[S]="PgMacaddr8";getSQLType(){return"macaddr8"}}function eS(n){return new ZS(n??"")}class PS extends I{static[S]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new gm(n,this.config)}}class gm extends y{static[S]="PgNumeric";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}function gS(n,i){let{name:o,config:c}=Sn(n,i);return new PS(o,c?.precision,c?.scale)}class dS extends I{static[S]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new n1(n,this.config)}}class n1 extends y{static[S]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o)]}return[n.x,n.y]}mapToDriverValue(n){return`(${n[0]},${n[1]})`}}class i1 extends I{static[S]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new o1(n,this.config)}}class o1 extends y{static[S]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return{x:Number.parseFloat(i),y:Number.parseFloat(o)}}return n}mapToDriverValue(n){return`(${n.x},${n.y})`}}function c1(n,i){let{name:o,config:c}=Sn(n,i);if(!c?.mode||c.mode==="tuple")return new dS(o);return new i1(o)}function K6(n){let i=[];for(let o=0;o<n.length;o+=2)i.push(Number.parseInt(n.slice(o,o+2),16));return new Uint8Array(i)}function p1(n,i){let o=new ArrayBuffer(8),c=new DataView(o);for(let p=0;p<8;p++)c.setUint8(p,n[i+p]);return c.getFloat64(0,!0)}function Gf(n){let i=K6(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),a=p.getUint32(o,c===1);o+=4;let m;if(a&536870912)m=p.getUint32(o,c===1),o+=4;if((a&65535)===1){let x=p1(i,o);o+=8;let l=p1(i,o);return o+=8,[x,l]}throw new Error("Unsupported geometry type")}class a1 extends I{static[S]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new m1(n,this.config)}}class m1 extends y{static[S]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return Gf(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class x1 extends I{static[S]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new l1(n,this.config)}}class l1 extends y{static[S]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=Gf(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function f1(n,i){let{name:o,config:c}=Sn(n,i);if(!c?.mode||c.mode==="tuple")return new a1(o);return new x1(o)}class $1 extends I{static[S]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new v1(n,this.config)}}class v1 extends y{static[S]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function T1(n){return new $1(n??"")}class w1 extends I{static[S]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new S1(n,this.config)}}class S1 extends y{static[S]="PgSerial";getSQLType(){return"serial"}}function A1(n){return new w1(n??"")}class J1 extends pc{static[S]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new F1(n,this.config)}}class F1 extends y{static[S]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function R1(n){return new J1(n??"")}class M1 extends I{static[S]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new K1(n,this.config)}}class K1 extends y{static[S]="PgSmallSerial";getSQLType(){return"smallserial"}}function W1(n){return new M1(n??"")}class X1 extends I{static[S]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new G1(n,this.config)}}class G1 extends y{static[S]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function z1(n,i={}){let{name:o,config:c}=Sn(n,i);return new X1(o,c)}class u1 extends jo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[S]="PgTimeBuilder";build(n){return new dm(n,this.config)}}class dm extends y{static[S]="PgTime";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function Y1(n,i={}){let{name:o,config:c}=Sn(n,i);return new u1(o,c.withTimezone??!1,c.precision)}class O1 extends jo{static[S]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new nx(n,this.config)}}class nx extends y{static[S]="PgTimestamp";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue=(n)=>{return new Date(this.withTimezone?n:n+"+0000")};mapToDriverValue=(n)=>{return n.toISOString()}}class H1 extends jo{static[S]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new ix(n,this.config)}}class ix extends y{static[S]="PgTimestampString";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function To(n,i={}){let{name:o,config:c}=Sn(n,i);if(c?.mode==="string")return new H1(o,c.withTimezone??!1,c.precision);return new O1(o,c?.withTimezone??!1,c?.precision)}class E1 extends I{static[S]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(A`gen_random_uuid()`)}build(n){return new ox(n,this.config)}}class ox extends y{static[S]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new E1(n??"")}class Q1 extends I{static[S]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new s1(n,this.config)}}class s1 extends y{static[S]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function fi(n,i={}){let{name:o,config:c}=Sn(n,i);return new Q1(o,c)}class U1 extends I{static[S]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new b1(n,this.config)}}class b1 extends y{static[S]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function V1(n,i){let{name:o,config:c}=Sn(n,i);return new U1(o,c)}class _1 extends I{static[S]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new y1(n,this.config)}}class y1 extends y{static[S]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function j1(n,i){let{name:o,config:c}=Sn(n,i);return new _1(o,c)}class B1 extends I{static[S]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new N1(n,this.config)}}class N1 extends y{static[S]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function L1(n,i){let{name:o,config:c}=Sn(n,i);return new B1(o,c)}class t1 extends I{static[S]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new D1(n,this.config)}}class D1 extends y{static[S]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function h1(n,i){let{name:o,config:c}=Sn(n,i);return new t1(o,c)}function I1(){return{bigint:aS,bigserial:$S,boolean:Ya,char:AS,cidr:RS,customType:WS,date:zS,doublePrecision:OS,inet:QS,integer:qm,interval:_S,json:jS,jsonb:NS,line:IS,macaddr:rS,macaddr8:eS,numeric:gS,point:c1,geometry:f1,real:T1,serial:A1,smallint:R1,smallserial:W1,text:z1,time:Y1,timestamp:To,uuid:Ni,varchar:fi,bit:V1,halfvec:j1,sparsevec:L1,vector:h1}}var zf=Symbol.for("drizzle:PgInlineForeignKeys");class wo extends t{static[S]="PgTable";static Symbol=Object.assign({},t.Symbol,{InlineForeignKeys:zf});[zf]=[];[t.Symbol.ExtraConfigBuilder]=void 0}function W6(n,i,o,c,p=n){let a=new wo(n,c,p),m=typeof i==="function"?i(I1()):i,x=Object.fromEntries(Object.entries(m).map(([$,v])=>{let w=v;w.setName($);let F=w.build(a);return a[zf].push(...w.buildForeignKeys(F,a)),[$,F]})),l=Object.fromEntries(Object.entries(m).map(([$,v])=>{let w=v;w.setName($);let F=w.buildExtraConfigColumn(a);return[$,F]})),f=Object.assign(a,x);if(f[t.Symbol.Columns]=x,f[t.Symbol.ExtraConfigColumns]=l,o)f[wo.Symbol.ExtraConfigBuilder]=o;return f}var ac=(n,i,o)=>{return W6(n,i,o,void 0)};function C1(...n){if(n[0].columns)return new Oa(n[0].columns,n[0].name);return new Oa(n)}class Oa{static[S]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new k1(n,this.columns,this.name)}}class k1{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[S]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[wo.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class uf{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[t.Symbol.Name]}static[S]="Relation";referencedTableName;fieldName}class r1{constructor(n,i){this.table=n,this.config=i}static[S]="Relations"}class mc extends uf{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[S]="One";withFieldName(n){let i=new mc(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class Ha extends uf{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[S]="Many";withFieldName(n){let i=new Ha(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function Z1(){return{and:Ec,between:Dw,eq:Ho,exists:Lw,gt:Cm,gte:bw,ilike:kw,inArray:yw,isNull:Bw,isNotNull:Nw,like:Iw,lt:Vw,lte:_w,ne:Qw,not:Uw,notBetween:hw,notExists:tw,notLike:Cw,notIlike:rw,notInArray:jw,or:sw,sql:A}}function q1(){return{sql:A,asc:Zw,desc:qw}}function e1(n,i){if(Object.keys(n).length===1&&"default"in n&&!Y(n.default,t))n=n.default;let o={},c={},p={};for(let[a,m]of Object.entries(n))if(Y(m,t)){let x=Hc(m),l=c[x];o[x]=a,p[a]={tsName:a,dbName:m[t.Symbol.Name],schema:m[t.Symbol.Schema],columns:m[t.Symbol.Columns],relations:l?.relations??{},primaryKey:l?.primaryKey??[]};for(let $ of Object.values(m[t.Symbol.Columns]))if($.primary)p[a].primaryKey.push($);let f=m[t.Symbol.ExtraConfigBuilder]?.(m[t.Symbol.ExtraConfigColumns]);if(f){for(let $ of Object.values(f))if(Y($,Oa))p[a].primaryKey.push(...$.columns)}}else if(Y(m,r1)){let x=Hc(m.table),l=o[x],f=m.config(i(m.table)),$;for(let[v,w]of Object.entries(f))if(l){let F=p[l];if(F.relations[v]=w,$)F.primaryKey.push(...$)}else{if(!(x in c))c[x]={relations:{},primaryKey:$};c[x].relations[v]=w}}return{tables:p,tableNamesMap:o}}function X6(n){return function i(o,c){return new mc(n,o,c,c?.fields.reduce((p,a)=>p&&a.notNull,!0)??!1)}}function G6(n){return function i(o,c){return new Ha(n,o,c)}}function P1(n,i,o){if(Y(o,mc)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Hc(o.referencedTable)];if(!c)throw new Error(`Table "${o.referencedTable[t.Symbol.Name]}" not found in schema`);let p=n[c];if(!p)throw new Error(`Table "${c}" not found in schema`);let a=o.sourceTable,m=i[Hc(a)];if(!m)throw new Error(`Table "${a[t.Symbol.Name]}" not found in schema`);let x=[];for(let l of Object.values(p.relations))if(o.relationName&&o!==l&&l.relationName===o.relationName||!o.relationName&&l.referencedTable===o.sourceTable)x.push(l);if(x.length>1)throw o.relationName?new Error(`There are multiple relations with name "${o.relationName}" in table "${c}"`):new Error(`There are multiple relations between "${c}" and "${o.sourceTable[t.Symbol.Name]}". Please specify relation name`);if(x[0]&&Y(x[0],mc)&&x[0].config)return{fields:x[0].config.references,references:x[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function g1(n){return{one:X6(n),many:G6(n)}}function cx(n,i,o,c,p=(a)=>a){let a={};for(let[m,x]of c.entries())if(x.isJson){let l=i.relations[x.tsKey],f=o[m],$=typeof f==="string"?JSON.parse(f):f;a[x.tsKey]=Y(l,mc)?$&&cx(n,n[x.relationTableTsKey],$,x.selection,p):$.map((v)=>cx(n,n[x.relationTableTsKey],v,x.selection,p))}else{let l=p(o[m]),f=x.field,$;if(Y(f,Vn))$=f;else if(Y(f,C))$=f.decoder;else $=f.sql.decoder;a[x.tsKey]=l===null?null:$.mapFromDriverValue(l)}return a}var jR=al(yR(),1),{Server:BR,Namespace:WB,Socket:XB}=jR.default;import{readFileSync as gR}from"fs";import{resolve as u$}from"path";var Rn;(function(n){n.assertEqual=(p)=>p;function i(p){}n.assertIs=i;function o(p){throw new Error}n.assertNever=o,n.arrayToEnum=(p)=>{let a={};for(let m of p)a[m]=m;return a},n.getValidEnumValues=(p)=>{let a=n.objectKeys(p).filter((x)=>typeof p[p[x]]!=="number"),m={};for(let x of a)m[x]=p[x];return n.objectValues(m)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(a){return p[a]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let a=[];for(let m in p)if(Object.prototype.hasOwnProperty.call(p,m))a.push(m);return a},n.find=(p,a)=>{for(let m of p)if(a(m))return m;return},n.isInteger=typeof Number.isInteger==="function"?(p)=>Number.isInteger(p):(p)=>typeof p==="number"&&isFinite(p)&&Math.floor(p)===p;function c(p,a=" | "){return p.map((m)=>typeof m==="string"?`'${m}'`:m).join(a)}n.joinValues=c,n.jsonStringifyReplacer=(p,a)=>{if(typeof a==="bigint")return a.toString();return a}})(Rn||(Rn={}));var W$;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(W$||(W$={}));var D=Rn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vc=(n)=>{switch(typeof n){case"undefined":return D.undefined;case"string":return D.string;case"number":return isNaN(n)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":if(Array.isArray(n))return D.array;if(n===null)return D.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return D.promise;if(typeof Map!=="undefined"&&n instanceof Map)return D.map;if(typeof Set!=="undefined"&&n instanceof Set)return D.set;if(typeof Date!=="undefined"&&n instanceof Date)return D.date;return D.object;default:return D.unknown}},s=Rn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),T5=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class hi extends Error{constructor(n){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let i=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,i);else this.__proto__=i;this.name="ZodError",this.issues=n}get errors(){return this.issues}format(n){let i=n||function(p){return p.message},o={_errors:[]},c=(p)=>{for(let a of p.issues)if(a.code==="invalid_union")a.unionErrors.map(c);else if(a.code==="invalid_return_type")c(a.returnTypeError);else if(a.code==="invalid_arguments")c(a.argumentsError);else if(a.path.length===0)o._errors.push(i(a));else{let m=o,x=0;while(x<a.path.length){let l=a.path[x];if(x!==a.path.length-1)m[l]=m[l]||{_errors:[]};else m[l]=m[l]||{_errors:[]},m[l]._errors.push(i(a));m=m[l],x++}}};return c(this),o}static assert(n){if(!(n instanceof hi))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(i)=>i.message){let i={},o=[];for(let c of this.issues)if(c.path.length>0)i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c));else o.push(n(c));return{formErrors:o,fieldErrors:i}}get formErrors(){return this.flatten()}}hi.create=(n)=>{return new hi(n)};var Up=(n,i)=>{let o;switch(n.code){case s.invalid_type:if(n.received===D.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case s.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Rn.jsonStringifyReplacer)}`;break;case s.unrecognized_keys:o=`Unrecognized key(s) in object: ${Rn.joinValues(n.keys,", ")}`;break;case s.invalid_union:o="Invalid input";break;case s.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Rn.joinValues(n.options)}`;break;case s.invalid_enum_value:o=`Invalid enum value. Expected ${Rn.joinValues(n.options)}, received '${n.received}'`;break;case s.invalid_arguments:o="Invalid function arguments";break;case s.invalid_return_type:o="Invalid function return type";break;case s.invalid_date:o="Invalid date";break;case s.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if(o=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)o=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)o=`Invalid input: must end with "${n.validation.endsWith}"`;else Rn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case s.too_small:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else o="Invalid input";break;case s.too_big:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")o=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else o="Invalid input";break;case s.custom:o="Invalid input";break;case s.invalid_intersection_types:o="Intersection results could not be merged";break;case s.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case s.not_finite:o="Number must be finite";break;default:o=i.defaultError,Rn.assertNever(n)}return{message:o}},tR=Up;function w5(n){tR=n}function Qx(){return tR}var sx=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,a=[...o,...p.path||[]],m={...p,path:a};if(p.message!==void 0)return{...p,path:a,message:p.message};let x="",l=c.filter((f)=>!!f).slice().reverse();for(let f of l)x=f(m,{data:i,defaultError:x}).message;return{...p,path:a,message:x}},S5=[];function N(n,i){let o=Qx(),c=sx({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===Up?void 0:Up].filter((p)=>!!p)});n.common.issues.push(c)}class Ki{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,i){let o=[];for(let c of i){if(c.status==="aborted")return nn;if(c.status==="dirty")n.dirty();o.push(c.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,i){let o=[];for(let c of i){let p=await c.key,a=await c.value;o.push({key:p,value:a})}return Ki.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:a}=c;if(p.status==="aborted")return nn;if(a.status==="aborted")return nn;if(p.status==="dirty")n.dirty();if(a.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof a.value!=="undefined"||c.alwaysSet))o[p.value]=a.value}return{status:n.value,value:o}}}var nn=Object.freeze({status:"aborted"}),Qp=(n)=>({status:"dirty",value:n}),Hi=(n)=>({status:"valid",value:n}),X$=(n)=>n.status==="aborted",G$=(n)=>n.status==="dirty",Ba=(n)=>n.status==="valid",Na=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function Ux(n,i,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(n):c?c.value:i.get(n)}function DR(n,i,o,c,p){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?n!==i||!p:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?p.call(n,o):p?p.value=o:i.set(n,o),o}var r;(function(n){n.errToObj=(i)=>typeof i==="string"?{message:i}:i||{},n.toString=(i)=>typeof i==="string"?i:i===null||i===void 0?void 0:i.message})(r||(r={}));var ya,ja;class Wo{constructor(n,i,o,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=o,this._key=c}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var NR=(n,i)=>{if(Ba(i))return{success:!0,data:i.value};else{if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new hi(n.common.issues);return this._error=o,this._error}}}};function fn(n){if(!n)return{};let{errorMap:i,invalid_type_error:o,required_error:c,description:p}=n;if(i&&(o||c))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(i)return{errorMap:i,description:p};return{errorMap:(m,x)=>{var l,f;let{message:$}=n;if(m.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:x.defaultError};if(typeof x.data==="undefined")return{message:(l=$!==null&&$!==void 0?$:c)!==null&&l!==void 0?l:x.defaultError};if(m.code!=="invalid_type")return{message:x.defaultError};return{message:(f=$!==null&&$!==void 0?$:o)!==null&&f!==void 0?f:x.defaultError}},description:p}}class $n{constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(n){return vc(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:vc(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Ki,ctx:{common:n.parent.common,data:n.data,parsedType:vc(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(Na(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){let i=this._parse(n);return Promise.resolve(i)}parse(n,i){let o=this.safeParse(n,i);if(o.success)return o.data;throw o.error}safeParse(n,i){var o;let c={common:{issues:[],async:(o=i===null||i===void 0?void 0:i.async)!==null&&o!==void 0?o:!1,contextualErrorMap:i===null||i===void 0?void 0:i.errorMap},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:vc(n)},p=this._parseSync({data:n,path:c.path,parent:c});return NR(c,p)}async parseAsync(n,i){let o=await this.safeParseAsync(n,i);if(o.success)return o.data;throw o.error}async safeParseAsync(n,i){let o={common:{issues:[],contextualErrorMap:i===null||i===void 0?void 0:i.errorMap,async:!0},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:vc(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(Na(c)?c:Promise.resolve(c));return NR(o,p)}refine(n,i){let o=(c)=>{if(typeof i==="string"||typeof i==="undefined")return{message:i};else if(typeof i==="function")return i(c);else return i};return this._refinement((c,p)=>{let a=n(c),m=()=>p.addIssue({code:s.custom,...o(c)});if(typeof Promise!=="undefined"&&a instanceof Promise)return a.then((x)=>{if(!x)return m(),!1;else return!0});if(!a)return m(),!1;else return!0})}refinement(n,i){return this._refinement((o,c)=>{if(!n(o))return c.addIssue(typeof i==="function"?i(o,c):i),!1;else return!0})}_refinement(n){return new oo({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}optional(){return Ko.create(this,this._def)}nullable(){return Do.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mo.create(this,this._def)}promise(){return tc.create(this,this._def)}or(n){return yp.create([this,n],this._def)}and(n){return jp.create(this,n,this._def)}transform(n){return new oo({...fn(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new tp({...fn(this._def),innerType:this,defaultValue:i,typeName:g.ZodDefault})}brand(){return new Vx({typeName:g.ZodBranded,type:this,...fn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new Dp({...fn(this._def),innerType:this,catchValue:i,typeName:g.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return Ca.create(this,n)}readonly(){return hp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var A5=/^c[^\s-]{8,}$/i,J5=/^[0-9a-z]+$/,F5=/^[0-9A-HJKMNP-TV-Z]{26}$/,R5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,M5=/^[a-z0-9_-]{21}$/i,K5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,W5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,X5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",K$,G5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,z5=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,u5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Y5=new RegExp(`^${hR}\$`);function IR(n){let i="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(n.precision)i=`${i}\\.\\d{${n.precision}}`;else if(n.precision==null)i=`${i}(\\.\\d+)?`;return i}function O5(n){return new RegExp(`^${IR(n)}\$`)}function CR(n){let i=`${hR}T${IR(n)}`,o=[];if(o.push(n.local?"Z?":"Z"),n.offset)o.push("([+-]\\d{2}:?\\d{2})");return i=`${i}(${o.join("|")})`,new RegExp(`^${i}\$`)}function H5(n,i){if((i==="v4"||!i)&&G5.test(n))return!0;if((i==="v6"||!i)&&z5.test(n))return!0;return!1}class Ro extends $n{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==D.string){let p=this._getOrReturnCtx(n);return N(p,{code:s.invalid_type,expected:D.string,received:p.parsedType}),nn}let o=new Ki,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.length<p.value)c=this._getOrReturnCtx(n,c),N(c,{code:s.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="max"){if(n.data.length>p.value)c=this._getOrReturnCtx(n,c),N(c,{code:s.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let a=n.data.length>p.value,m=n.data.length<p.value;if(a||m){if(c=this._getOrReturnCtx(n,c),a)N(c,{code:s.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)N(c,{code:s.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!W5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"email",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!K$)K$=new RegExp(X5,"u");if(!K$.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"emoji",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!R5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"uuid",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!M5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"nanoid",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!A5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"cuid",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!J5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"cuid2",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!F5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"ulid",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(a){c=this._getOrReturnCtx(n,c),N(c,{validation:"url",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="regex"){if(p.regex.lastIndex=0,!p.regex.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"regex",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="trim")n.data=n.data.trim();else if(p.kind==="includes"){if(!n.data.includes(p.value,p.position))c=this._getOrReturnCtx(n,c),N(c,{code:s.invalid_string,validation:{includes:p.value,position:p.position},message:p.message}),o.dirty()}else if(p.kind==="toLowerCase")n.data=n.data.toLowerCase();else if(p.kind==="toUpperCase")n.data=n.data.toUpperCase();else if(p.kind==="startsWith"){if(!n.data.startsWith(p.value))c=this._getOrReturnCtx(n,c),N(c,{code:s.invalid_string,validation:{startsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="endsWith"){if(!n.data.endsWith(p.value))c=this._getOrReturnCtx(n,c),N(c,{code:s.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!CR(p).test(n.data))c=this._getOrReturnCtx(n,c),N(c,{code:s.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!Y5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{code:s.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!O5(p).test(n.data))c=this._getOrReturnCtx(n,c),N(c,{code:s.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!K5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"duration",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!H5(n.data,p.version))c=this._getOrReturnCtx(n,c),N(c,{validation:"ip",code:s.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!u5.test(n.data))c=this._getOrReturnCtx(n,c),N(c,{validation:"base64",code:s.invalid_string,message:p.message}),o.dirty()}else Rn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:s.invalid_string,...r.errToObj(o)})}_addCheck(n){return new Ro({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...r.errToObj(n)})}url(n){return this._addCheck({kind:"url",...r.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...r.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...r.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...r.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...r.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...r.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...r.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...r.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...r.errToObj(n)})}datetime(n){var i,o;if(typeof n==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n});return this._addCheck({kind:"datetime",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,offset:(i=n===null||n===void 0?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(o=n===null||n===void 0?void 0:n.local)!==null&&o!==void 0?o:!1,...r.errToObj(n===null||n===void 0?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){if(typeof n==="string")return this._addCheck({kind:"time",precision:null,message:n});return this._addCheck({kind:"time",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,...r.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...r.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...r.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...r.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...r.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...r.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...r.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...r.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...r.errToObj(i)})}nonempty(n){return this.min(1,r.errToObj(n))}trim(){return new Ro({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ro({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ro({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((n)=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find((n)=>n.kind==="date")}get isTime(){return!!this._def.checks.find((n)=>n.kind==="time")}get isDuration(){return!!this._def.checks.find((n)=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find((n)=>n.kind==="email")}get isURL(){return!!this._def.checks.find((n)=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find((n)=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find((n)=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((n)=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((n)=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((n)=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find((n)=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find((n)=>n.kind==="ip")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get minLength(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxLength(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Ro.create=(n)=>{var i;return new Ro({checks:[],typeName:g.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...fn(n)})};function E5(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,a=parseInt(n.toFixed(p).replace(".","")),m=parseInt(i.toFixed(p).replace(".",""));return a%m/Math.pow(10,p)}class wc extends $n{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce)n.data=Number(n.data);if(this._getType(n)!==D.number){let p=this._getOrReturnCtx(n);return N(p,{code:s.invalid_type,expected:D.number,received:p.parsedType}),nn}let o=void 0,c=new Ki;for(let p of this._def.checks)if(p.kind==="int"){if(!Rn.isInteger(n.data))o=this._getOrReturnCtx(n,o),N(o,{code:s.invalid_type,expected:"integer",received:"float",message:p.message}),c.dirty()}else if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),N(o,{code:s.too_small,minimum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),N(o,{code:s.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(E5(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),N(o,{code:s.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else if(p.kind==="finite"){if(!Number.isFinite(n.data))o=this._getOrReturnCtx(n,o),N(o,{code:s.not_finite,message:p.message}),c.dirty()}else Rn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,r.toString(i))}gt(n,i){return this.setLimit("min",n,!1,r.toString(i))}lte(n,i){return this.setLimit("max",n,!0,r.toString(i))}lt(n,i){return this.setLimit("max",n,!1,r.toString(i))}setLimit(n,i,o,c){return new wc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:r.toString(c)}]})}_addCheck(n){return new wc({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:r.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:r.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:r.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:r.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:r.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:r.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:r.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:r.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:r.toString(n)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}get isInt(){return!!this._def.checks.find((n)=>n.kind==="int"||n.kind==="multipleOf"&&Rn.isInteger(n.value))}get isFinite(){let n=null,i=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(i===null||o.value>i)i=o.value}else if(o.kind==="max"){if(n===null||o.value<n)n=o.value}return Number.isFinite(i)&&Number.isFinite(n)}}wc.create=(n)=>{return new wc({checks:[],typeName:g.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...fn(n)})};class Sc extends $n{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)n.data=BigInt(n.data);if(this._getType(n)!==D.bigint){let p=this._getOrReturnCtx(n);return N(p,{code:s.invalid_type,expected:D.bigint,received:p.parsedType}),nn}let o=void 0,c=new Ki;for(let p of this._def.checks)if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),N(o,{code:s.too_small,type:"bigint",minimum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),N(o,{code:s.too_big,type:"bigint",maximum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(n.data%p.value!==BigInt(0))o=this._getOrReturnCtx(n,o),N(o,{code:s.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Rn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,r.toString(i))}gt(n,i){return this.setLimit("min",n,!1,r.toString(i))}lte(n,i){return this.setLimit("max",n,!0,r.toString(i))}lt(n,i){return this.setLimit("max",n,!1,r.toString(i))}setLimit(n,i,o,c){return new Sc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:r.toString(c)}]})}_addCheck(n){return new Sc({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:r.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:r.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:r.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:r.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:r.toString(i)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Sc.create=(n)=>{var i;return new Sc({checks:[],typeName:g.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...fn(n)})};class bp extends $n{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==D.boolean){let o=this._getOrReturnCtx(n);return N(o,{code:s.invalid_type,expected:D.boolean,received:o.parsedType}),nn}return Hi(n.data)}}bp.create=(n)=>{return new bp({typeName:g.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...fn(n)})};class Bc extends $n{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==D.date){let p=this._getOrReturnCtx(n);return N(p,{code:s.invalid_type,expected:D.date,received:p.parsedType}),nn}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return N(p,{code:s.invalid_date}),nn}let o=new Ki,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.getTime()<p.value)c=this._getOrReturnCtx(n,c),N(c,{code:s.too_small,message:p.message,inclusive:!0,exact:!1,minimum:p.value,type:"date"}),o.dirty()}else if(p.kind==="max"){if(n.data.getTime()>p.value)c=this._getOrReturnCtx(n,c),N(c,{code:s.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Rn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Bc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:r.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:r.toString(i)})}get minDate(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n!=null?new Date(n):null}get maxDate(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n!=null?new Date(n):null}}Bc.create=(n)=>{return new Bc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:g.ZodDate,...fn(n)})};class La extends $n{_parse(n){if(this._getType(n)!==D.symbol){let o=this._getOrReturnCtx(n);return N(o,{code:s.invalid_type,expected:D.symbol,received:o.parsedType}),nn}return Hi(n.data)}}La.create=(n)=>{return new La({typeName:g.ZodSymbol,...fn(n)})};class Vp extends $n{_parse(n){if(this._getType(n)!==D.undefined){let o=this._getOrReturnCtx(n);return N(o,{code:s.invalid_type,expected:D.undefined,received:o.parsedType}),nn}return Hi(n.data)}}Vp.create=(n)=>{return new Vp({typeName:g.ZodUndefined,...fn(n)})};class _p extends $n{_parse(n){if(this._getType(n)!==D.null){let o=this._getOrReturnCtx(n);return N(o,{code:s.invalid_type,expected:D.null,received:o.parsedType}),nn}return Hi(n.data)}}_p.create=(n)=>{return new _p({typeName:g.ZodNull,...fn(n)})};class Nc extends $n{constructor(){super(...arguments);this._any=!0}_parse(n){return Hi(n.data)}}Nc.create=(n)=>{return new Nc({typeName:g.ZodAny,...fn(n)})};class Tc extends $n{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Hi(n.data)}}Tc.create=(n)=>{return new Tc({typeName:g.ZodUnknown,...fn(n)})};class Qo extends $n{_parse(n){let i=this._getOrReturnCtx(n);return N(i,{code:s.invalid_type,expected:D.never,received:i.parsedType}),nn}}Qo.create=(n)=>{return new Qo({typeName:g.ZodNever,...fn(n)})};class ta extends $n{_parse(n){if(this._getType(n)!==D.undefined){let o=this._getOrReturnCtx(n);return N(o,{code:s.invalid_type,expected:D.void,received:o.parsedType}),nn}return Hi(n.data)}}ta.create=(n)=>{return new ta({typeName:g.ZodVoid,...fn(n)})};class Mo extends $n{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==D.array)return N(i,{code:s.invalid_type,expected:D.array,received:i.parsedType}),nn;if(c.exactLength!==null){let a=i.data.length>c.exactLength.value,m=i.data.length<c.exactLength.value;if(a||m)N(i,{code:a?s.too_big:s.too_small,minimum:m?c.exactLength.value:void 0,maximum:a?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),o.dirty()}if(c.minLength!==null){if(i.data.length<c.minLength.value)N(i,{code:s.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),o.dirty()}if(c.maxLength!==null){if(i.data.length>c.maxLength.value)N(i,{code:s.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),o.dirty()}if(i.common.async)return Promise.all([...i.data].map((a,m)=>{return c.type._parseAsync(new Wo(i,a,i.path,m))})).then((a)=>{return Ki.mergeArray(o,a)});let p=[...i.data].map((a,m)=>{return c.type._parseSync(new Wo(i,a,i.path,m))});return Ki.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Mo({...this._def,minLength:{value:n,message:r.toString(i)}})}max(n,i){return new Mo({...this._def,maxLength:{value:n,message:r.toString(i)}})}length(n,i){return new Mo({...this._def,exactLength:{value:n,message:r.toString(i)}})}nonempty(n){return this.min(1,n)}}Mo.create=(n,i)=>{return new Mo({type:n,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...fn(i)})};function Ep(n){if(n instanceof hn){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=Ko.create(Ep(c))}return new hn({...n._def,shape:()=>i})}else if(n instanceof Mo)return new Mo({...n._def,type:Ep(n.element)});else if(n instanceof Ko)return Ko.create(Ep(n.unwrap()));else if(n instanceof Do)return Do.create(Ep(n.unwrap()));else if(n instanceof so)return so.create(n.items.map((i)=>Ep(i)));else return n}class hn extends $n{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let n=this._def.shape(),i=Rn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==D.object){let l=this._getOrReturnCtx(n);return N(l,{code:s.invalid_type,expected:D.object,received:l.parsedType}),nn}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:a}=this._getCached(),m=[];if(!(this._def.catchall instanceof Qo&&this._def.unknownKeys==="strip")){for(let l in c.data)if(!a.includes(l))m.push(l)}let x=[];for(let l of a){let f=p[l],$=c.data[l];x.push({key:{status:"valid",value:l},value:f._parse(new Wo(c,$,c.path,l)),alwaysSet:l in c.data})}if(this._def.catchall instanceof Qo){let l=this._def.unknownKeys;if(l==="passthrough")for(let f of m)x.push({key:{status:"valid",value:f},value:{status:"valid",value:c.data[f]}});else if(l==="strict"){if(m.length>0)N(c,{code:s.unrecognized_keys,keys:m}),o.dirty()}else if(l==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let f of m){let $=c.data[f];x.push({key:{status:"valid",value:f},value:l._parse(new Wo(c,$,c.path,f)),alwaysSet:f in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let l=[];for(let f of x){let $=await f.key,v=await f.value;l.push({key:$,value:v,alwaysSet:f.alwaysSet})}return l}).then((l)=>{return Ki.mergeObjectSync(o,l)});else return Ki.mergeObjectSync(o,x)}get shape(){return this._def.shape()}strict(n){return r.errToObj,new hn({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,a,m;let x=(a=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&a!==void 0?a:o.defaultError;if(i.code==="unrecognized_keys")return{message:(m=r.errToObj(n).message)!==null&&m!==void 0?m:x};return{message:x}}}:{}})}strip(){return new hn({...this._def,unknownKeys:"strip"})}passthrough(){return new hn({...this._def,unknownKeys:"passthrough"})}extend(n){return new hn({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new hn({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:g.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new hn({...this._def,catchall:n})}pick(n){let i={};return Rn.objectKeys(n).forEach((o)=>{if(n[o]&&this.shape[o])i[o]=this.shape[o]}),new hn({...this._def,shape:()=>i})}omit(n){let i={};return Rn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new hn({...this._def,shape:()=>i})}deepPartial(){return Ep(this)}partial(n){let i={};return Rn.objectKeys(this.shape).forEach((o)=>{let c=this.shape[o];if(n&&!n[o])i[o]=c;else i[o]=c.optional()}),new hn({...this._def,shape:()=>i})}required(n){let i={};return Rn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof Ko)p=p._def.innerType;i[o]=p}}),new hn({...this._def,shape:()=>i})}keyof(){return kR(Rn.objectKeys(this.shape))}}hn.create=(n,i)=>{return new hn({shape:()=>n,unknownKeys:"strip",catchall:Qo.create(),typeName:g.ZodObject,...fn(i)})};hn.strictCreate=(n,i)=>{return new hn({shape:()=>n,unknownKeys:"strict",catchall:Qo.create(),typeName:g.ZodObject,...fn(i)})};hn.lazycreate=(n,i)=>{return new hn({shape:n,unknownKeys:"strip",catchall:Qo.create(),typeName:g.ZodObject,...fn(i)})};class yp extends $n{_parse(n){let{ctx:i}=this._processInputParams(n),o=this._def.options;function c(p){for(let m of p)if(m.result.status==="valid")return m.result;for(let m of p)if(m.result.status==="dirty")return i.common.issues.push(...m.ctx.common.issues),m.result;let a=p.map((m)=>new hi(m.ctx.common.issues));return N(i,{code:s.invalid_union,unionErrors:a}),nn}if(i.common.async)return Promise.all(o.map(async(p)=>{let a={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:a}),ctx:a}})).then(c);else{let p=void 0,a=[];for(let x of o){let l={...i,common:{...i.common,issues:[]},parent:null},f=x._parseSync({data:i.data,path:i.path,parent:l});if(f.status==="valid")return f;else if(f.status==="dirty"&&!p)p={result:f,ctx:l};if(l.common.issues.length)a.push(l.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=a.map((x)=>new hi(x));return N(i,{code:s.invalid_union,unionErrors:m}),nn}}get options(){return this._def.options}}yp.create=(n,i)=>{return new yp({options:n,typeName:g.ZodUnion,...fn(i)})};var to=(n)=>{if(n instanceof Bp)return to(n.schema);else if(n instanceof oo)return to(n.innerType());else if(n instanceof Np)return[n.value];else if(n instanceof Ac)return n.options;else if(n instanceof Lp)return Rn.objectValues(n.enum);else if(n instanceof tp)return to(n._def.innerType);else if(n instanceof Vp)return[void 0];else if(n instanceof _p)return[null];else if(n instanceof Ko)return[void 0,...to(n.unwrap())];else if(n instanceof Do)return[null,...to(n.unwrap())];else if(n instanceof Vx)return to(n.unwrap());else if(n instanceof hp)return to(n.unwrap());else if(n instanceof Dp)return to(n._def.innerType);else return[]};class bx extends $n{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.object)return N(i,{code:s.invalid_type,expected:D.object,received:i.parsedType}),nn;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return N(i,{code:s.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),nn;if(i.common.async)return p._parseAsync({data:i.data,path:i.path,parent:i});else return p._parseSync({data:i.data,path:i.path,parent:i})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,o){let c=new Map;for(let p of i){let a=to(p.shape[n]);if(!a.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let m of a){if(c.has(m))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(m)}`);c.set(m,p)}}return new bx({typeName:g.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...fn(o)})}}function z$(n,i){let o=vc(n),c=vc(i);if(n===i)return{valid:!0,data:n};else if(o===D.object&&c===D.object){let p=Rn.objectKeys(i),a=Rn.objectKeys(n).filter((x)=>p.indexOf(x)!==-1),m={...n,...i};for(let x of a){let l=z$(n[x],i[x]);if(!l.valid)return{valid:!1};m[x]=l.data}return{valid:!0,data:m}}else if(o===D.array&&c===D.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let a=0;a<n.length;a++){let m=n[a],x=i[a],l=z$(m,x);if(!l.valid)return{valid:!1};p.push(l.data)}return{valid:!0,data:p}}else if(o===D.date&&c===D.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class jp extends $n{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,a)=>{if(X$(p)||X$(a))return nn;let m=z$(p.value,a.value);if(!m.valid)return N(o,{code:s.invalid_intersection_types}),nn;if(G$(p)||G$(a))i.dirty();return{status:i.value,value:m.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([p,a])=>c(p,a));else return c(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}jp.create=(n,i,o)=>{return new jp({left:n,right:i,typeName:g.ZodIntersection,...fn(o)})};class so extends $n{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.array)return N(o,{code:s.invalid_type,expected:D.array,received:o.parsedType}),nn;if(o.data.length<this._def.items.length)return N(o,{code:s.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nn;if(!this._def.rest&&o.data.length>this._def.items.length)N(o,{code:s.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((a,m)=>{let x=this._def.items[m]||this._def.rest;if(!x)return null;return x._parse(new Wo(o,a,o.path,m))}).filter((a)=>!!a);if(o.common.async)return Promise.all(p).then((a)=>{return Ki.mergeArray(i,a)});else return Ki.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new so({...this._def,rest:n})}}so.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new so({items:n,typeName:g.ZodTuple,rest:null,...fn(i)})};class Da extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.object)return N(o,{code:s.invalid_type,expected:D.object,received:o.parsedType}),nn;let c=[],p=this._def.keyType,a=this._def.valueType;for(let m in o.data)c.push({key:p._parse(new Wo(o,m,o.path,m)),value:a._parse(new Wo(o,o.data[m],o.path,m)),alwaysSet:m in o.data});if(o.common.async)return Ki.mergeObjectAsync(i,c);else return Ki.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof $n)return new Da({keyType:n,valueType:i,typeName:g.ZodRecord,...fn(o)});return new Da({keyType:Ro.create(),valueType:n,typeName:g.ZodRecord,...fn(i)})}}class ha extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.map)return N(o,{code:s.invalid_type,expected:D.map,received:o.parsedType}),nn;let c=this._def.keyType,p=this._def.valueType,a=[...o.data.entries()].map(([m,x],l)=>{return{key:c._parse(new Wo(o,m,o.path,[l,"key"])),value:p._parse(new Wo(o,x,o.path,[l,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let x of a){let l=await x.key,f=await x.value;if(l.status==="aborted"||f.status==="aborted")return nn;if(l.status==="dirty"||f.status==="dirty")i.dirty();m.set(l.value,f.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let x of a){let{key:l,value:f}=x;if(l.status==="aborted"||f.status==="aborted")return nn;if(l.status==="dirty"||f.status==="dirty")i.dirty();m.set(l.value,f.value)}return{status:i.value,value:m}}}}ha.create=(n,i,o)=>{return new ha({valueType:i,keyType:n,typeName:g.ZodMap,...fn(o)})};class Lc extends $n{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.set)return N(o,{code:s.invalid_type,expected:D.set,received:o.parsedType}),nn;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)N(o,{code:s.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()}if(c.maxSize!==null){if(o.data.size>c.maxSize.value)N(o,{code:s.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function a(x){let l=new Set;for(let f of x){if(f.status==="aborted")return nn;if(f.status==="dirty")i.dirty();l.add(f.value)}return{status:i.value,value:l}}let m=[...o.data.values()].map((x,l)=>p._parse(new Wo(o,x,o.path,l)));if(o.common.async)return Promise.all(m).then((x)=>a(x));else return a(m)}min(n,i){return new Lc({...this._def,minSize:{value:n,message:r.toString(i)}})}max(n,i){return new Lc({...this._def,maxSize:{value:n,message:r.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Lc.create=(n,i)=>{return new Lc({valueType:n,minSize:null,maxSize:null,typeName:g.ZodSet,...fn(i)})};class sp extends $n{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.function)return N(i,{code:s.invalid_type,expected:D.function,received:i.parsedType}),nn;function o(m,x){return sx({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Qx(),Up].filter((l)=>!!l),issueData:{code:s.invalid_arguments,argumentsError:x}})}function c(m,x){return sx({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Qx(),Up].filter((l)=>!!l),issueData:{code:s.invalid_return_type,returnTypeError:x}})}let p={errorMap:i.common.contextualErrorMap},a=i.data;if(this._def.returns instanceof tc){let m=this;return Hi(async function(...x){let l=new hi([]),f=await m._def.args.parseAsync(x,p).catch((w)=>{throw l.addIssue(o(x,w)),l}),$=await Reflect.apply(a,this,f);return await m._def.returns._def.type.parseAsync($,p).catch((w)=>{throw l.addIssue(c($,w)),l})})}else{let m=this;return Hi(function(...x){let l=m._def.args.safeParse(x,p);if(!l.success)throw new hi([o(x,l.error)]);let f=Reflect.apply(a,this,l.data),$=m._def.returns.safeParse(f,p);if(!$.success)throw new hi([c(f,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new sp({...this._def,args:so.create(n).rest(Tc.create())})}returns(n){return new sp({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new sp({args:n?n:so.create([]).rest(Tc.create()),returns:i||Tc.create(),typeName:g.ZodFunction,...fn(o)})}}class Bp extends $n{get schema(){return this._def.getter()}_parse(n){let{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Bp.create=(n,i)=>{return new Bp({getter:n,typeName:g.ZodLazy,...fn(i)})};class Np extends $n{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return N(i,{received:i.data,code:s.invalid_literal,expected:this._def.value}),nn}return{status:"valid",value:n.data}}get value(){return this._def.value}}Np.create=(n,i)=>{return new Np({value:n,typeName:g.ZodLiteral,...fn(i)})};function kR(n,i){return new Ac({values:n,typeName:g.ZodEnum,...fn(i)})}class Ac extends $n{constructor(){super(...arguments);ya.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return N(i,{expected:Rn.joinValues(o),received:i.parsedType,code:s.invalid_type}),nn}if(!Ux(this,ya,"f"))DR(this,ya,new Set(this._def.values),"f");if(!Ux(this,ya,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return N(i,{received:i.data,code:s.invalid_enum_value,options:o}),nn}return Hi(n.data)}get options(){return this._def.values}get enum(){let n={};for(let i of this._def.values)n[i]=i;return n}get Values(){let n={};for(let i of this._def.values)n[i]=i;return n}get Enum(){let n={};for(let i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return Ac.create(n,{...this._def,...i})}exclude(n,i=this._def){return Ac.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}ya=new WeakMap;Ac.create=kR;class Lp extends $n{constructor(){super(...arguments);ja.set(this,void 0)}_parse(n){let i=Rn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==D.string&&o.parsedType!==D.number){let c=Rn.objectValues(i);return N(o,{expected:Rn.joinValues(c),received:o.parsedType,code:s.invalid_type}),nn}if(!Ux(this,ja,"f"))DR(this,ja,new Set(Rn.getValidEnumValues(this._def.values)),"f");if(!Ux(this,ja,"f").has(n.data)){let c=Rn.objectValues(i);return N(o,{received:o.data,code:s.invalid_enum_value,options:c}),nn}return Hi(n.data)}get enum(){return this._def.values}}ja=new WeakMap;Lp.create=(n,i)=>{return new Lp({values:n,typeName:g.ZodNativeEnum,...fn(i)})};class tc extends $n{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.promise&&i.common.async===!1)return N(i,{code:s.invalid_type,expected:D.promise,received:i.parsedType}),nn;let o=i.parsedType===D.promise?i.data:Promise.resolve(i.data);return Hi(o.then((c)=>{return this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}tc.create=(n,i)=>{return new tc({type:n,typeName:g.ZodPromise,...fn(i)})};class oo extends $n{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=this._def.effect||null,p={addIssue:(a)=>{if(N(o,a),a.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let a=c.transform(o.data,p);if(o.common.async)return Promise.resolve(a).then(async(m)=>{if(i.value==="aborted")return nn;let x=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(x.status==="aborted")return nn;if(x.status==="dirty")return Qp(x.value);if(i.value==="dirty")return Qp(x.value);return x});else{if(i.value==="aborted")return nn;let m=this._def.schema._parseSync({data:a,path:o.path,parent:o});if(m.status==="aborted")return nn;if(m.status==="dirty")return Qp(m.value);if(i.value==="dirty")return Qp(m.value);return m}}if(c.type==="refinement"){let a=(m)=>{let x=c.refinement(m,p);if(o.common.async)return Promise.resolve(x);if(x instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(o.common.async===!1){let m=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(m.status==="aborted")return nn;if(m.status==="dirty")i.dirty();return a(m.value),{status:i.value,value:m.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((m)=>{if(m.status==="aborted")return nn;if(m.status==="dirty")i.dirty();return a(m.value).then(()=>{return{status:i.value,value:m.value}})})}if(c.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Ba(a))return a;let m=c.transform(a.value,p);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:m}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((a)=>{if(!Ba(a))return a;return Promise.resolve(c.transform(a.value,p)).then((m)=>({status:i.value,value:m}))});Rn.assertNever(c)}}oo.create=(n,i,o)=>{return new oo({schema:n,typeName:g.ZodEffects,effect:i,...fn(o)})};oo.createWithPreprocess=(n,i,o)=>{return new oo({schema:i,effect:{type:"preprocess",transform:n},typeName:g.ZodEffects,...fn(o)})};class Ko extends $n{_parse(n){if(this._getType(n)===D.undefined)return Hi(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ko.create=(n,i)=>{return new Ko({innerType:n,typeName:g.ZodOptional,...fn(i)})};class Do extends $n{_parse(n){if(this._getType(n)===D.null)return Hi(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Do.create=(n,i)=>{return new Do({innerType:n,typeName:g.ZodNullable,...fn(i)})};class tp extends $n{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===D.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}tp.create=(n,i)=>{return new tp({innerType:n,typeName:g.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...fn(i)})};class Dp extends $n{_parse(n){let{ctx:i}=this._processInputParams(n),o={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(Na(c))return c.then((p)=>{return{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new hi(o.common.issues)},input:o.data})}});else return{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new hi(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Dp.create=(n,i)=>{return new Dp({innerType:n,typeName:g.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...fn(i)})};class Ia extends $n{_parse(n){if(this._getType(n)!==D.nan){let o=this._getOrReturnCtx(n);return N(o,{code:s.invalid_type,expected:D.nan,received:o.parsedType}),nn}return{status:"valid",value:n.data}}}Ia.create=(n)=>{return new Ia({typeName:g.ZodNaN,...fn(n)})};var Q5=Symbol("zod_brand");class Vx extends $n{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;return this._def.type._parse({data:o,path:i.path,parent:i})}unwrap(){return this._def.type}}class Ca extends $n{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{let p=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(p.status==="aborted")return nn;if(p.status==="dirty")return i.dirty(),Qp(p.value);else return this._def.out._parseAsync({data:p.value,path:o.path,parent:o})})();else{let c=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(c.status==="aborted")return nn;if(c.status==="dirty")return i.dirty(),{status:"dirty",value:c.value};else return this._def.out._parseSync({data:c.value,path:o.path,parent:o})}}static create(n,i){return new Ca({in:n,out:i,typeName:g.ZodPipeline})}}class hp extends $n{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Ba(c))c.value=Object.freeze(c.value);return c};return Na(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}hp.create=(n,i)=>{return new hp({innerType:n,typeName:g.ZodReadonly,...fn(i)})};function rR(n,i={},o){if(n)return Nc.create().superRefine((c,p)=>{var a,m;if(!n(c)){let x=typeof i==="function"?i(c):typeof i==="string"?{message:i}:i,l=(m=(a=x.fatal)!==null&&a!==void 0?a:o)!==null&&m!==void 0?m:!0,f=typeof x==="string"?{message:x}:x;p.addIssue({code:"custom",...f,fatal:l})}});return Nc.create()}var s5={object:hn.lazycreate},g;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(g||(g={}));var U5=(n,i={message:`Input not instance of ${n.name}`})=>rR((o)=>o instanceof n,i),ZR=Ro.create,qR=wc.create,b5=Ia.create,V5=Sc.create,eR=bp.create,_5=Bc.create,y5=La.create,j5=Vp.create,B5=_p.create,N5=Nc.create,L5=Tc.create,t5=Qo.create,D5=ta.create,h5=Mo.create,ka=hn.create,I5=hn.strictCreate,C5=yp.create,k5=bx.create,r5=jp.create,Z5=so.create,q5=Da.create,e5=ha.create,P5=Lc.create,g5=sp.create,d5=Bp.create,nG=Np.create,iG=Ac.create,oG=Lp.create,cG=tc.create,LR=oo.create,pG=Ko.create,aG=Do.create,mG=oo.createWithPreprocess,xG=Ca.create,lG=()=>ZR().optional(),fG=()=>qR().optional(),$G=()=>eR().optional(),vG={string:(n)=>Ro.create({...n,coerce:!0}),number:(n)=>wc.create({...n,coerce:!0}),boolean:(n)=>bp.create({...n,coerce:!0}),bigint:(n)=>Sc.create({...n,coerce:!0}),date:(n)=>Bc.create({...n,coerce:!0})},TG=nn,Gn=Object.freeze({__proto__:null,defaultErrorMap:Up,setErrorMap:w5,getErrorMap:Qx,makeIssue:sx,EMPTY_PATH:S5,addIssueToContext:N,ParseStatus:Ki,INVALID:nn,DIRTY:Qp,OK:Hi,isAborted:X$,isDirty:G$,isValid:Ba,isAsync:Na,get util(){return Rn},get objectUtil(){return W$},ZodParsedType:D,getParsedType:vc,ZodType:$n,datetimeRegex:CR,ZodString:Ro,ZodNumber:wc,ZodBigInt:Sc,ZodBoolean:bp,ZodDate:Bc,ZodSymbol:La,ZodUndefined:Vp,ZodNull:_p,ZodAny:Nc,ZodUnknown:Tc,ZodNever:Qo,ZodVoid:ta,ZodArray:Mo,ZodObject:hn,ZodUnion:yp,ZodDiscriminatedUnion:bx,ZodIntersection:jp,ZodTuple:so,ZodRecord:Da,ZodMap:ha,ZodSet:Lc,ZodFunction:sp,ZodLazy:Bp,ZodLiteral:Np,ZodEnum:Ac,ZodNativeEnum:Lp,ZodPromise:tc,ZodEffects:oo,ZodTransformer:oo,ZodOptional:Ko,ZodNullable:Do,ZodDefault:tp,ZodCatch:Dp,ZodNaN:Ia,BRAND:Q5,ZodBranded:Vx,ZodPipeline:Ca,ZodReadonly:hp,custom:rR,Schema:$n,ZodSchema:$n,late:s5,get ZodFirstPartyTypeKind(){return g},coerce:vG,any:N5,array:h5,bigint:V5,boolean:eR,date:_5,discriminatedUnion:k5,effect:LR,enum:iG,function:g5,instanceof:U5,intersection:r5,lazy:d5,literal:nG,map:e5,nan:b5,nativeEnum:oG,never:t5,null:B5,nullable:aG,number:qR,object:ka,oboolean:$G,onumber:fG,optional:pG,ostring:lG,pipeline:xG,preprocess:mG,promise:cG,record:q5,set:P5,strictObject:I5,string:ZR,symbol:y5,transformer:LR,tuple:Z5,undefined:j5,union:C5,unknown:L5,void:D5,NEVER:TG,ZodIssueCode:s,quotelessJson:T5,ZodError:hi});function PR(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[R,O]of Object.entries(i))if(O==="")delete i[R]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},a=typeof n.server==="object"?n.server:{},m=typeof n.shared==="object"?n.shared:{},x=ka(p),l=ka(a),f=ka(m),$=n.isServer??(typeof window==="undefined"||("Deno"in window)),v=x.merge(f),w=l.merge(f).merge(x),F=$?w.safeParse(i):v.safeParse(i),M=n.onValidationError??((R)=>{throw console.error("\u274C Invalid environment variables:",R.flatten().fieldErrors),new Error("Invalid environment variables")}),J=n.onInvalidAccess??((R)=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(F.success===!1)return M(F.error);let X=(R)=>{if(!n.clientPrefix)return!0;return!R.startsWith(n.clientPrefix)&&!(R in f.shape)},G=(R)=>{return $||!X(R)},u=(R)=>{return R==="__esModule"||R==="$$typeof"},Q=(n.extends??[]).reduce((R,O)=>{return Object.assign(R,O)},{}),V=Object.assign(F.data,Q);return new Proxy(V,{get(R,O){if(typeof O!=="string")return;if(u(O))return;if(!G(O))return J(O);return Reflect.get(R,O)}})}var wG="__vite_start_time"in globalThis,SG=typeof window!=="undefined",EB="vitest"in globalThis,qn=PR({isServer:!wG&&!SG,server:{CI:Gn.string().transform((n)=>!0).optional(),POSTGRES_USER:Gn.string(),POSTGRES_PASSWORD:Gn.string(),POSTGRES_DATABASE:Gn.string(),POSTGRES_HOST:Gn.string(),POSTGRES_PORT:Gn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Gn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Gn.union([Gn.literal("true"),Gn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Gn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Gn.string().transform((n)=>JSON.parse(n)).pipe(Gn.array(Gn.string())),OPENAI_API_KEY:Gn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Gn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Gn.union([Gn.literal("true"),Gn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var dR=u$(import.meta.dirname,"../dev"),Y$=qn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:gR(u$(dR,"./cert.pem"),"utf-8"),key:gR(u$(dR,"./key.pem"),"utf-8")}:void 0;var Dc=new ul,Mn=qn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:Dc.logger;on.STORE.loggers[0]=new Rc("warn",void 0,Mn);import{spawn as AG}from"child_process";import{resolve as JG}from"path";function O$(n,i,o=n.logger){let c=qn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[JG(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let x=AG(p,m);return new $a(x,i,o)}var nM=al(af(),1);var FG=604800000,_x=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new nM.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[a,m]of c.entries())if(p-m>FG)c.delete(a);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),Mn.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import f9 from"path";import tG from"os";import DG from"fs";var yx=new Map,H$=new Map,E$=Symbol("OriginError"),Ip={};class co extends Promise{constructor(n,i,o,c,p={}){let a,m;super((x,l)=>{a=x,m=l});this.tagged=Array.isArray(n.raw),this.strings=n,this.args=i,this.handler=o,this.canceller=c,this.options=p,this.state=null,this.statement=null,this.resolve=(x)=>(this.active=!1,a(x)),this.reject=(x)=>(this.active=!1,m(x)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[E$]=this.handler.debug?new Error:this.tagged&&RG(this.strings)}get origin(){return(this.handler.debug?this[E$].stack:this.tagged&&H$.has(this.strings)?H$.get(this.strings):H$.set(this.strings,this[E$].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(n=1,i){if(this.options.simple=!1,typeof n==="function")i=n,n=1;if(this.cursorRows=n,typeof i==="function")return this.cursorFn=i,this;let o;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};o&&o();let c=new Promise((p,a)=>{this.cursorFn=(m)=>{return p({value:m,done:!1}),new Promise((x)=>o=x)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,a(m))});return this.execute(),c},return(){return o&&o(Ip),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw new Error(".stream has been renamed to .forEach")}forEach(n){return this.forEachFn=n,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function RG(n){if(yx.has(n))return yx.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,yx.set(n,new Error),Error.stackTraceLimit=i,yx.get(n)}class Cp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var dn={connection:iM,postgres:oM,generic:cM,notSupported:pM};function iM(n,i,o){let{host:c,port:p}=o||i,a=Object.assign(new Error("write "+n+" "+(i.path||c+":"+p)),{code:n,errno:n,address:i.path||c},i.path?{}:{port:p});return Error.captureStackTrace(a,iM),a}function oM(n){let i=new Cp(n);return Error.captureStackTrace(i,oM),i}function cM(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,cM),o}function pM(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,pM),i}var MG={string:{to:25,from:null,serialize:(n)=>""+n},number:{to:0,from:[21,23,26,700,701],serialize:(n)=>""+n,parse:(n)=>+n},json:{to:114,from:[114,3802],serialize:(n)=>JSON.stringify(n),parse:(n)=>JSON.parse(n)},boolean:{to:16,from:16,serialize:(n)=>n===!0?"t":"f",parse:(n)=>n==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(n)=>(n instanceof Date?n:new Date(n)).toISOString(),parse:(n)=>new Date(n)},bytea:{to:17,from:17,serialize:(n)=>"\\x"+Buffer.from(n).toString("hex"),parse:(n)=>Buffer.from(n.slice(2),"hex")}};class Nx{then(){Q$()}catch(){Q$()}finally(){Q$()}}class ea extends Nx{constructor(n){super();this.value=Dx(n)}}class Uo extends Nx{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class Lx extends Nx{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=KG.map(([a,m])=>({fn:m,i:n.search(a)})).sort((a,m)=>a.i-m.i).pop();return p.i===-1?_$(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function tx(n,i,o,c){let p=n instanceof Uo?n.value:n;if(p===void 0){if(n instanceof Uo?n.value=c.transform.undefined:p=n=c.transform.undefined,p===void 0)throw dn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof Uo?(i.push(n.value),n.array?n.array[n.type||Bx(n.value)]||n.type||lM(n.value):n.type):(i.push(n),Bx(n)))}var mM=$M(MG);function b$(n,i,o,c,p,a){for(let m=1;m<n.strings.length;m++)i+=V$(i,o,c,p,a)+n.strings[m],o=n.args[m];return i}function V$(n,i,o,c,p){return i instanceof Lx?i.build(n,o,c,p):i instanceof co?U$(i,o,c,p):i instanceof ea?i.value:i&&i[0]instanceof co?i.reduce((a,m)=>a+" "+U$(m,o,c,p),""):tx(i,o,c,p)}function U$(n,i,o,c){return n.fragment=!0,b$(n,n.strings[0],n.args[0],i,o,c)}function xM(n,i,o,c,p){return n.map((a)=>"("+c.map((m)=>V$("values",a[m],i,o,p)).join(",")+")").join(",")}function aM(n,i,o,c,p){let a=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(a?n[0]:n);return xM(a?n:[n],o,c,m,p)}function jx(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return _$(n,p);let a;return(i.length?i.flat():Object.keys(n)).map((x)=>{return a=n[x],(a instanceof co?U$(a,o,c,p):a instanceof ea?a.value:tx(a,o,c,p))+" as "+Dx(p.transform.column.to?p.transform.column.to(x):x)}).join(",")}var KG=Object.entries({values:aM,in:(...n)=>{let i=aM(...n);return i==="()"?"(null)":i},select:jx,as:jx,returning:jx,"\\(":jx,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((a)=>Dx(p.transform.column.to?p.transform.column.to(a):a)+"="+V$("values",n[a],o,c,p))},insert(n,i,o,c,p){let a=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+_$(a,p)+")values"+xM(Array.isArray(n)?n:[n],o,c,a,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function Q$(){throw dn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:WG,parsers:XG}=mM;function lM(n){if(Array.isArray(n))return lM(n[0]);return typeof n==="string"?1009:0}var fM=function(n){let i=$M(n||{});return{serializers:Object.assign({},WG,i.serializers),parsers:Object.assign({},XG,i.parsers)}};function $M(n){return Object.keys(n).reduce((i,o)=>{if(n[o].from&&[].concat(n[o].from).forEach((c)=>i.parsers[c]=n[o].parse),n[o].serialize)i.serializers[n[o].to]=n[o].serialize,n[o].from&&[].concat(n[o].from).forEach((c)=>i.serializers[c]=n[o].serialize);return i},{parsers:{},serializers:{}})}function _$(n,{transform:{column:i}}){return n.map((o)=>Dx(i.to?i.to(o):o)).join(",")}var Dx=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},Bx=function n(i){return i instanceof Uo?i.type:i instanceof Date?1184:i instanceof Uint8Array?17:i===!0||i===!1?16:typeof i==="bigint"?20:Array.isArray(i)?n(i[0]):0},GG=/\\/g,zG=/"/g;function uG(n){return n.replace(GG,"\\\\").replace(zG,'\\"')}var vM=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let a=i[0],m=p===1020?";":",";if(Array.isArray(a)&&!a.type)return"{"+i.map((x)=>n(x,o,c,p)).join(m)+"}";return"{"+i.map((x)=>{if(x===void 0){if(x=c.transform.undefined,x===void 0)throw dn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return x===null?"null":'"'+uG(o?o(x.type?x.value:x):""+x)+'"'}).join(m)+"}"},s$={i:0,char:null,str:"",quoted:!1,last:0},TM=function n(i,o,c){return s$.i=s$.last=0,wM(s$,i,o,c)};function wM(n,i,o,c){let p=[],a=c===1020?";":",";for(;n.i<i.length;n.i++){if(n.char=i[n.i],n.quoted)if(n.char==="\\")n.str+=i[++n.i];else if(n.char==='"')p.push(o?o(n.str):n.str),n.str="",n.quoted=i[n.i+1]==='"',n.last=n.i+2;else n.str+=n.char;else if(n.char==='"')n.quoted=!0;else if(n.char==="{")n.last=++n.i,p.push(wM(n,i,o,c));else if(n.char==="}"){n.quoted=!1,n.last<n.i&&p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;break}else if(n.char===a&&n.p!=="}"&&n.p!=='"')p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;n.p=n.char}return n.last<n.i&&p.push(o?o(i.slice(n.last,n.i+1)):i.slice(n.last,n.i+1)),p}var hc=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Ic=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Cc=(n)=>n.replace(/_/g,"-"),ra=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),Za=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),qa=(n)=>n.replace(/-/g,"_");function y$(n){return function i(o,c){return typeof o==="object"&&o!==null&&(c.type===114||c.type===3802)?Array.isArray(o)?o.map((p)=>i(p,c)):Object.entries(o).reduce((p,[a,m])=>Object.assign(p,{[n(a)]:i(m,c)}),{}):o}}hc.column={from:hc};hc.value={from:y$(hc)};ra.column={to:ra};var j$={...hc};j$.column.to=ra;Ic.column={from:Ic};Ic.value={from:y$(Ic)};Za.column={to:Za};var B$={...Ic};B$.column.to=Za;Cc.column={from:Cc};Cc.value={from:y$(Cc)};qa.column={to:qa};var N$={...Cc};N$.column.to=qa;import SM from"net";import EG from"tls";import Pa from"crypto";import L$ from"stream";import{performance as AM}from"perf_hooks";class kc extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var Ii=YG;function YG(n=[]){let i=n.slice(),o=0;return{get length(){return i.length-o},remove:(c)=>{let p=i.indexOf(c);return p===-1?null:(i.splice(p,1),c)},push:(c)=>(i.push(c),c),shift:()=>{let c=i[o++];if(o===i.length)o=0,i=[];else i[o-1]=void 0;return c}}}var Wi=Buffer.allocUnsafe(256),OG="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return Wi[0]=o,En.i=5,En},n},{}),En=Object.assign(HG,OG,{N:String.fromCharCode(0),i:0,inc(n){return En.i+=n,En},str(n){let i=Buffer.byteLength(n);return hx(i),En.i+=Wi.write(n,En.i,i,"utf8"),En},i16(n){return hx(2),Wi.writeUInt16BE(n,En.i),En.i+=2,En},i32(n,i){if(i||i===0)return Wi.writeUInt32BE(n,i),En;return hx(4),Wi.writeUInt32BE(n,En.i),En.i+=4,En},z(n){return hx(n),Wi.fill(0,En.i,En.i+n),En.i+=n,En},raw(n){return Wi=Buffer.concat([Wi.subarray(0,En.i),n]),En.i=Wi.length,En},end(n=1){Wi.writeUInt32BE(En.i-n,n);let i=Wi.subarray(0,En.i);return En.i=0,Wi=Buffer.allocUnsafe(256),i}}),Z=En;function hx(n){if(Wi.length-En.i<n){let i=Wi,o=i.length;Wi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(Wi)}}function HG(){return En.i=0,En}var h$=RM,QG=1,Jc=Z().S().end(),JM=Z().H().end(),sG=Z().i32(8).i32(80877103).end(8),UG=Buffer.concat([Z().E().str(Z.N).i32(0).end(),Jc]),bG=Z().D().str("S").str(Z.N).end(),kp=()=>{},VG=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),_G={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function RM(n,i={},{onopen:o=kp,onend:c=kp,onclose:p=kp}={}){let{ssl:a,max:m,user:x,host:l,port:f,database:$,parsers:v,transform:w,onnotice:F,onnotify:M,onparameter:J,max_pipeline:X,keep_alive:G,backoff:u,target_session_attrs:Q}=n,V=Ii(),z=QG++,R={pid:null,secret:null},O=D$(ol,n.idle_timeout),b=D$(ol,n.max_lifetime),H=D$(PM,n.connect_timeout),K=null,L,_=new kc,q=Buffer.alloc(0),cn=n.fetch_types,xn={},sn={},_i=Math.random().toString(36).slice(2),E=1,k=0,wn=0,zn=0,ni=0,Tn=0,Un=0,en=0,Nn=null,_n=null,$i=!1,bn=null,po=null,vi=null,ho=null,ii=null,yn=null,ao=null,Go=null,j=null,Pp=null,Ti={queue:i.closed,idleTimer:O,connect(T){vi=T||!0,Fv()},terminate:dp,execute:gp,cancel:rM,end:ol,count:0,id:z};return i.closed&&i.closed.push(Ti),Ti;async function kM(){let T;try{T=n.socket?await Promise.resolve(n.socket(n)):new SM.Socket}catch(W){ec(W);return}return T.on("error",ec),T.on("close",Rv),T.on("drain",Av),T}async function rM({pid:T,secret:W},e,Kn){try{L=Z().i32(16).i32(80877102).i32(T).i32(W).end(16),await Jv(),K.once("error",Kn),K.once("close",e)}catch(In){Kn(In)}}function gp(T){if($i)return cm(T,dn.connection("CONNECTION_DESTROYED",n));if(T.cancelled)return;try{return T.state=R,j?V.push(T):(j=T,j.active=!0),eM(T),xi(ZM(T))&&!T.describeFirst&&!T.cursorFn&&V.length<X&&(!T.options.onexecute||T.options.onexecute(Ti))}catch(W){return V.length===0&&xi(Jc),zo(W),!0}}function ZM(T){if(T.parameters.length>=65534)throw dn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return T.options.simple?Z().Q().str(T.statement.string+Z.N).end():T.describeFirst?Buffer.concat([Tv(T),JM]):T.prepare?T.prepared?om(T):Buffer.concat([Tv(T),om(T)]):qM(T)}function Tv(T){return Buffer.concat([Kv(T.statement.string,T.parameters,T.statement.types,T.statement.name),_4("S",T.statement.name)])}function om(T){return Buffer.concat([V4(T.parameters,T.statement.types,T.statement.name,T.cursorName),T.cursorFn?Wv("",T.cursorRows):UG])}function qM(T){return Buffer.concat([Kv(T.statement.string,T.parameters,T.statement.types),bG,om(T)])}function eM(T){let W=[],e=[],Kn=b$(T,T.strings[0],T.args[0],W,e,n);!T.tagged&&T.args.forEach((In)=>tx(In,W,e,n)),T.prepare=n.prepare&&("prepare"in T.options?T.options.prepare:!0),T.string=Kn,T.signature=T.prepare&&e+Kn,T.onlyDescribe&&delete sn[T.signature],T.parameters=T.parameters||W,T.prepared=T.prepare&&T.signature in sn,T.describeFirst=T.onlyDescribe||W.length&&!T.prepared,T.statement=T.prepared?sn[T.signature]:{string:Kn,types:e,name:T.prepare?_i+E++:""},typeof n.debug==="function"&&n.debug(z,Kn,W,e)}function xi(T,W){if(yn=yn?Buffer.concat([yn,T]):Buffer.from(T),W||yn.length>=1024)return wv(W);return _n===null&&(_n=setImmediate(wv)),!0}function wv(T){let W=K.write(yn,T);return _n!==null&&clearImmediate(_n),yn=_n=null,W}function PM(){zo(dn.connection("CONNECT_TIMEOUT",n,K)),K.destroy()}async function Sv(){if(xi(sG),!await new Promise((W)=>K.once("data",(e)=>W(e[0]===83)))&&a==="prefer")return qc();K.removeAllListeners(),K=EG.connect({socket:K,servername:SM.isIP(K.host)?void 0:K.host,...a==="require"||a==="allow"||a==="prefer"?{rejectUnauthorized:!1}:a==="verify-full"?{}:typeof a==="object"?a:{}}),K.on("secureConnect",qc),K.on("error",ec),K.on("close",Rv),K.on("drain",Av)}function Av(){!j&&o(Ti)}function il(T){if(bn){if(bn.push(T),wn-=T.length,wn>=0)return}q=bn?Buffer.concat(bn,Tn-wn):q.length===0?T:Buffer.concat([q,T],q.length+T.length);while(q.length>4){if(Tn=q.readUInt32BE(1),Tn>=q.length){wn=Tn-q.length,bn=[q];break}try{gM(q.subarray(0,Tn+1))}catch(W){j&&(j.cursorFn||j.describeFirst)&&xi(Jc),zo(W)}q=q.subarray(Tn+1),wn=0,bn=null}}async function Jv(){if($i=!1,xn={},K||(K=await kM()),!K)return;if(H.start(),n.socket)return a?Sv():qc();if(K.on("connect",a?Sv:qc),n.path)return K.connect(n.path);K.ssl=a,K.connect(f[zn],l[zn]),K.host=l[zn],K.port=f[zn],zn=(zn+1)%f.length}function Fv(){setTimeout(Jv,k?k+Un-AM.now():0)}function qc(){try{sn={},cn=n.fetch_types,_i=Math.random().toString(36).slice(2),E=1,b.start(),K.on("data",il),G&&K.setKeepAlive&&K.setKeepAlive(!0,1000*G);let T=j4();xi(T)}catch(T){ec(T)}}function ec(T){if(Ti.queue===i.connecting&&n.host[ni+1])return;zo(T);while(V.length)cm(V.shift(),T)}function zo(T){ii&&(ii.destroy(T),ii=null),j&&cm(j,T),vi&&(cm(vi,T),vi=null)}function cm(T,W){Object.defineProperties(W,{stack:{value:W.stack+T.origin.replace(/.*\n/,"\n"),enumerable:n.debug},query:{value:T.string,enumerable:n.debug},parameters:{value:T.parameters,enumerable:n.debug},args:{value:T.args,enumerable:n.debug},types:{value:T.statement&&T.statement.types,enumerable:n.debug}}),T.reject(W)}function ol(){return ho||(!Ti.reserved&&c(Ti),!Ti.reserved&&!vi&&!j&&V.length===0?(dp(),new Promise((T)=>K&&K.readyState!=="closed"?K.once("close",T):T())):ho=new Promise((T)=>ao=T))}function dp(){if($i=!0,ii||j||vi||V.length)ec(dn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(_n),K)K.removeListener("data",il),K.removeListener("connect",qc),K.readyState==="open"&&K.end(Z().X().end());ao&&(ao(),ho=ao=null)}async function Rv(T){if(q=Buffer.alloc(0),wn=0,bn=null,clearImmediate(_n),K.removeListener("data",il),K.removeListener("connect",qc),O.cancel(),b.cancel(),H.cancel(),K.removeAllListeners(),K=null,vi)return Fv();!T&&(j||V.length)&&ec(dn.connection("CONNECTION_CLOSED",n,K)),k=AM.now(),T&&n.shared.retries++,Un=(typeof u==="function"?u(n.shared.retries):u)*1000,p(Ti,dn.connection("CONNECTION_CLOSED",n,K))}function gM(T,W=T[0]){(W===68?dM:W===100?Y4:W===65?K4:W===83?n4:W===90?i4:W===67?o4:W===50?Mv:W===49?c4:W===116?p4:W===84?a4:W===82?m4:W===110?T4:W===75?w4:W===69?R4:W===115?W4:W===51?X4:W===71?G4:W===78?H4:W===72?z4:W===99?O4:W===73?E4:W===86?Q4:W===118?s4:W===87?u4:U4)(T)}function dM(T){let W=7,e,Kn,In,wi=j.isRaw?new Array(j.statement.columns.length):{};for(let Xi=0;Xi<j.statement.columns.length;Xi++)Kn=j.statement.columns[Xi],e=T.readInt32BE(W),W+=4,In=e===-1?null:j.isRaw===!0?T.subarray(W,W+=e):Kn.parser===void 0?T.toString("utf8",W,W+=e):Kn.parser.array===!0?Kn.parser(T.toString("utf8",W+1,W+=e)):Kn.parser(T.toString("utf8",W,W+=e)),j.isRaw?wi[Xi]=j.isRaw===!0?In:w.value.from?w.value.from(In,Kn):In:wi[Kn.name]=w.value.from?w.value.from(In,Kn):In;j.forEachFn?j.forEachFn(w.row.from?w.row.from(wi):wi,_):_[en++]=w.row.from?w.row.from(wi):wi}function n4(T){let[W,e]=T.toString("utf8",5,T.length-1).split(Z.N);if(xn[W]=e,n.parameters[W]!==e)n.parameters[W]=e,J&&J(W,e)}function i4(T){if(j&&j.options.simple&&j.resolve(po||_),j=po=null,_=new kc,H.cancel(),vi){if(Q){if(!xn.in_hot_standby||!xn.default_transaction_read_only)return F4();else if(J4(Q,xn))return dp()}if(cn)return vi===!0&&(vi=null),S4();vi!==!0&&gp(vi),n.shared.retries=ni=0,vi=null;return}while(V.length&&(j=V.shift())&&(j.active=!0,j.cancelled))RM(n).cancel(j.state,j.cancelled.resolve,j.cancelled.reject);if(j)return;Ti.reserved?!Ti.reserved.release&&T[5]===73?ho?dp():(Ti.reserved=null,o(Ti)):Ti.reserved():ho?dp():o(Ti)}function o4(T){en=0;for(let W=T.length-1;W>0;W--){if(T[W]===32&&T[W+1]<58&&_.count===null)_.count=+T.toString("utf8",W+1,T.length-1);if(T[W-1]>=65){_.command=T.toString("utf8",5,W),_.state=R;break}}if(Pp&&(Pp(),Pp=null),_.command==="BEGIN"&&m!==1&&!Ti.reserved)return zo(dn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(j.options.simple)return Mv();if(j.cursorFn)_.count&&j.cursorFn(_),xi(Jc);j.resolve(_)}function c4(){j.parsing=!1}function Mv(){!_.statement&&(_.statement=j.statement),_.columns=j.statement.columns}function p4(T){let W=T.readUInt16BE(5);for(let e=0;e<W;++e)!j.statement.types[e]&&(j.statement.types[e]=T.readUInt32BE(7+e*4));j.prepare&&(sn[j.signature]=j.statement),j.describeFirst&&!j.onlyDescribe&&(xi(om(j)),j.describeFirst=!1)}function a4(T){if(_.command)po=po||[_],po.push(_=new kc),_.count=null,j.statement.columns=null;let W=T.readUInt16BE(5),e=7,Kn;j.statement.columns=Array(W);for(let In=0;In<W;++In){Kn=e;while(T[e++]!==0);let wi=T.readUInt32BE(e),Xi=T.readUInt16BE(e+4),Io=T.readUInt32BE(e+6);j.statement.columns[In]={name:w.column.from?w.column.from(T.toString("utf8",Kn,e-1)):T.toString("utf8",Kn,e-1),parser:v[Io],table:wi,number:Xi,type:Io},e+=18}if(_.statement=j.statement,j.onlyDescribe)return j.resolve(j.statement),xi(Jc)}async function m4(T,W=T.readUInt32BE(5)){(W===3?x4:W===5?l4:W===10?f4:W===11?$4:W===12?v4:W!==0?b4:kp)(T,W)}async function x4(){let T=await cl();xi(Z().p().str(T).z(1).end())}async function l4(T){let W="md5"+await FM(Buffer.concat([Buffer.from(await FM(await cl()+x)),T.subarray(9)]));xi(Z().p().str(W).z(1).end())}async function f4(){Go=(await Pa.randomBytes(18)).toString("base64"),Z().p().str("SCRAM-SHA-256"+Z.N);let T=Z.i;xi(Z.inc(4).str("n,,n=*,r="+Go).i32(Z.i-T-4,T).end())}async function $4(T){let W=T.toString("utf8",9).split(",").reduce((Xi,Io)=>(Xi[Io[0]]=Io.slice(2),Xi),{}),e=await Pa.pbkdf2Sync(await cl(),Buffer.from(W.s,"base64"),parseInt(W.i),32,"sha256"),Kn=await Ix(e,"Client Key"),In="n=*,r="+Go+",r="+W.r+",s="+W.s+",i="+W.i+",c=biws,r="+W.r;Nn=(await Ix(await Ix(e,"Server Key"),In)).toString("base64");let wi="c=biws,r="+W.r+",p="+jG(Kn,Buffer.from(await Ix(await yG(Kn),In))).toString("base64");xi(Z().p().str(wi).end())}function v4(T){if(T.toString("utf8",9).split(Z.N,1)[0].slice(2)===Nn)return;zo(dn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),K.destroy()}function cl(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function T4(){if(_.statement=j.statement,_.statement.columns=[],j.onlyDescribe)return j.resolve(j.statement),xi(Jc)}function w4(T){R.pid=T.readUInt32BE(5),R.secret=T.readUInt32BE(9)}async function S4(){cn=!1,(await new co([`
37
+ */ov.exports=V3;ov.exports.append=oF;var U3=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function oF(n,i){if(typeof n!=="string")throw new TypeError("header argument is required");if(!i)throw new TypeError("field argument is required");var o=!Array.isArray(i)?iF(String(i)):i;for(var c=0;c<o.length;c++)if(!U3.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,a=iF(n.toLowerCase());if(o.indexOf("*")!==-1||a.indexOf("*")!==-1)return"*";for(var x=0;x<o.length;x++){var m=o[x].toLowerCase();if(a.indexOf(m)===-1)a.push(m),p=p?p+", "+o[x]:o[x]}return p}function iF(n){var i=0,o=[],c=0;for(var p=0,a=n.length;p<a;p++)switch(n.charCodeAt(p)){case 32:if(c===i)c=i=p+1;break;case 44:o.push(n.substring(c,i)),c=i=p+1;break;default:i=p+1;break}return o.push(n.substring(c,i)),o}function V3(n,i){if(!n||!n.getHeader||!n.setHeader)throw new TypeError("res argument is required");var o=n.getHeader("Vary")||"",c=Array.isArray(o)?o.join(", "):String(o);if(o=oF(c,i))n.setHeader("Vary",o)}});var cv=h((WL,pF)=>{(function(){var n=nF(),i=cF(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(M){return typeof M==="string"||M instanceof String}function p(M,A){if(Array.isArray(A)){for(var R=0;R<A.length;++R)if(p(M,A[R]))return!0;return!1}else if(c(A))return M===A;else if(A instanceof RegExp)return A.test(M);else return!!A}function a(M,A){var R=A.headers.origin,G=[],Q;if(!M.origin||M.origin==="*")G.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(M.origin))G.push([{key:"Access-Control-Allow-Origin",value:M.origin}]),G.push([{key:"Vary",value:"Origin"}]);else Q=p(R,M.origin),G.push([{key:"Access-Control-Allow-Origin",value:Q?R:!1}]),G.push([{key:"Vary",value:"Origin"}]);return G}function x(M){var A=M.methods;if(A.join)A=M.methods.join(",");return{key:"Access-Control-Allow-Methods",value:A}}function m(M){if(M.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function l(M,A){var R=M.allowedHeaders||M.headers,G=[];if(!R)R=A.headers["access-control-request-headers"],G.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(R.join)R=R.join(",");if(R&&R.length)G.push([{key:"Access-Control-Allow-Headers",value:R}]);return G}function f(M){var A=M.exposedHeaders;if(!A)return null;else if(A.join)A=A.join(",");if(A&&A.length)return{key:"Access-Control-Expose-Headers",value:A};return null}function v(M){var A=(typeof M.maxAge==="number"||M.maxAge)&&M.maxAge.toString();if(A&&A.length)return{key:"Access-Control-Max-Age",value:A};return null}function $(M,A){for(var R=0,G=M.length;R<G;R++){var Q=M[R];if(Q){if(Array.isArray(Q))$(Q,A);else if(Q.key==="Vary"&&Q.value)i(A,Q.value);else if(Q.value)A.setHeader(Q.key,Q.value)}}}function T(M,A,R,G){var Q=[],b=A.method&&A.method.toUpperCase&&A.method.toUpperCase();if(b==="OPTIONS")if(Q.push(a(M,A)),Q.push(m(M,A)),Q.push(x(M,A)),Q.push(l(M,A)),Q.push(v(M,A)),Q.push(f(M,A)),$(Q,R),M.preflightContinue)G();else R.statusCode=M.optionsSuccessStatus,R.setHeader("Content-Length","0"),R.end();else Q.push(a(M,A)),Q.push(m(M,A)),Q.push(f(M,A)),$(Q,R),G()}function F(M){var A=null;if(typeof M==="function")A=M;else A=function(R,G){G(null,M)};return function R(G,Q,b){A(G,function(D,Y){if(D)b(D);else{var K=n({},o,Y),E=null;if(K.origin&&typeof K.origin==="function")E=K.origin;else if(K.origin)E=function(y,V){V(null,K.origin)};if(E)E(G.headers.origin,function(y,V){if(y||!V)b(y);else K.origin=V,T(K,G,Q,b)});else b()}})}}pF.exports=F})()});var pv=h(($F)=>{Object.defineProperty($F,"__esModule",{value:!0});$F.Server=$F.BaseServer=void 0;var u3=import.meta.require("querystring"),_3=import.meta.require("url"),aF=Nf(),Gm=nv(),b3=import.meta.require("events"),xF=iv(),j3=xi(),y3=gA(),B3=import.meta.require("ws"),mF=ef(),L3=_a(),$n=j3.default("engine"),zp=Symbol("responseHeaders");function N3(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class ja extends b3.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:B3.Server,pingTimeout:20000,pingInterval:25000,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},n),n.cookie)this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:n.cookie.path!==!1,sameSite:"lax"},n.cookie);if(this.opts.cors)this.use(cv()(this.opts.cors));if(n.perMessageDeflate)this.opts.perMessageDeflate=Object.assign({threshold:1024},n.perMessageDeflate);this.init()}_computePath(n){let i=(n.path||"/engine.io").replace(/\/$/,"");if(n.addTrailingSlash!==!1)i+="/";return i}upgrades(n){if(!this.opts.allowUpgrades)return[];return Gm.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return $n('unknown transport "%s"',c),o(En.errors.UNKNOWN_TRANSPORT,{transport:c});if(D3(n.headers.origin)){let x=n.headers.origin;return n.headers.origin=null,$n("origin header invalid"),o(En.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:x})}let a=n._query.sid;if(a){if(!this.clients.hasOwnProperty(a))return $n('unknown sid "%s"',a),o(En.errors.UNKNOWN_SID,{sid:a});let x=this.clients[a].transport.name;if(!i&&x!==c)return $n("bad request: unexpected transport without upgrade"),o(En.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:x})}else{if(n.method!=="GET")return o(En.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return $n("invalid transport upgrade"),o(En.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(x,m)=>{if(!m)return o(En.errors.FORBIDDEN,{message:x});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return $n("no middleware to apply, skipping"),o();let c=(p)=>{$n("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(a)=>{if(a)return o(a);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){$n("closing all open clients");for(let n in this.clients)if(this.clients.hasOwnProperty(n))this.clients[n].close(!0);return this.cleanup(),this}generateId(n){return aF.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){$n("unsupported protocol version"),this.emit("connection_error",{req:i,code:En.errors.UNSUPPORTED_PROTOCOL_VERSION,message:En.errorMessages[En.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(En.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(m){$n("error while generating an id"),this.emit("connection_error",{req:i,code:En.errors.BAD_REQUEST,message:En.errorMessages[En.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:m}}),o(En.errors.BAD_REQUEST);return}$n('handshaking client "%s"',p);try{var a=this.createTransport(n,i);if(n==="polling")a.maxHttpBufferSize=this.opts.maxHttpBufferSize,a.httpCompression=this.opts.httpCompression;else if(n==="websocket")a.perMessageDeflate=this.opts.perMessageDeflate}catch(m){$n('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:En.errors.BAD_REQUEST,message:En.errorMessages[En.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:m}}),o(En.errors.BAD_REQUEST);return}let x=new xF.Socket(p,this,a,i,c);return a.on("headers",(m,l)=>{if(!l._query.sid){if(this.opts.cookie)m["Set-Cookie"]=[y3.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",m,l)}this.emit("headers",m,l)}),a.onRequest(i),this.clients[p]=x,this.clientsCount++,x.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",x),a}async onWebTransportSession(n){let i=setTimeout(()=>{$n("the client failed to establish a bidirectional stream in the given period"),n.close()},this.opts.upgradeTimeout),c=await n.incomingBidirectionalStreams.getReader().read();if(c.done){$n("session is closed");return}let p=c.value,a=L3.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),x=p.readable.pipeThrough(a).getReader(),{value:m,done:l}=await x.read();if(l){$n("stream is closed");return}if(clearTimeout(i),m.type!=="open")return $n("invalid WebTransport handshake"),n.close();if(m.data===void 0){let $=new mF.WebTransport(n,p,x),T=aF.generateId();$n('handshaking client "%s" (WebTransport)',T);let F=new xF.Socket(T,this,$,null,4);this.clients[T]=F,this.clientsCount++,F.once("close",()=>{delete this.clients[T],this.clientsCount--}),this.emit("connection",F);return}let f=N3(m.data);if(!f)return $n("invalid WebTransport handshake"),n.close();let v=this.clients[f];if(!v)$n("upgrade attempt for closed client"),n.close();else if(v.upgrading)$n("transport has already been trying to upgrade"),n.close();else if(v.upgraded)$n("transport had already been upgraded"),n.close();else{$n("upgrading existing transport");let $=new mF.WebTransport(n,p,x);v._maybeUpgrade($)}}}$F.BaseServer=ja;ja.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};ja.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class vF{constructor(n,i){this.req=n,this.socket=i,n[zp]={}}setHeader(n,i){this.req[zp][n]=i}getHeader(n){return this.req[zp][n]}removeHeader(n){delete this.req[zp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class En extends ja{init(){if(!~this.opts.transports.indexOf("websocket"))return;if(this.ws)this.ws.close();if(this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on==="function")this.ws.on("headers",(n,i)=>{let o=i[zp]||{};if(delete i[zp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),$n("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)$n("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?u3.parse(_3.parse(n.url).query):{}}createTransport(n,i){return new Gm.default[n](i)}handleRequest(n,i){$n('handling "%s" http request "%s"',n.method,n.url),this.prepare(n),n.res=i;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:n,code:c,message:En.errorMessages[c],context:p}),lF(i,c,p);return}if(n._query.sid)$n("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let a=(x,m)=>lF(i,x,m);this.handshake(n._query.transport,n,a)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(En.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new vF(n,i),p=(a,x)=>{if(a!==void 0){this.emit("connection_error",{req:n,code:a,message:En.errorMessages[a],context:x}),fF(i,a,x);return}let m=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,m,(l)=>{this.onWebSocket(n,i,l)})};this._applyMiddlewares(n,c,(a)=>{if(a)p(En.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Gm.default[n._query.transport]!==void 0&&!Gm.default[n._query.transport].prototype.handlesUpgrades){$n("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let a=this.clients[c];if(!a)$n("upgrade attempt for closed client"),o.close();else if(a.upgrading)$n("transport has already been trying to upgrade"),o.close();else if(a.upgraded)$n("transport had already been upgraded"),o.close();else{$n("upgrading existing transport"),o.removeListener("error",p);let x=this.createTransport(n._query.transport,n);x.perMessageDeflate=this.opts.perMessageDeflate,a._maybeUpgrade(x)}}else{let a=(x,m)=>fF(i,x,m);this.handshake(n._query.transport,n,a)}function p(){$n("websocket error before upgrade")}}attach(n,i={}){let o=this._computePath(i),c=i.destroyUpgradeTimeout||1000;function p(x){return o===x.url.slice(0,o.length)}let a=n.listeners("request").slice(0);if(n.removeAllListeners("request"),n.on("close",this.close.bind(this)),n.on("listening",this.init.bind(this)),n.on("request",(x,m)=>{if(p(x))$n('intercepting request for path "%s"',o),this.handleRequest(x,m);else{let l=0,f=a.length;for(;l<f;l++)a[l].call(n,x,m)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(x,m,l)=>{if(p(x))this.handleUpgrade(x,m,l);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(m.writable&&m.bytesWritten<=0)return m.on("error",(f)=>{$n("error while destroying upgrade: %s",f.message)}),m.end()},c)})}}$F.Server=En;function lF(n,i,o){let c=i===En.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:En.errorMessages[i];n.writeHead(c,{"Content-Type":"application/json"}),n.end(JSON.stringify({code:i,message:p}))}function fF(n,i,o={}){if(n.on("error",()=>{$n("ignoring error from closed connection")}),n.writable){let c=o.message||En.errorMessages[i],p=Buffer.byteLength(c);n.write("HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-type: text/html\r\nContent-Length: "+p+"\r\n\r\n"+c)}n.destroy()}var ba=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function D3(n){if(n+="",n.length<1)return!1;if(!ba[n.charCodeAt(0)])return $n('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!ba[n.charCodeAt(1)])return $n('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!ba[n.charCodeAt(2)])return $n('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!ba[n.charCodeAt(3)])return $n('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!ba[n.charCodeAt(i)])return $n('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var FF=h((SF)=>{Object.defineProperty(SF,"__esModule",{value:!0});SF.Polling=void 0;var h3=uc(),wF=import.meta.require("zlib"),I3=fm(),k3=xi(),io=k3.default("engine:polling"),s3={gzip:wF.createGzip,deflate:wF.createDeflate};class JF extends h3.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.getMethod()==="get")this.onPollRequest(n,i);else if(n.getMethod()==="post")this.onDataRequest(n,i);else i.writeStatus("500 Internal Server Error"),i.end()}onPollRequest(n,i){if(this.req){io("request overlap"),this.onError("overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}io("setting request"),this.req=n,this.res=i;let o=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},c=()=>{this.req=this.res=null};if(n.cleanup=c,i.onAborted(o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)io("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}let o=Number(n.headers["content-length"]);if(!o){this.onError("content-length header required"),i.writeStatus("411 Length Required").end();return}if(o>this.maxHttpBufferSize){this.onError("payload too large"),i.writeStatus("413 Payload Too Large").end();return}if(n.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let p,a=0,x={"Content-Type":"text/html"};this.headers(n,x);for(let l in x)i.writeHeader(l,String(x[l]));let m=(l)=>{this.onData(l.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((l,f)=>{let v=a+l.byteLength;if(v>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(f){m(Buffer.from(l));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(l).copy(p,a),f){if(v!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}m(p);return}a=v})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(n){io('received "%s"',n);let i=(o)=>{if(o.type==="close")return io("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)io("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){io('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",a={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},x=(f)=>{this.headers(this.req,a),this.res.cork(()=>{Object.keys(a).forEach((v)=>{this.res.writeHeader(v,String(a[v]))}),this.res.end(f)}),o()};if(!this.httpCompression||!i.compress){x(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){x(n);return}let l=I3(this.req).encodings(["gzip","deflate"]);if(!l){x(n);return}this.compress(n,l,(f,v)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(f);return}a["Content-Encoding"]=l,x(v)})}compress(n,i,o){io("compressing");let c=[],p=0;s3[i](this.httpCompression).on("error",o).on("data",function(a){c.push(a),p+=a.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){io("closing");let i,o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)io("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)io("transport discarded - closing right away"),o();else io("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i){i=i||{};let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}SF.Polling=JF});var XF=h((WF)=>{Object.defineProperty(WF,"__esModule",{value:!0});WF.WebSocket=void 0;var Z3=uc(),t3=xi(),MF=t3.default("engine:ws");class RF extends Z3.Transport{constructor(n){super(n);this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length,p=(a)=>{let x=typeof a!=="string",m=this.perMessageDeflate&&Buffer.byteLength(a)>this.perMessageDeflate.threshold;if(MF('writing "%s"',a),this.socket.send(a,x,m),c)this.emit("drain"),this.writable=!0,this.emit("ready")};if(o.options&&typeof o.options.wsPreEncoded==="string")p(o.options.wsPreEncoded);else this.parser.encodePacket(o,this.supportsBinary,p)}}doClose(n){MF("closing"),n&&n(),this.socket.end()}}WF.WebSocket=RF});var YF=h((GF)=>{Object.defineProperty(GF,"__esModule",{value:!0});var q3=FF(),P3=XF();GF.default={polling:q3.Polling,websocket:P3.WebSocket}});var OF=h((HF)=>{Object.defineProperty(HF,"__esModule",{value:!0});HF.uServer=void 0;var g3=xi(),_c=pv(),d3=YF(),vc=g3.default("engine:uws");class zF extends _c.BaseServer{init(){}cleanup(){}prepare(n,i){n.method=n.getMethod().toUpperCase(),n.url=n.getUrl();let o=new URLSearchParams(n.getQuery());n._query=Object.fromEntries(o.entries()),n.headers={},n.forEach((c,p)=>{n.headers[c]=p}),n.connection={remoteAddress:Buffer.from(i.getRemoteAddressAsText()).toString()},i.onAborted(()=>{vc("response has been aborted")})}createTransport(n,i){return new d3.default[n](i)}attach(n,i={}){let o=this._computePath(i);n.any(o,this.handleRequest.bind(this)).ws(o,{compression:i.compression,idleTimeout:i.idleTimeout,maxBackpressure:i.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:(c)=>{let p=c.getUserData().transport;p.socket=c,p.writable=!0,p.emit("ready")},message:(c,p,a)=>{c.getUserData().transport.onData(a?p:Buffer.from(p).toString())},close:(c,p,a)=>{c.getUserData().transport.onClose(p,a)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new QF(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){vc('handling "%s" http request "%s"',i.getMethod(),i.getUrl()),this.prepare(i,n),i.res=n;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:i,code:c,message:_c.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)vc("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let a=(x,m)=>this.abortRequest(n,x,m);this.handshake(i._query.transport,i,a)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(_c.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){vc("on upgrade"),this.prepare(i,n),i.res=n;let c=async(p,a)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:_c.Server.errorMessages[p],context:a}),this.abortRequest(n,p,a);return}let x=i._query.sid,m;if(x){let l=this.clients[x];if(!l)return vc("upgrade attempt for closed client"),n.close();else if(l.upgrading)return vc("transport has already been trying to upgrade"),n.close();else if(l.upgraded)return vc("transport had already been upgraded"),n.close();else vc("upgrading existing transport"),m=this.createTransport(i._query.transport,i),l._maybeUpgrade(m)}else if(m=await this.handshake(i._query.transport,i,(l,f)=>this.abortRequest(n,l,f)),!m)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:m},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(_c.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===_c.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:_c.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}HF.uServer=zF;class QF{constructor(n){this.res=n,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(n){if(!n)return;this.writeStatus(n===200?"200 OK":"204 No Content")}writeHead(n){this.statusCode=n}setHeader(n,i){if(Array.isArray(i))i.forEach((o)=>{this.writeHeader(n,o)});else this.writeHeader(n,i)}removeHeader(){}getHeader(){}writeStatus(n){if(this.isAborted)return;return this.res.writeStatus(n),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(n,i){if(this.isAborted)return;if(n==="Content-Length")return;if(this.statusWritten)this.res.writeHeader(n,i);else this.headers.push([n,i])}writeBufferedHeaders(){this.headers.forEach(([n,i])=>{this.res.writeHeader(n,i)})}end(n){if(this.isAborted)return;this.res.cork(()=>{if(!this.statusWritten)this.writeBufferedHeaders();this.res.end(n)})}onData(n){if(this.isAborted)return;this.res.onData(n)}onAborted(n){if(this.isAborted)return;this.res.onAborted(()=>{this.isAborted=!0,n()})}cork(n){if(this.isAborted)return;this.res.cork(n)}}});var bF=h((Qp)=>{Object.defineProperty(Qp,"__esModule",{value:!0});Qp.protocol=Qp.Transport=Qp.Socket=Qp.uServer=Qp.parser=Qp.transports=Qp.Server=void 0;Qp.listen=pX;Qp.attach=uF;var e3=import.meta.require("http"),UF=pv();Object.defineProperty(Qp,"Server",{enumerable:!0,get:function(){return UF.Server}});var nX=nv();Qp.transports=nX.default;var VF=_a();Qp.parser=VF;var iX=OF();Object.defineProperty(Qp,"uServer",{enumerable:!0,get:function(){return iX.uServer}});var oX=iv();Object.defineProperty(Qp,"Socket",{enumerable:!0,get:function(){return oX.Socket}});var cX=uc();Object.defineProperty(Qp,"Transport",{enumerable:!0,get:function(){return cX.Transport}});Qp.protocol=VF.protocol;function pX(n,i,o){if(typeof i==="function")o=i,i={};let c=e3.createServer(function(a,x){x.writeHead(501),x.end("Not Implemented")}),p=uF(c,i);return p.httpServer=c,c.listen(n,o),p}function uF(n,i){let o=new UF.Server(i);return o.attach(n,i),o}});var jF=h((vX)=>{vX.Emitter=Hi;function Hi(n){if(n)return fX(n)}function fX(n){for(var i in Hi.prototype)n[i]=Hi.prototype[i];return n}Hi.prototype.on=Hi.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Hi.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this};Hi.prototype.off=Hi.prototype.removeListener=Hi.prototype.removeAllListeners=Hi.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+n];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;var c;for(var p=0;p<o.length;p++)if(c=o[p],c===i||c.fn===i){o.splice(p,1);break}if(o.length===0)delete this._callbacks["$"+n];return this};Hi.prototype.emit=function(n){this._callbacks=this._callbacks||{};var i=new Array(arguments.length-1),o=this._callbacks["$"+n];for(var c=1;c<arguments.length;c++)i[c-1]=arguments[c];if(o){o=o.slice(0);for(var c=0,p=o.length;c<p;++c)o[c].apply(this,i)}return this};Hi.prototype.emitReserved=Hi.prototype.emit;Hi.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Hi.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var av=h((LF)=>{Object.defineProperty(LF,"__esModule",{value:!0});LF.hasBinary=LF.isBinary=void 0;var TX=typeof ArrayBuffer==="function",wX=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},yF=Object.prototype.toString,JX=typeof Blob==="function"||typeof Blob!=="undefined"&&yF.call(Blob)==="[object BlobConstructor]",SX=typeof File==="function"||typeof File!=="undefined"&&yF.call(File)==="[object FileConstructor]";function BF(n){return TX&&(n instanceof ArrayBuffer||wX(n))||JX&&n instanceof Blob||SX&&n instanceof File}LF.isBinary=BF;function Ym(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Ym(n[o]))return!0;return!1}if(BF(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Ym(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Ym(n[o]))return!0;return!1}LF.hasBinary=Ym});var hF=h((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.reconstructPacket=DF.deconstructPacket=void 0;var FX=av();function MX(n){let i=[],o=n.data,c=n;return c.data=xv(o,i),c.attachments=i.length,{packet:c,buffers:i}}DF.deconstructPacket=MX;function xv(n,i){if(!n)return n;if(FX.isBinary(n)){let o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){let o=new Array(n.length);for(let c=0;c<n.length;c++)o[c]=xv(n[c],i);return o}else if(typeof n==="object"&&!(n instanceof Date)){let o={};for(let c in n)if(Object.prototype.hasOwnProperty.call(n,c))o[c]=xv(n[c],i);return o}return n}function RX(n,i){return n.data=mv(n.data,i),delete n.attachments,n}DF.reconstructPacket=RX;function mv(n,i){if(!n)return n;if(n&&n._placeholder===!0)if(typeof n.num==="number"&&n.num>=0&&n.num<i.length)return i[n.num];else throw new Error("illegal attachments");else if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=mv(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=mv(n[o],i)}return n}});var ya=h((PF)=>{Object.defineProperty(PF,"__esModule",{value:!0});PF.Decoder=PF.Encoder=PF.PacketType=PF.protocol=void 0;var KX=jF(),sF=hF(),ZF=av(),XX=xi(),lv=XX.default("socket.io-parser"),GX=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];PF.protocol=5;var sn;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(sn=PF.PacketType||(PF.PacketType={}));class tF{constructor(n){this.replacer=n}encode(n){if(lv("encoding packet %j",n),n.type===sn.EVENT||n.type===sn.ACK){if(ZF.hasBinary(n))return this.encodeAsBinary({type:n.type===sn.EVENT?sn.BINARY_EVENT:sn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===sn.BINARY_EVENT||n.type===sn.BINARY_ACK)i+=n.attachments+"-";if(n.nsp&&n.nsp!=="/")i+=n.nsp+",";if(n.id!=null)i+=n.id;if(n.data!=null)i+=JSON.stringify(n.data,this.replacer);return lv("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=sF.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}PF.Encoder=tF;function IF(n){return Object.prototype.toString.call(n)==="[object Object]"}class fv extends KX.Emitter{constructor(n){super();this.reviver=n}add(n){let i;if(typeof n==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);let o=i.type===sn.BINARY_EVENT;if(o||i.type===sn.BINARY_ACK){if(i.type=o?sn.EVENT:sn.ACK,this.reconstructor=new qF(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(ZF.isBinary(n)||n.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(i=this.reconstructor.takeBinaryData(n),i)this.reconstructor=null,super.emitReserved("decoded",i)}else throw new Error("Unknown type: "+n)}decodeString(n){let i=0,o={type:Number(n.charAt(0))};if(sn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===sn.BINARY_EVENT||o.type===sn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let a=n.substring(p,i);if(a!=Number(a)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(a)}if(n.charAt(i+1)==="/"){let p=i+1;while(++i){if(n.charAt(i)===",")break;if(i===n.length)break}o.nsp=n.substring(p,i)}else o.nsp="/";let c=n.charAt(i+1);if(c!==""&&Number(c)==c){let p=i+1;while(++i){let a=n.charAt(i);if(a==null||Number(a)!=a){--i;break}if(i===n.length)break}o.id=Number(n.substring(p,i+1))}if(n.charAt(++i)){let p=this.tryParse(n.substr(i));if(fv.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return lv("decoded %s as %j",n,o),o}tryParse(n){try{return JSON.parse(n,this.reviver)}catch(i){return!1}}static isPayloadValid(n,i){switch(n){case sn.CONNECT:return IF(i);case sn.DISCONNECT:return i===void 0;case sn.CONNECT_ERROR:return typeof i==="string"||IF(i);case sn.EVENT:case sn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&GX.indexOf(i[0])===-1);case sn.ACK:case sn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}PF.Decoder=fv;class qF{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){let i=sF.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var nM=h((dF)=>{Object.defineProperty(dF,"__esModule",{value:!0});dF.Client=void 0;var zm=ya(),QX=xi(),HX=import.meta.require("url"),Ao=QX("socket.io:client");class gF{constructor(n,i){this.sockets=new Map,this.nsps=new Map,this.server=n,this.conn=i,this.encoder=n.encoder,this.decoder=new n._parser.Decoder,this.id=i.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{if(this.nsps.size===0)Ao("no namespace joined yet, close the client"),this.close();else Ao("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(n,i={}){if(this.server._nsps.has(n))return Ao("connecting to namespace %s",n),this.doConnect(n,i);this.server._checkNamespace(n,i,(o)=>{if(o)this.doConnect(n,i);else Ao("creation of namespace %s was denied",n),this._packet({type:zm.PacketType.CONNECT_ERROR,nsp:n,data:{message:"Invalid namespace"}})})}doConnect(n,i){let o=this.server.of(n);o._add(this,i,(c)=>{if(this.sockets.set(c.id,c),this.nsps.set(o.name,c),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0})}_disconnect(){for(let n of this.sockets.values())n.disconnect();this.sockets.clear(),this.close()}_remove(n){if(this.sockets.has(n.id)){let i=this.sockets.get(n.id).nsp.name;this.sockets.delete(n.id),this.nsps.delete(i)}else Ao("ignoring remove for %s",n.id)}close(){if(this.conn.readyState==="open")Ao("forcing transport close"),this.conn.close(),this.onclose("forced server close")}_packet(n,i={}){if(this.conn.readyState!=="open"){Ao("ignoring packet write %j",n);return}let o=i.preEncoded?n:this.encoder.encode(n);this.writeToEngine(o,i)}writeToEngine(n,i){if(i.volatile&&!this.conn.transport.writable){Ao("volatile packet is discarded since the transport is not currently writable");return}let o=Array.isArray(n)?n:[n];for(let c of o)this.conn.write(c,i)}ondata(n){try{this.decoder.add(n)}catch(i){Ao("invalid packet format"),this.onerror(i)}}ondecoded(n){let i,o;if(this.conn.protocol===3){let p=HX.parse(n.nsp,!0);i=p.pathname,o=p.query}else i=n.nsp,o=n.data;let c=this.nsps.get(i);if(!c&&n.type===zm.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==zm.PacketType.CONNECT&&n.type!==zm.PacketType.CONNECT_ERROR)process.nextTick(function(){c._onpacket(n)});else Ao("invalid state (packet type: %s)",n.type),this.close()}onerror(n){for(let i of this.sockets.values())i._onerror(n);this.conn.close()}onclose(n,i){Ao("client close with reason %s",n),this.destroy();for(let o of this.sockets.values())o._onclose(n,i);this.sockets.clear(),this.decoder.destroy()}destroy(){if(this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0}}dF.Client=gF});var Qm=h((oM)=>{Object.defineProperty(oM,"__esModule",{value:!0});oM.StrictEventEmitter=void 0;var EX=import.meta.require("events");class iM extends EX.EventEmitter{on(n,i){return super.on(n,i)}once(n,i){return super.once(n,i)}emit(n,...i){return super.emit(n,...i)}emitReserved(n,...i){return super.emit(n,...i)}emitUntyped(n,...i){return super.emit(n,...i)}listeners(n){return super.listeners(n)}}oM.StrictEventEmitter=iM});var vv=h((pM)=>{Object.defineProperty(pM,"__esModule",{value:!0});pM.RESERVED_EVENTS=void 0;pM.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Tv=h((xM)=>{Object.defineProperty(xM,"__esModule",{value:!0});xM.RemoteSocket=xM.BroadcastOperator=void 0;var OX=vv(),UX=ya();class No{constructor(n,i=new Set,o=new Set,c={}){this.adapter=n,this.rooms=i,this.exceptRooms=o,this.flags=c}to(n){let i=new Set(this.rooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new No(this.adapter,i,this.exceptRooms,this.flags)}in(n){return this.to(n)}except(n){let i=new Set(this.exceptRooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new No(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new No(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new No(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new No(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new No(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(OX.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:UX.PacketType.EVENT,data:o};if(typeof o[o.length-1]!=="function")return this.adapter.broadcast(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let a=o.pop(),x=!1,m=[],l=setTimeout(()=>{x=!0,a.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:m])},this.flags.timeout),f=-1,v=0,$=0,T=()=>{if(!x&&f===v&&m.length===$)clearTimeout(l),a.apply(this,[null,this.flags.expectSingleResponse?m[0]:m])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(F)=>{$+=F,v++,T()},(F)=>{m.push(F),T()}),this.adapter.serverCount().then((F)=>{f=F,T()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,a)=>{if(p)return p.responses=a,c(p);else return o(a)}),this.emit(n,...i)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((n)=>{return n.map((i)=>{if(i.server)return i;else return new $v(this.adapter,i)})})}socketsJoin(n){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}socketsLeave(n){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}disconnectSockets(n=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},n)}}xM.BroadcastOperator=No;class $v{constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new No(n,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(n){return this.operator.timeout(n)}emit(n,...i){return this.operator.emit(n,...i)}join(n){return this.operator.socketsJoin(n)}leave(n){return this.operator.socketsLeave(n)}disconnect(n=!1){return this.operator.disconnectSockets(n),this}}xM.RemoteSocket=$v});var wv=h((Hp)=>{var vM=Hp&&Hp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.Socket=void 0;var oo=ya(),uX=vM(xi()),_X=Qm(),lM=vM(Nf()),bX=Tv(),jX=vv(),Wi=uX.default("socket.io:socket"),yX=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function fM(){}class $M extends _X.StrictEventEmitter{constructor(n,i,o,c){super();if(this.nsp=n,this.client=i,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=n.server,this.adapter=this.nsp.adapter,c)this.id=c.sid,this.pid=c.pid,c.rooms.forEach((p)=>this.join(p)),this.data=c.data,c.missedPackets.forEach((p)=>{this.packet({type:oo.PacketType.EVENT,data:p})}),this.recovered=!0;else{if(i.conn.protocol===3)this.id=n.name!=="/"?n.name+"#"+i.id:i.id;else this.id=lM.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=lM.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",fM)}buildHandshake(n){var i,o,c,p;return{headers:((i=this.request)===null||i===void 0?void 0:i.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!((o=this.request)===null||o===void 0?void 0:o.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(c=this.request)===null||c===void 0?void 0:c.url,query:((p=this.request)===null||p===void 0?void 0:p._query)||{},auth:n}}emit(n,...i){if(jX.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:oo.PacketType.EVENT,data:o};if(typeof o[o.length-1]==="function"){let a=this.nsp._ids++;Wi("emitting packet with ack id %d",a),this.registerAckCallback(a,o.pop()),c.id=a}let p=Object.assign({},this.flags);if(this.flags={},this.nsp.server.opts.connectionStateRecovery)this.adapter.broadcast(c,{rooms:new Set([this.id]),except:new Set,flags:p});else this.notifyOutgoingListeners(c),this.packet(c,p);return!0}emitWithAck(n,...i){let o=this.flags.timeout!==void 0;return new Promise((c,p)=>{i.push((a,x)=>{if(o)return a?p(a):c(x);else return c(a)}),this.emit(n,...i)})}registerAckCallback(n,i){let o=this.flags.timeout;if(o===void 0){this.acks.set(n,i);return}let c=setTimeout(()=>{Wi("event with ack id %d has timed out after %d ms",n,o),this.acks.delete(n),i.call(this,new Error("operation has timed out"))},o);this.acks.set(n,(...p)=>{clearTimeout(c),i.apply(this,[null,...p])})}to(n){return this.newBroadcastOperator().to(n)}in(n){return this.newBroadcastOperator().in(n)}except(n){return this.newBroadcastOperator().except(n)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}packet(n,i={}){n.nsp=this.nsp.name,i.compress=i.compress!==!1,this.client._packet(n,i)}join(n){return Wi("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Wi("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Wi("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3)this.packet({type:oo.PacketType.CONNECT});else this.packet({type:oo.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(n){switch(Wi("got packet %j",n),n.type){case oo.PacketType.EVENT:this.onevent(n);break;case oo.PacketType.BINARY_EVENT:this.onevent(n);break;case oo.PacketType.ACK:this.onack(n);break;case oo.PacketType.BINARY_ACK:this.onack(n);break;case oo.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(n){let i=n.data||[];if(Wi("emitting event %j",i),n.id!=null)Wi("attaching ack callback to event"),i.push(this.ack(n.id));if(this._anyListeners&&this._anyListeners.length){let o=this._anyListeners.slice();for(let c of o)c.apply(this,i)}this.dispatch(i)}ack(n){let i=this,o=!1;return function(){if(o)return;let c=Array.prototype.slice.call(arguments);Wi("sending ack %j",c),i.packet({id:n,type:oo.PacketType.ACK,data:c}),o=!0}}onack(n){let i=this.acks.get(n.id);if(typeof i=="function")Wi("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Wi("bad ack %s",n.id)}ondisconnect(){Wi("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Wi("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&yX.has(n))Wi("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data});this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",n,i);return}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=fM}_error(n){this.packet({type:oo.PacketType.CONNECT_ERROR,data:n})}disconnect(n=!1){if(!this.connected)return this;if(n)this.client._disconnect();else this.packet({type:oo.PacketType.DISCONNECT}),this._onclose("server namespace disconnect");return this}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(n){return this.flags.timeout=n,this}dispatch(n){Wi("dispatching an event %j",n),this.run(n,(i)=>{process.nextTick(()=>{if(i)return this._onerror(i);if(this.connected)super.emitUntyped.apply(this,n);else Wi("ignore packet received after disconnection")})})}use(n){return this.fns.push(n),this}run(n,i){if(!this.fns.length)return i();let o=this.fns.slice(0);function c(p){o[p](n,(a)=>{if(a)return i(a);if(!o[p+1])return i();c(p+1)})}c(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){let i=this._anyListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){let i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let o of i)o.apply(this,n.data)}}newBroadcastOperator(){let n=Object.assign({},this.flags);return this.flags={},new bX.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Hp.Socket=$M});var Jv=h((Do)=>{var BX=Do&&Do.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Do,"__esModule",{value:!0});Do.Namespace=Do.RESERVED_EVENTS=void 0;var TM=wv(),LX=Qm(),NX=BX(xi()),hi=Tv(),Ba=NX.default("socket.io:namespace");Do.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class wM extends LX.StrictEventEmitter{constructor(n,i){super();this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=n,this.name=i,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(n){return this._fns.push(n),this}run(n,i){if(!this._fns.length)return i();let o=this._fns.slice(0);function c(p){o[p](n,(a)=>{if(a)return i(a);if(!o[p+1])return i();c(p+1)})}c(0)}to(n){return new hi.BroadcastOperator(this.adapter).to(n)}in(n){return new hi.BroadcastOperator(this.adapter).in(n)}except(n){return new hi.BroadcastOperator(this.adapter).except(n)}async _add(n,i,o){var c;Ba("adding socket to nsp %s",this.name);let p=await this._createSocket(n,i);if(this._preConnectSockets.set(p.id,p),((c=this.server.opts.connectionStateRecovery)===null||c===void 0?void 0:c.skipMiddlewares)&&p.recovered&&n.conn.readyState==="open")return this._doConnect(p,o);this.run(p,(a)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Ba("next called after client was closed - ignoring socket"),p._cleanup();return}if(a)if(Ba("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(a.data||a.message);else return p._error({message:a.message,data:a.data});this._doConnect(p,o)})})}async _createSocket(n,i){let{pid:o,offset:c}=i;if(this.server.opts.connectionStateRecovery&&typeof o==="string"&&typeof c==="string"){let p;try{p=await this.adapter.restoreSession(o,c)}catch(a){Ba("error while restoring session: %s",a)}if(p)return Ba("connection state recovered for sid %s",p.sid),new TM.Socket(this,n,i,p)}return new TM.Socket(this,n,i)}_doConnect(n,i){if(this._preConnectSockets.delete(n.id),this.sockets.set(n.id,n),n._onconnect(),i)i(n);this.emitReserved("connect",n),this.emitReserved("connection",n)}_remove(n){this.sockets.delete(n.id)||this._preConnectSockets.delete(n.id)}emit(n,...i){return new hi.BroadcastOperator(this.adapter).emit(n,...i)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}serverSideEmit(n,...i){if(Do.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);return i.unshift(n),this.adapter.serverSideEmit(i),!0}serverSideEmitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,a)=>{if(p)return p.responses=a,c(p);else return o(a)}),this.serverSideEmit(n,...i)})}_onServerSideEmit(n){super.emitUntyped.apply(this,n)}allSockets(){return new hi.BroadcastOperator(this.adapter).allSockets()}compress(n){return new hi.BroadcastOperator(this.adapter).compress(n)}get volatile(){return new hi.BroadcastOperator(this.adapter).volatile}get local(){return new hi.BroadcastOperator(this.adapter).local}timeout(n){return new hi.BroadcastOperator(this.adapter).timeout(n)}fetchSockets(){return new hi.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(n){return new hi.BroadcastOperator(this.adapter).socketsJoin(n)}socketsLeave(n){return new hi.BroadcastOperator(this.adapter).socketsLeave(n)}disconnectSockets(n=!1){return new hi.BroadcastOperator(this.adapter).disconnectSockets(n)}}Do.Namespace=wM});var WM=h((MM)=>{Object.defineProperty(MM,"__esModule",{value:!0});MM.yeast=MM.decode=MM.encode=void 0;var AM="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Hm=64,FM={},JM=0,$c=0,SM;function Sv(n){let i="";do i=AM[n%Hm]+i,n=Math.floor(n/Hm);while(n>0);return i}MM.encode=Sv;function DX(n){let i=0;for($c=0;$c<n.length;$c++)i=i*Hm+FM[n.charAt($c)];return i}MM.decode=DX;function CX(){let n=Sv(+new Date);if(n!==SM)return JM=0,SM=n;return n+"."+Sv(JM++)}MM.yeast=CX;for(;$c<Hm;$c++)FM[AM[$c]]=$c});var Mv=h((XM)=>{var Av;Object.defineProperty(XM,"__esModule",{value:!0});XM.SessionAwareAdapter=XM.Adapter=void 0;var kX=import.meta.require("events"),sX=WM(),Em=import.meta.require("ws"),ZX=typeof((Av=Em===null||Em===void 0?void 0:Em.Sender)===null||Av===void 0?void 0:Av.frame)==="function";class Fv extends kX.EventEmitter{constructor(n){super();this.nsp=n,this.rooms=new Map,this.sids=new Map,this.encoder=n.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(n,i){if(!this.sids.has(n))this.sids.set(n,new Set);for(let o of i){if(this.sids.get(n).add(o),!this.rooms.has(o))this.rooms.set(o,new Set),this.emit("create-room",o);if(!this.rooms.get(o).has(n))this.rooms.get(o).add(n),this.emit("join-room",o,n)}}del(n,i){if(this.sids.has(n))this.sids.get(n).delete(i);this._del(i,n)}_del(n,i){let o=this.rooms.get(n);if(o!=null){if(o.delete(i))this.emit("leave-room",n,i);if(o.size===0&&this.rooms.delete(n))this.emit("delete-room",n)}}delAll(n){if(!this.sids.has(n))return;for(let i of this.sids.get(n))this._del(i,n);this.sids.delete(n)}broadcast(n,i){let o=i.flags||{},c={preEncoded:!0,volatile:o.volatile,compress:o.compress};n.nsp=this.nsp.name;let p=this._encode(n,c);this.apply(i,(a)=>{if(typeof a.notifyOutgoingListeners==="function")a.notifyOutgoingListeners(n);a.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},a={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let x=this._encode(n,a),m=0;this.apply(i,(l)=>{if(m++,l.acks.set(n.id,c),typeof l.notifyOutgoingListeners==="function")l.notifyOutgoingListeners(n);l.client.writeToEngine(x,a)}),o(m)}_encode(n,i){let o=this.encoder.encode(n);if(ZX&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=Em.Sender.frame(c,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return o}sockets(n){let i=new Set;return this.apply({rooms:n},(o)=>{i.add(o.id)}),Promise.resolve(i)}socketRooms(n){return this.sids.get(n)}fetchSockets(n){let i=[];return this.apply(n,(o)=>{i.push(o)}),Promise.resolve(i)}addSockets(n,i){this.apply(n,(o)=>{o.join(i)})}delSockets(n,i){this.apply(n,(o)=>{i.forEach((c)=>o.leave(c))})}disconnectSockets(n,i){this.apply(n,(o)=>{o.disconnect(i)})}apply(n,i){let o=n.rooms,c=this.computeExceptSids(n.except);if(o.size){let p=new Set;for(let a of o){if(!this.rooms.has(a))continue;for(let x of this.rooms.get(a)){if(p.has(x)||c.has(x))continue;let m=this.nsp.sockets.get(x);if(m)i(m),p.add(x)}}}else for(let[p]of this.sids){if(c.has(p))continue;let a=this.nsp.sockets.get(p);if(a)i(a)}}computeExceptSids(n){let i=new Set;if(n&&n.size>0){for(let o of n)if(this.rooms.has(o))this.rooms.get(o).forEach((c)=>i.add(c))}return i}serverSideEmit(n){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(n){}restoreSession(n,i){return null}}XM.Adapter=Fv;class KM extends Fv{constructor(n){super(n);this.nsp=n,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=n.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let o=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((c,p)=>{if(c.disconnectedAt<o)this.sessions.delete(p)});for(let c=this.packets.length-1;c>=0;c--)if(this.packets[c].emittedAt<o){this.packets.splice(0,c+1);break}},60000).unref()}persistSession(n){n.disconnectedAt=Date.now(),this.sessions.set(n.pid,n)}restoreSession(n,i){let o=this.sessions.get(n);if(!o)return null;if(o.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(n),null;let p=this.packets.findIndex((x)=>x.id===i);if(p===-1)return null;let a=[];for(let x=p+1;x<this.packets.length;x++){let m=this.packets[x];if(tX(o.rooms,m.opts))a.push(m.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:a}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,a=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&a){let x=sX.yeast();n.data.push(x),this.packets.push({id:x,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}XM.SessionAwareAdapter=KM;function tX(n,i){let o=i.rooms.size===0||n.some((p)=>i.rooms.has(p)),c=n.every((p)=>!i.except.has(p));return o&&c}});var zM=h((Fo)=>{var PX=Fo&&Fo.__rest||function(n,i){var o={};for(var c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0)o[c]=n[c];if(n!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var p=0,c=Object.getOwnPropertySymbols(n);p<c.length;p++)if(i.indexOf(c[p])<0&&Object.prototype.propertyIsEnumerable.call(n,c[p]))o[c[p]]=n[c[p]]}return o};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ClusterAdapterWithHeartbeat=Fo.ClusterAdapter=Fo.MessageType=void 0;var rX=Mv(),gX=xi(),dX=import.meta.require("crypto"),Pn=gX.debug("socket.io-adapter"),eX="emitter",Om=5000;function Op(){return dX.randomBytes(8).toString("hex")}var an;(function(n){n[n.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",n[n.HEARTBEAT=2]="HEARTBEAT",n[n.BROADCAST=3]="BROADCAST",n[n.SOCKETS_JOIN=4]="SOCKETS_JOIN",n[n.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",n[n.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",n[n.FETCH_SOCKETS=7]="FETCH_SOCKETS",n[n.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",n[n.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",n[n.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",n[n.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",n[n.BROADCAST_ACK=12]="BROADCAST_ACK",n[n.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(an=Fo.MessageType||(Fo.MessageType={}));function bc(n){return{rooms:[...n.rooms],except:[...n.except],flags:n.flags}}function Ep(n){return{rooms:new Set(n.rooms),except:new Set(n.except),flags:n.flags}}class Rv extends rX.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Op()}onMessage(n,i){if(n.uid===this.uid)return Pn("[%s] ignore message from self",this.uid);switch(Pn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case an.BROADCAST:{if(n.data.requestId!==void 0)super.broadcastWithAck(n.data.packet,Ep(n.data.opts),(c)=>{Pn("[%s] waiting for %d client acknowledgements",this.uid,c),this.publishResponse(n.uid,{type:an.BROADCAST_CLIENT_COUNT,data:{requestId:n.data.requestId,clientCount:c}})},(c)=>{Pn("[%s] received acknowledgement with value %j",this.uid,c),this.publishResponse(n.uid,{type:an.BROADCAST_ACK,data:{requestId:n.data.requestId,packet:c}})});else{let c=n.data.packet,p=Ep(n.data.opts);this.addOffsetIfNecessary(c,p,i),super.broadcast(c,p)}break}case an.SOCKETS_JOIN:super.addSockets(Ep(n.data.opts),n.data.rooms);break;case an.SOCKETS_LEAVE:super.delSockets(Ep(n.data.opts),n.data.rooms);break;case an.DISCONNECT_SOCKETS:super.disconnectSockets(Ep(n.data.opts),n.data.close);break;case an.FETCH_SOCKETS:{Pn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(Ep(n.data.opts)).then((o)=>{this.publishResponse(n.uid,{type:an.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:a}=p,x=PX(p,["sessionStore"]);return{id:c.id,handshake:x,rooms:[...c.rooms],data:c.data}})}})});break}case an.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,a=(x)=>{if(p)return;p=!0,Pn("[%s] calling acknowledgement with %j",this.uid,x),this.publishResponse(n.uid,{type:an.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:x}})};this.nsp._onServerSideEmit([...o,a]);break}case an.BROADCAST_CLIENT_COUNT:case an.BROADCAST_ACK:case an.FETCH_SOCKETS_RESPONSE:case an.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(n);break;default:Pn("[%s] unknown message type: %s",this.uid,n.type)}}onResponse(n){var i,o;let c=n.data.requestId;switch(Pn("[%s] received response %s to request %s",this.uid,n.type,c),n.type){case an.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case an.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case an.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((a)=>p.responses.push(a)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case an.SERVER_SIDE_EMIT_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,p.responses.push(n.data.packet),p.current===p.expected)clearTimeout(p.timeout),p.resolve(null,p.responses),this.requests.delete(c);break}default:Pn("[%s] unknown response type: %s",this.uid,n.type)}}async broadcast(n,i){var o;if(!((o=i.flags)===null||o===void 0?void 0:o.local))try{let p=await this.publishAndReturnOffset({type:an.BROADCAST,data:{packet:n,opts:bc(i)}});this.addOffsetIfNecessary(n,i,p)}catch(p){return Pn("[%s] error while broadcasting message: %s",this.uid,p.message)}super.broadcast(n,i)}addOffsetIfNecessary(n,i,o){var c;if(!this.nsp.server.opts.connectionStateRecovery)return;let p=n.type===2,a=n.id===void 0,x=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&a&&x)n.data.push(o)}broadcastWithAck(n,i,o,c){var p;if(!((p=i===null||i===void 0?void 0:i.flags)===null||p===void 0?void 0:p.local)){let x=Op();this.ackRequests.set(x,{clientCountCallback:o,ack:c}),this.publish({type:an.BROADCAST,data:{packet:n,requestId:x,opts:bc(i)}}),setTimeout(()=>{this.ackRequests.delete(x)},i.flags.timeout)}super.broadcastWithAck(n,i,o,c)}async addSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:an.SOCKETS_JOIN,data:{opts:bc(n),rooms:i}})}catch(p){Pn("[%s] error while publishing message: %s",this.uid,p.message)}super.addSockets(n,i)}async delSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:an.SOCKETS_LEAVE,data:{opts:bc(n),rooms:i}})}catch(p){Pn("[%s] error while publishing message: %s",this.uid,p.message)}super.delSockets(n,i)}async disconnectSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:an.DISCONNECT_SOCKETS,data:{opts:bc(n),close:i}})}catch(p){Pn("[%s] error while publishing message: %s",this.uid,p.message)}super.disconnectSockets(n,i)}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets(n),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let a=Op();return new Promise((x,m)=>{let l=setTimeout(()=>{let v=this.requests.get(a);if(v)m(new Error(`timeout reached: only ${v.current} responses received out of ${v.expected}`)),this.requests.delete(a)},n.flags.timeout||Om),f={type:an.FETCH_SOCKETS,resolve:x,timeout:l,current:0,expected:p,responses:o};this.requests.set(a,f),this.publish({type:an.FETCH_SOCKETS,data:{opts:bc(n),requestId:a}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:an.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=await this.serverCount()-1;if(Pn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),a=setTimeout(()=>{let m=this.requests.get(p);if(m)o(new Error(`timeout reached: only ${m.current} responses received out of ${m.expected}`),m.responses),this.requests.delete(p)},Om),x={type:an.SERVER_SIDE_EMIT,resolve:o,timeout:a,current:0,expected:c,responses:[]};this.requests.set(p,x),this.publish({type:an.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}publish(n){this.publishAndReturnOffset(n).catch((i)=>{Pn("[%s] error while publishing message: %s",this.uid,i)})}publishAndReturnOffset(n){return n.uid=this.uid,n.nsp=this.nsp.name,this.doPublish(n)}publishResponse(n,i){i.uid=this.uid,i.nsp=this.nsp.name,this.doPublishResponse(n,i).catch((o)=>{Pn("[%s] error while publishing response: %s",this.uid,o)})}}Fo.ClusterAdapter=Rv;class YM extends Rv{constructor(n,i){super(n);this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5000,heartbeatTimeout:1e4},i),this.cleanupTimer=setInterval(()=>{let o=Date.now();this.nodesMap.forEach((c,p)=>{if(o-c>this._opts.heartbeatTimeout)Pn("[%s] node %s seems down",this.uid,p),this.removeNode(p)})},1000)}init(){this.publish({type:an.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:an.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:an.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer)clearInterval(this.cleanupTimer)}onMessage(n,i){if(n.uid===this.uid)return Pn("[%s] ignore message from self",this.uid);if(n.uid&&n.uid!==eX)this.nodesMap.set(n.uid,Date.now());switch(Pn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case an.INITIAL_HEARTBEAT:this.publish({type:an.HEARTBEAT});break;case an.HEARTBEAT:break;case an.ADAPTER_CLOSE:this.removeNode(n.uid);break;default:super.onMessage(n,i)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(n){return this.scheduleHeartbeat(),super.publish(n)}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:an.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=this.nodesMap.size;if(Pn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),a=setTimeout(()=>{let m=this.customRequests.get(p);if(m)o(new Error(`timeout reached: missing ${m.missingUids.size} responses`),m.responses),this.customRequests.delete(p)},Om),x={type:an.SERVER_SIDE_EMIT,resolve:o,timeout:a,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,x),this.publish({type:an.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets({rooms:n.rooms,except:n.except,flags:{local:!0}}),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let a=Op();return new Promise((x,m)=>{let l=setTimeout(()=>{let v=this.customRequests.get(a);if(v)m(new Error(`timeout reached: missing ${v.missingUids.size} responses`)),this.customRequests.delete(a)},n.flags.timeout||Om),f={type:an.FETCH_SOCKETS,resolve:x,timeout:l,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(a,f),this.publish({type:an.FETCH_SOCKETS,data:{opts:bc(n),requestId:a}})})}onResponse(n){let i=n.data.requestId;switch(Pn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case an.FETCH_SOCKETS_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(n.data.sockets.forEach((c)=>o.responses.push(c)),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(o.responses),this.customRequests.delete(i);break}case an.SERVER_SIDE_EMIT_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(o.responses.push(n.data.packet),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(null,o.responses),this.customRequests.delete(i);break}default:super.onResponse(n)}}removeNode(n){this.customRequests.forEach((i,o)=>{if(i.missingUids.delete(n),i.missingUids.size===0){if(clearTimeout(i.timeout),i.type===an.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===an.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}Fo.ClusterAdapterWithHeartbeat=YM});var Um=h((jc)=>{Object.defineProperty(jc,"__esModule",{value:!0});jc.MessageType=jc.ClusterAdapterWithHeartbeat=jc.ClusterAdapter=jc.SessionAwareAdapter=jc.Adapter=void 0;var QM=Mv();Object.defineProperty(jc,"Adapter",{enumerable:!0,get:function(){return QM.Adapter}});Object.defineProperty(jc,"SessionAwareAdapter",{enumerable:!0,get:function(){return QM.SessionAwareAdapter}});var Wv=zM();Object.defineProperty(jc,"ClusterAdapter",{enumerable:!0,get:function(){return Wv.ClusterAdapter}});Object.defineProperty(jc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Wv.ClusterAdapterWithHeartbeat}});Object.defineProperty(jc,"MessageType",{enumerable:!0,get:function(){return Wv.MessageType}})});var UM=h((Up)=>{var i5=Up&&Up.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Up,"__esModule",{value:!0});Up.ParentNamespace=void 0;var HM=Jv(),o5=Um(),c5=i5(xi()),EM=c5.default("socket.io:parent-namespace");class Vm extends HM.Namespace{constructor(n){super(n,"/_"+Vm.count++);this.children=new Set}_initAdapter(){this.adapter=new OM(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){EM("creating child namespace %s",n);let i=new HM.Namespace(this.server,n);if(this._fns.forEach((o)=>i.use(o)),this.listeners("connect").forEach((o)=>i.on("connect",o)),this.listeners("connection").forEach((o)=>i.on("connection",o)),this.children.add(i),this.server._opts.cleanupEmptyChildNamespaces){let o=i._remove;i._remove=(c)=>{if(o.call(i,c),i.sockets.size===0)EM("closing child namespace %s",n),i.adapter.close(),this.server._nsps.delete(i.name),this.children.delete(i)}}return this.server._nsps.set(n,i),this.server.sockets.emitReserved("new_namespace",i),i}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}Up.ParentNamespace=Vm;Vm.count=0;class OM extends o5.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var yM=h((Bc)=>{var p5=Bc&&Bc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Bc,"__esModule",{value:!0});Bc.patchAdapter=x5;Bc.restoreAdapter=m5;Bc.serveFile=f5;var yc=Um(),VM=import.meta.require("fs"),a5=p5(xi()),um=a5.default("socket.io:adapter-uws"),Kv="\x1F",{addAll:_M,del:bM,broadcast:jM}=yc.Adapter.prototype;function x5(n){yc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);_M.call(this,i,o);let p=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(!p)return;if(p.conn.transport.name==="websocket"){uM(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let a=this.sids.get(i);if(a)uM(this.nsp.name,p,c,a)})},yc.Adapter.prototype.del=function(i,o){bM.call(this,i,o);let c=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(c&&c.conn.transport.name==="websocket"){let p=c.conn.id,a=c.conn.transport.socket,x=`${this.nsp.name}${Kv}${o}`;um("unsubscribe connection %s from topic %s",p,x),a.unsubscribe(x)}},yc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){jM.call(this,i,o);return}let p=o.flags||{},a={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let x=this.encoder.encode(i),m=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${Kv}${o.rooms.keys().next().value}`;um("fast publish to %s",m),x.forEach((l)=>{let f=typeof l!=="string";n.publish(m,f?l:"4"+l,f)}),this.apply(o,(l)=>{if(l.conn.transport.name!=="websocket")l.client.writeToEngine(x,a)})}}function uM(n,i,o,c){let p=i.conn.id,a=i.conn.transport.socket;if(o)um("subscribe connection %s to topic %s",p,n),a.subscribe(n);c.forEach((x)=>{let m=`${n}${Kv}${x}`;um("subscribe connection %s to topic %s",p,m),a.subscribe(m)})}function m5(){yc.Adapter.prototype.addAll=_M,yc.Adapter.prototype.del=bM,yc.Adapter.prototype.broadcast=jM}var l5=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function f5(n,i){let{size:o}=VM.statSync(i),c=VM.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),a=(m)=>{throw p(),m},x=(m)=>{let l=l5(m);n.cork(()=>{let f=n.getWriteOffset(),[v,$]=n.tryEnd(l,o);if(!$&&!v)c.pause(),n.onWritable((T)=>{let[F,M]=n.tryEnd(l.slice(T-f),o);if(!M&&F)c.resume();return F})})};n.onAborted(p),c.on("data",x).on("error",a).on("end",p)}});var BM=h((gL,v5)=>{v5.exports={name:"socket.io",version:"4.8.1",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":"prettier --check \"lib/**/*.ts\" \"test/**/*.ts\"","format:fix":"prettier --write \"lib/**/*.ts\" \"test/**/*.ts\"",prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.3.2","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var ZM=h((Ki,La)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",$5=Ki&&Ki.__createBinding||(Object.create?function(n,i,o,c){if(c===void 0)c=o;var p=Object.getOwnPropertyDescriptor(i,o);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable))p={enumerable:!0,get:function(){return i[o]}};Object.defineProperty(n,c,p)}:function(n,i,o,c){if(c===void 0)c=o;n[c]=i[o]}),T5=Ki&&Ki.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),w5=Ki&&Ki.__importStar||function(n){if(n&&n.__esModule)return n;var i={};if(n!=null){for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o))$5(i,n,o)}return T5(i,n),i},kM=Ki&&Ki.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.Namespace=Ki.Socket=Ki.Server=void 0;var J5=import.meta.require("http"),S5=import.meta.require("fs"),Xv=import.meta.require("zlib"),A5=fm(),_m=import.meta.require("stream"),LM=import.meta.require("path"),NM=bF(),F5=nM(),DM=import.meta.require("events"),Yv=Jv();Object.defineProperty(Ki,"Namespace",{enumerable:!0,get:function(){return Yv.Namespace}});var M5=UM(),CM=Um(),R5=w5(ya()),W5=kM(xi()),sM=wv();Object.defineProperty(Ki,"Socket",{enumerable:!0,get:function(){return sM.Socket}});var K5=Qm(),Gv=yM(),X5=kM(cv()),_i=W5.default("socket.io:server"),hM=BM().version,IM=/\.map/;class Vp extends K5.StrictEventEmitter{constructor(n,i={}){super();if(this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof n==="object"&&n instanceof Object&&!n.listen)i=n,n=void 0;if(this.path(i.path||"/socket.io"),this.connectTimeout(i.connectTimeout||45000),this.serveClient(i.serveClient!==!1),this._parser=i.parser||R5,this.encoder=new this._parser.Encoder,this.opts=i,i.connectionStateRecovery)i.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120000,skipMiddlewares:!0},i.connectionStateRecovery),this.adapter(i.adapter||CM.SessionAwareAdapter);else this.adapter(i.adapter||CM.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=X5.default(this.opts.cors)}get _opts(){return this.opts}serveClient(n){if(!arguments.length)return this._serveClient;return this._serveClient=n,this}_checkNamespace(n,i,o){if(this.parentNsps.size===0)return o(!1);let c=this.parentNsps.keys(),p=()=>{let a=c.next();if(a.done)return o(!1);a.value(n,i,(x,m)=>{if(x||!m)return p();if(this._nsps.has(n))return _i("dynamic namespace %s already exists",n),o(this._nsps.get(n));let l=this.parentNsps.get(a.value).createChild(n);_i("dynamic namespace %s was created",n),o(l)})};p()}path(n){if(!arguments.length)return this._path;this._path=n.replace(/\/$/,"");let i=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+i+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(n){if(n===void 0)return this._connectTimeout;return this._connectTimeout=n,this}adapter(n){if(!arguments.length)return this._adapter;this._adapter=n;for(let i of this._nsps.values())i._initAdapter();return this}listen(n,i={}){return this.attach(n,i)}attach(n,i={}){if(typeof n=="function")throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.");if(Number(n)==n)n=Number(n);if(typeof n=="number"){_i("creating http server and binding to %d",n);let o=n;n=J5.createServer((c,p)=>{p.writeHead(404),p.end()}),n.listen(o)}return Object.assign(i,this.opts),i.path=i.path||this._path,this.initEngine(n,i),this}attachApp(n,i={}){Object.assign(i,this.opts),i.path=i.path||this._path,_i("creating uWebSockets.js-based engine with opts %j",i);let o=new NM.uServer(i);if(o.attach(n,i),this.bind(o),this._serveClient)n.get(`${this._path}/*`,(c,p)=>{if(!this.clientPathRegex.test(p.getUrl())){p.setYield(!0);return}let a=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),x=IM.test(a),m=x?"map":"source",l='"'+hM+'"',f="W/"+l,v=p.getHeader("if-none-match");if(v){if(l===v||f===v){_i("serve client %s 304",m),c.writeStatus("304 Not Modified"),c.end();return}}_i("serve client %s",m),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(x?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",l);let $=LM.join(__dirname,"../client-dist/",a);Gv.serveFile(c,$)});Gv.patchAdapter(n)}initEngine(n,i){if(_i("creating engine.io instance with opts %j",i),this.eio=NM.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){_i("attaching client serving req handler");let i=n.listeners("request").slice(0);n.removeAllListeners("request"),n.on("request",(o,c)=>{if(this.clientPathRegex.test(o.url))if(this._corsMiddleware)this._corsMiddleware(o,c,()=>{this.serve(o,c)});else this.serve(o,c);else for(let p=0;p<i.length;p++)i[p].call(n,o,c)})}serve(n,i){let o=n.url.replace(this._path,"").replace(/\?.*$/,""),c=IM.test(o),p=c?"map":"source",a='"'+hM+'"',x="W/"+a,m=n.headers["if-none-match"];if(m){if(a===m||x===m){_i("serve client %s 304",p),i.writeHead(304),i.end();return}}_i("serve client %s",p),i.setHeader("Cache-Control","public, max-age=0"),i.setHeader("Content-Type","application/"+(c?"json":"javascript")+"; charset=utf-8"),i.setHeader("ETag",a),Vp.sendFile(o,n,i)}static sendFile(n,i,o){let c=S5.createReadStream(LM.join(__dirname,"../client-dist/",n)),p=A5(i).encodings(["br","gzip","deflate"]),a=(x)=>{if(x)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),_m.pipeline(c,Xv.createBrotliCompress(),o,a);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),_m.pipeline(c,Xv.createGzip(),o,a);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),_m.pipeline(c,Xv.createDeflate(),o,a);break;default:o.writeHead(200),_m.pipeline(c,o,a)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){_i("incoming connection with id %s",n.id);let i=new F5.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new M5.ParentNamespace(this);if(_i("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,a,x)=>x(null,n.test(p)),c),this.parentNamespacesFromRegExp.set(n,c);if(i)c.on("connect",i);return c}if(String(n)[0]!=="/")n="/"+n;let o=this._nsps.get(n);if(!o){for(let[c,p]of this.parentNamespacesFromRegExp)if(c.test(n))return _i("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(_i("initializing namespace %s",n),o=new Yv.Namespace(this,n),this._nsps.set(n,o),n!=="/")this.sockets.emitReserved("new_namespace",o)}if(i)o.on("connect",i);return o}async close(n){if(await Promise.allSettled([...this._nsps.values()].map(async(i)=>{i.sockets.forEach((o)=>{o._onclose("server shutting down")}),await i.adapter.close()})),this.engine.close(),Gv.restoreAdapter(),this.httpServer)this.httpServer.close(n);else n&&n()}use(n){return this.sockets.use(n),this}to(n){return this.sockets.to(n)}in(n){return this.sockets.in(n)}except(n){return this.sockets.except(n)}send(...n){return this.sockets.emit("message",...n),this}write(...n){return this.sockets.emit("message",...n),this}serverSideEmit(n,...i){return this.sockets.serverSideEmit(n,...i)}serverSideEmitWithAck(n,...i){return this.sockets.serverSideEmitWithAck(n,...i)}allSockets(){return this.sockets.allSockets()}compress(n){return this.sockets.compress(n)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(n){return this.sockets.timeout(n)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(n){return this.sockets.socketsJoin(n)}socketsLeave(n){return this.sockets.socketsLeave(n)}disconnectSockets(n=!1){return this.sockets.disconnectSockets(n)}}Ki.Server=Vp;var G5=Object.keys(DM.EventEmitter.prototype).filter(function(n){return typeof DM.EventEmitter.prototype[n]==="function"});G5.forEach(function(n){Vp.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});La.exports=(n,i)=>new Vp(n,i);La.exports.Server=Vp;La.exports.Namespace=Yv.Namespace;La.exports.Socket=sM.Socket});import{createHash as dR}from"crypto";import{createServer as _G}from"http";import{createServer as bG}from"https";function gc(n=Math.random){return n().toString(36).slice(2)}class ca extends Promise{fate;resolve;reject;done=!1;constructor(n){let i,o;super((c,p)=>{i=c,o=p});this.resolve=i,this.reject=o,this.use(n instanceof Promise?n:new Promise(n))}pass(n,i){if(n===this.fate)this.resolve(i),this.done=!0}fail(n,i){if(n===this.fate)this.reject(i),this.done=!0}use(n){if(n instanceof Promise){let i=n;this.fate=i,i.then((o)=>{this.pass(i,o)},(o)=>{this.fail(i,o)})}else this.resolve(n),this.fate=void 0}}function H$(n){return Object.entries(n)}var E$=(n,i,o=nn.STORE)=>{return pa(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function U(n){while(n.child!==null)n=n.child;return n}function O$(n){while(n.parent!==null)n=n.parent;return n}class xn{Subscriber;subscribers=new Map;subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){let i=this.subscribers.values();for(let o of i)o(n)}}class vl extends xn{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function so(n,i,o){let c={key:i.key,type:"atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","atom_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new xn,m=Object.assign((l)=>{let f=r(l),v={key:i.key,subKey:f},$=`${i.key}(${f})`,T=U(n),F=i.default,M={key:$,default:F instanceof Function?F(l):F};if(i.effects)M.effects=i.effects(l);let A=Zo(T,M,v);return a.next({type:"state_creation",token:A}),A},c,{subject:a,install:(l)=>so(l,i),internalRoles:o});return n.families.set(i.key,m),n.defaults.set(i.key,i.default),c}function U$(n,i){if("mutable"in i)return aa(n,i);return so(n,i)}function to(n,i,o){let c={key:i.key,type:"readonly_selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","readonly_selector_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new xn,m=Object.assign((l)=>{let f=r(l),v={key:i.key,subKey:f},$=`${i.key}(${f})`,T=U(n),F=xa(T,{key:$,get:i.get(l)},v);return a.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:a,install:(l)=>to(l,i),default:(l)=>{return i.get(l)({get:(...v)=>Fn(n,...v),find:(v,$)=>Jn(n,v,$),seek:(v,$)=>Bn(n,v,$),json:(v)=>Zn(n,v)})}});return n.families.set(i.key,m),c}function $l(n,i){if("set"in i)return ma(n,i);return to(n,i)}var e4={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function dc(n,i){let o=r(i),c=`${n.key}(${o})`,p=e4[n.type],a={key:c,type:p};if(p==="molecule")Object.assign(a,{key:i,family:n});else Object.assign(a,{family:{key:n.key,subKey:o}});return Object.assign(a,{counterfeit:!0}),a}function si(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class yi{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(n,i)=>`${n}:${i}`;warn;getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let o=this.relations.get(n),c=this.relations.get(i);if(o)o.add(i);else o=new Set([i]),this.relations.set(n,o);if(c)c.add(n);else c=new Set([n]),this.relations.set(i,c)}deleteRelation(n,i){let o=this.relations.get(n);if(o){if(o.delete(i),o.size===0)this.relations.delete(n);let c=this.relations.get(i);if(c){if(c.delete(n),c.size===0)this.relations.delete(i)}}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(let o of i){let c=new Set().add(n);this.relations.set(o,c)}}replaceRelationsSafely(n,i){let o=this.relations.get(n),c=this.isAType?.(n)?n:void 0,p=c===void 0?n:void 0;if(o)for(let a of o){c??=a,p??=a;let x=this.relations.get(a);if(x){if(x.size===1)this.relations.delete(a);else x.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let a of i){let x=this.relations.get(a);if(x)x.add(n);else x=new Set().add(n),this.relations.set(a,x)}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}constructor(n,i){if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,!i?.externalStore)this.relations=new Map(n.relations?.map(([o,c])=>[o,new Set(c)])),this.contents=new Map(n.contents);if(this.isAType=i?.isAType??null,this.isBType=i?.isBType??null,this.isContent=i?.isContent??null,i?.makeContentKey)this.makeContentKey=i.makeContentKey;if(i?.externalStore){let o=i.externalStore;if(this.has=(c,p)=>o.has(c,p),this.addRelation=(c,p)=>{o.addRelation(c,p)},this.deleteRelation=(c,p)=>{o.deleteRelation(c,p)},this.replaceRelationsSafely=(c,p)=>{o.replaceRelationsSafely(c,p)},this.replaceRelationsUnsafely=(c,p)=>{o.replaceRelationsUnsafely(c,p)},this.getRelatedKeys=(c)=>o.getRelatedKeys(c),o.getContent)this.getContentInternal=(c)=>{return o.getContent(c)},this.setContent=(c,p)=>{o.setContent(c,p)},this.deleteContent=(c)=>{o.deleteContent(c)};for(let[c,p]of n.relations??[]){let a=this.isAType?.(c)?c:void 0,x=a===void 0?c:void 0;for(let m of p)a??=m,x??=m,this.addRelation(a,x)}for(let[c,p]of n.contents??[])this.setContent(c,p)}if(i?.warn)this.warn=i.warn}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(n,...i){let o=typeof i[0]==="string"?i[0]:n[this.b],c=i[1]??typeof i[0]==="string"?void 0:i[0];switch(n=typeof n==="string"?n:n[this.a],this.cardinality){case"1:1":{let p=this.getRelatedKey(n);if(p&&p!==o)this.delete(n,p)}case"1:n":{let p=this.getRelatedKey(o);if(p&&p!==n)this.delete(p,o)}}if(c){let p=this.makeContentKey(n,o);this.setContent(p,c)}return this.addRelation(n,o),this}delete(n,i){i=typeof i==="string"?i:n[this.b];let o=typeof n==="string"?n:n[this.a];if(o===void 0&&typeof i==="string"){let c=this.getRelatedKeys(i);if(c)for(let p of c)this.delete(p,i)}if(typeof o==="string"&&i===void 0){let c=this.getRelatedKeys(o);if(c)for(let p of c)this.delete(o,p)}if(typeof o==="string"&&typeof i==="string"){this.deleteRelation(o,i);let c=this.makeContentKey(o,i);this.deleteContent(c)}return this}getRelatedKey(n){let i=this.getRelatedKeys(n);if(i){if(i.size>1)this.warn?.(`${i.size} related keys were found for key "${n}": (${[...i].map((c)=>`"${c}"`).join(", ")}). Only one related key was expected.`);let o;for(let c of i){o=c;break}return o}}replaceRelations(n,i,o){let c=!Array.isArray(i),p=c?Object.keys(i):i;if(o?.reckless)this.replaceRelationsUnsafely(n,p);else this.replaceRelationsSafely(n,p);if(c)for(let a of p){let x=this.makeContentKey(n,a),m=i[a];this.setContent(x,m)}return this}getContent(n,i){let o=this.makeContentKey(n,i);return this.getContentInternal(o)}getRelationEntries(n){let i=n[this.a],o=n[this.b];if(i!==void 0&&o===void 0){let c=this.getRelatedKeys(i);if(c)return[...c].map((p)=>{return[p,this.getContent(i,p)]})}if(i===void 0&&o!==void 0){let c=this.getRelatedKeys(o);if(c)return[...c].map((p)=>{return[p,this.getContent(p,o)]})}return[]}has(n,i){if(i)return this.getRelatedKeys(n)?.has(i)??!1;return this.relations.has(n)}}function tn(n){return"epoch"in n.transactionMeta}function An(n){return"phase"in n.transactionMeta}var V$=(n)=>{let i=U(n);if(!An(i)){n.logger.warn("\uD83D\uDC1E","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.logger.info("\uD83E\uDE82","transaction",i.transactionMeta.update.key,"Aborting transaction"),i.parent.child=null};var n8=(n)=>n[0].toUpperCase()+n.slice(1);function mo(n){return n.type.split("_").map(n8).join(" ")}class Ui extends Error{constructor(...n){let i=n[0],o=n.length===2?n[1]:n[2];if(n.length===2)super(`${mo(i)} ${r(i.key)} not found in store "${o.config.name}".`);else{let c=n[1];super(`${mo(i)} "${i.key}" member ${r(c)} not found in store "${o.config.name}".`)}}}function qo(n,i,o){return(...c)=>{let p=d(n,o);if(p)return p.run(c,i);throw new Ui(n,o)}}var mx=(n)=>(i)=>n instanceof Function?n(i):n;var Po=(n,i)=>{if(i.valueMap.has(n.key))return i.logger.info("\uD83D\uDCD6",n.type,n.key,"reading cached value"),u$(n,i);if(n.type==="selector"||n.type==="readonly_selector")return i.logger.info("\uD83E\uDDEE",n.type,n.key,"computing value"),n.get();let o=n.default instanceof Function?n.default():n.default;return i.logger.info("\uD83D\uDC81","atom",n.key,"could not find cached value; using default",o),n.default instanceof Function?n.default():n.default};var _$=(n,i)=>{if(n.operation.open){let o=performance.now();return n.logger.info("\u2757",i.type,i.key,`deferring setState at T-${o} until setState for "${n.operation.token.key}" is done`),o}n.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:i},n.logger.info("\u2B55",i.type,i.key,`operation start in store "${n.config.name}"${!An(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},b$=(n)=>{if(n.operation.open)n.logger.info("\uD83D\uDD34",n.operation.token.type,n.operation.token.key,`operation done in store "${n.config.name}"`);n.operation={open:!1},n.on.operationClose.next(n.operation)},j$=(n,i)=>{if(!n.operation.open)return n.logger.error("\uD83D\uDC1E","unknown",i,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0;return n.operation.done.has(i)},ec=(n,i)=>{if(!n.operation.open){n.logger.error("\uD83D\uDC1E","unknown",i,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}n.operation.done.add(i)};var y$=(n,i,o)=>{switch(n.type){case"mutable_atom":o.logger.info("\uD83D\uDCE2",n.type,n.key,"is now (",i.newValue,") subscribers:",n.subject.subscribers);break;default:o.logger.info("\uD83D\uDCE2",n.type,n.key,"went (",i.oldValue,"->",i.newValue,") subscribers:",n.subject.subscribers)}n.subject.next(i)};var Tl=(n,i)=>{let o=U(i),c=o.selectorAtoms.getRelatedKeys(n.key);if(o.logger.info("\uD83E\uDDF9",n.type,n.key,c?`evicting ${c.size} states downstream:`:"no downstream states",c??"to evict"),c){if(o.operation.open)o.logger.info("\uD83E\uDDF9",n.type,n.key,`[ ${[...o.operation.done].join(", ")} ] already done`);for(let p of c){if(j$(o,p))continue;B$(p,o),ec(o,p)}}};function i8(n,i){if(N$(i.newValue))return!1;if(n.includes("\uD83D\uDD0D"))return!1;return!0}var L$=(n,i,o)=>{let{key:c}=n,p=U(o);if(!An(p)||p.transactionMeta.phase!=="building"){o.logger.error("\uD83D\uDC1E","atom",c,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!i8(c,i))return;let x={type:"atom_update",key:c,...i};if(n.family)x.family=n.family;p.transactionMeta.update.updates.push(x),o.logger.info("\uD83D\uDCC1","atom",c,"stowed (",i.oldValue,"->",i.newValue,")")};var D$=(n,i,o)=>{let c=Po(n,o),p=c;if(n.type==="mutable_atom"&&An(o)){let{parent:x}=o;p=la(n,x,o)}if(p=mx(i)(p),o.logger.info("\uD83D\uDCDD","atom",n.key,"set to",p),p=Zi(n.key,p,n.subject,o),C$(n.key,o))h$(n.key,o);ec(o,n.key),Tl(n,o);let a={oldValue:c,newValue:p};if(tn(o))y$(n,a,o);else if(o.parent){if(o.on.transactionApplying.state===null)L$(n,a,o);else if(n.key.startsWith("*")){let x=n.key.slice(1),m=o.atoms.get(x),l=o.valueMap.get(x);if(m.type==="mutable_atom"&&An(o)){let{parent:v}=o;l=la(m,v,o)}if(l.do(a.newValue)===null)Tl(m,o)}}};var lx=(n,i,o)=>{switch(n.type){case"atom":case"mutable_atom":D$(n,i,o);break;case"selector":n.set(i);break}};function fx(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function Qn(n,...i){let o,c,p,a;if(i.length===2){if(o=i[0],a=i[1],c=fx(n,o)??null,c)p=o.family?oi(o.family.subKey):null,o=Jn(n,c,p)}else c=i[0],p=i[1],a=i[2],o=Jn(n,c,p);if("counterfeit"in o){let l=n.disposalTraces.buffer.find((f)=>f?.key===o.key);n.logger.error("\u274C",o.type,o.key,`could not be set because it was not found in the store "${n.config.name}".`,l?`This state was previously disposed:\n${l.trace}`:"No previous disposal trace was found.");return}let x=_$(n,o);if(x){let l=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${x}`,()=>{l(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${x}`),Qn(n,o,a)});return}let m=d(o,n);lx(m,a,n),b$(n)}function vx(n,i,o){let{key:c,newValue:p,oldValue:a}=i,x=n==="newValue"?p:a,m={key:c,type:"atom"};if(i.family)Object.assign(m,{family:i.family});Qn(o,m,x)}function I$(n,i){let o=new xn,c={type:"molecule_family",key:i.key,dependsOn:i.dependsOn??"all"},p={...c,subject:o,new:i.new};return n.moleculeFamilies.set(i.key,p),c}function lo(n,i,o){let c=_o(o,i,n.key);n.tokens.set(c.key,c);let p=An(o)&&o.transactionMeta.phase==="building",a=o.moleculeInProgress===n.key;if(!p&&!a)n.subject.next({type:"state_creation",token:c});return c}class ci extends Set{mode="record";subject=new xn;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof ci)this.parent=n,this.cacheUpdateNumber=n.cacheUpdateNumber;if(i)this.cacheLimit=i,this.cache=new Array(i),this.subscribe("auto cache",(o)=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=o})}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(n){let i=new ci(n.members,n.cacheLimit);return i.cache=n.cache,i.cacheIdx=n.cacheIdx,i.cacheUpdateNumber=n.cacheUpdateNumber,i}add(n){let i=super.add(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`add:${r(n)}`);return i}clear(){let n=this.mode==="record"?[...this]:null;if(super.clear(),n)this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(n)}`)}delete(n){let i=super.delete(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`del:${r(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new ci(this);let i=this.child._subscribe("transaction",(o)=>{this.transactionUpdates?.push(o)});try{if(n(this.child)){for(let c of this.transactionUpdates)this.doStep(c);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(o){throw console.error("Failed to apply transaction to SetRTX:",o),o}finally{i(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(n,i){return this.subject.subscribe(n,i)}subscribe(n,i){return this.subject.subscribe(n,(o)=>{i(`${this.cacheUpdateNumber}=${o}`)})}emit(n){this.subject.next(n)}doStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.add(JSON.parse(c));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(c));break;case"tx":for(let p of c.split(";"))this.doStep(p)}}getUpdateNumber(n){let i=n.indexOf("=");return Number(n.substring(0,i))}do(n){let i=n.indexOf("="),o=Number(n.substring(0,i)),c=o-this.cacheUpdateNumber;if(c>0){if(c===1){this.mode="playback";let a=n.substring(i+1);return this.doStep(a),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let a=this.cacheIdx+c;if(this.cache[a]===n)return null;this.mode="playback";let m=!1;while(!m){this.cacheIdx%=this.cacheLimit;let f=this.cache[this.cacheIdx];if(this.cacheIdx--,!f)return"OUT_OF_RANGE";this.undo(f),m=this.cacheIdx===a-1}let l=n.substring(i+1);return this.doStep(l),this.mode="record",this.cacheUpdateNumber=o,null}return"OUT_OF_RANGE"}undoStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.delete(JSON.parse(c));break;case"del":this.add(JSON.parse(c));break;case"clear":{let p=JSON.parse(c);for(let a of p)this.add(a);break}case"tx":{let p=c.split(";");for(let a=p.length-1;a>=0;a--)this.undoStep(p[a])}}}undo(n){let i=n.indexOf("=");if(Number(n.substring(0,i))===this.cacheUpdateNumber){this.mode="playback";let c=n.substring(i+1);return this.undoStep(c),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}function Ln(n){return n[0].toUpperCase()+n.slice(1)}class Sl{options;defaultContent;toolkit;retrieve;molecules=new Map;relations;states;core;transact(n,i){let o=this.toolkit;this.toolkit=n,i(this),this.toolkit=o}store;alternates;[Symbol.dispose](){this.alternates.delete(this.store.config.name)}in(n){let i=n.config.name,o=this.alternates.get(i);if(o)return o;let c=new Sl(this.options,this.defaultContent,n);return this.alternates.set(i,c),c.alternates=this.alternates,c}constructor(n,i,o=nn.STORE){this.store=o,this.options=n,this.defaultContent=i,this.alternates=new Map,this.alternates.set(o.config.name,this),this.store.miscResources.set(`join:${n.key}`,this),this.retrieve=(Y,K)=>{let E=this.toolkit.seek(Y,K);if(E)return E;let y=this.store.molecules.get(r(K));if(y){let V=d(Y,o);return lo(y,V,o)}if(o.config.lifespan==="immortal")throw new Ui(Y,K,o);return _o(o,Y,K)},this.toolkit={get:(...Y)=>Fn(o,...Y),set:(...Y)=>{Qn(o,...Y)},find:this.retrieve,seek:(...Y)=>Bn(o,...Y),json:(Y)=>Zn(o,Y),dispose:(...Y)=>{zi(o,...Y)}};let c=n.between[0],p=n.between[1],a=aa(o,{key:`${n.key}/relatedKeys`,default:()=>new ci,mutable:!0,fromJson:(Y)=>ci.fromJSON(Y),toJson:(Y)=>Y.toJSON()},["join","relations"]);this.core={findRelatedKeysState:a};let x=({get:Y},K)=>Y(this.retrieve(a,K)),m=(Y,K,E)=>{let{set:y}=Y,V=this.retrieve(a,K),X=this.retrieve(a,E);y(V,(Z)=>Z.add(E)),y(X,(Z)=>Z.add(K))},l=(Y,K,E)=>{let{set:y}=Y,V=this.retrieve(a,K),X=this.retrieve(a,E),Z,C;y(V,(on)=>{if(on.delete(E),on.size===0)Z=`"${K}"`;return on}),y(X,(on)=>{if(on.delete(K),on.size===0)C=`"${E}"`;return on})},f=(Y,K,E)=>{let{get:y,set:V}=Y,X=this.retrieve(a,K),Z=y(X);for(let C of Z){if(E.includes(C))continue;let mn=this.retrieve(a,C);V(mn,(ln)=>{return ln.delete(K),ln})}V(X,(C)=>{return C.transaction((on)=>{on.clear();for(let mn of E){let ln=x(Y,mn),Vn=ln.has(K);if(this.relations.cardinality==="1:n"){let ji=[];for(let H of ln){if(H===K)continue;let s=x(Y,H);if(s.delete(mn),s.size===0)ji.push(H)}if(!Vn&&ln.size>0)ln.clear();for(let H of ji){let s=[mn,H].sort(),wn=`"${s[0]}:${s[1]}"`;this.molecules.delete(wn)}}if(!Vn)ln.add(K);on.add(mn)}return!0}),C})},v=(Y,K,E)=>{let{set:y}=Y,V=this.retrieve(a,K);y(V,(X)=>{return X.transaction((Z)=>{for(let C of E)Z.add(C);return!0}),X});for(let X of E){let Z=this.retrieve(a,X);y(Z,(C)=>{return C.add(K),C})}return!0},$=(Y,K,E)=>{let y=x(Y,K);return E?y.has(E):y.size>0},T={getRelatedKeys:(Y)=>x(this.toolkit,Y),addRelation:(Y,K)=>{m(this.toolkit,Y,K)},deleteRelation:(Y,K)=>{l(this.toolkit,Y,K)},replaceRelationsSafely:(Y,K)=>{f(this.toolkit,Y,K)},replaceRelationsUnsafely:(Y,K)=>{v(this.toolkit,Y,K)},has:(Y,K)=>$(this.toolkit,Y,K)},F,M,A;if(i){M=so(o,{key:`${n.key}/content`,default:i},["join","content"]),A=I$(o,{key:`${n.key}/content-molecules`,new:class V{Z;constructor(X,Z){this.key=Z}}});let Y=({get:V},X)=>V(this.retrieve(M,X)),K=({set:V},X,Z)=>{V(this.retrieve(M,X),Z)},E=(V,X)=>{let Z=o.molecules.get(`"${X}"`);if(Z)this.toolkit.dispose(Z),this.molecules.delete(`"${X}"`)};F=Object.assign(T,{getContent:(V)=>{return Y(this.toolkit,V)},setContent:(V,X)=>{K(this.toolkit,V,X)},deleteContent:(V)=>{E(this.toolkit,V)}})}else F=T;let R=new yi(n,{externalStore:F,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...Y)=>{let K=Y.sort(),E=`${K[0]}:${K[1]}`,[y,V]=K.map((X)=>this.molecules.get(r(X)));if(o.config.lifespan==="immortal"&&y&&V){let X=U(o),Z=bo(X,[y,V],A,E);this.molecules.set(`"${E}"`,d(Z,X))}return E}}),G=()=>to(o,{key:`${n.key}/singleRelatedKey`,get:(Y)=>({get:K})=>{let E=this.retrieve(a,Y),y=K(E);for(let V of y)return V;return null}},["join","keys"]),Q=()=>{return to(o,{key:`${n.key}/multipleRelatedKeys`,get:(Y)=>({get:K})=>{let E=Jl(a,o),y=this.retrieve(E,Y);return K(y).members}},["join","keys"])},b=()=>to(o,{key:`${n.key}/singleRelatedEntry`,get:(Y)=>({get:K})=>{let E=this.retrieve(a,Y),y=K(E);for(let V of y){let X=R.isAType?.(Y)?Y:void 0,Z=X===void 0?Y:void 0;X??=V,Z??=V;let C=R.makeContentKey(X,Z),on=this.retrieve(M,C),mn=K(on);return[V,mn]}return null}},["join","entries"]),D=()=>to(o,{key:`${n.key}/multipleRelatedEntries`,get:(Y)=>({get:K})=>{let E=Jl(a,o),y=this.retrieve(E,Y);return K(y).members.map((X)=>{let Z=R.isAType?.(Y)?Y:void 0,C=Z===void 0?Y:void 0;Z??=X,C??=X;let on=R.makeContentKey(Z,C),mn=this.retrieve(M,on),ln=K(mn);return[X,ln]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let Y=G(),K=`${c}KeyOf${Ln(p)}`,E=`${p}KeyOf${Ln(c)}`,y={[K]:Y,[E]:Y},V;if(i){let X=b(),Z=`${c}EntryOf${Ln(p)}`,C=`${p}EntryOf${Ln(c)}`,on={[Z]:X,[C]:X};V=Object.assign(y,on)}else V=y;this.relations=R,this.states=V;break}case"1:n":{let Y=G(),K=Q(),E=`${c}KeyOf${Ln(p)}`,y=`${p}KeysOf${Ln(c)}`,V={[E]:Y,[y]:K},X;if(i){let Z=b(),C=D(),on=`${c}EntryOf${Ln(p)}`,mn=`${p}EntriesOf${Ln(c)}`,ln={[on]:Z,[mn]:C};X=Object.assign(V,ln)}else X=V;this.relations=R,this.states=X;break}default:{let Y=Q(),K=`${c}KeysOf${Ln(p)}`,E=`${p}KeysOf${Ln(c)}`,y={[K]:Y,[E]:Y},V;if(i){let X=D(),Z=`${c}EntriesOf${Ln(p)}`,C=`${p}EntriesOf${Ln(c)}`,on={[Z]:X,[C]:X};V=Object.assign(y,on)}else V=y;this.relations=R,this.states=V}}}}function $x(n,i,o=nn.STORE){return wl(o).set(n.key,new Sl(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function wl(n){if("joins"in n&&n.joins instanceof Map)return n.joins;let i=new Map;return n.joins=i,i}function fa(n,i){let o=wl(i),c=o.get(n.key);if(c===void 0){if(c=wl(nn.STORE).get(n.key)?.in(i),c===void 0)throw new Error(`Join "${n.key}" not found in store "${i.config.name}"`);o.set(n.key,c)}return c}function np(n,i,o){let c=fa(n,o),p;switch(n.cardinality){case"1:1":{let a=`${n.a}KeyOf${Ln(n.b)}`,x=`${n.b}KeyOf${Ln(n.a)}`;p={get[a](){let l=c.states[a];return c.retrieve(l,i)},get[x](){let l=c.states[x];return c.retrieve(l,i)}};let m=`${n.a}EntryOf${Ln(n.b)}`;if(m in c.states){let l=`${n.b}EntryOf${Ln(n.a)}`;Object.assign(p,{get[m](){let f=c.states[m];return c.retrieve(f,i)},get[l](){let f=c.states[l];return c.retrieve(f,i)}})}break}case"1:n":{let a=`${n.a}KeyOf${Ln(n.b)}`,x=`${n.b}KeysOf${Ln(n.a)}`;p={get[a](){let l=c.states[a];return c.retrieve(l,i)},get[x](){let l=c.states[x];return c.retrieve(l,i)}};let m=`${n.a}EntryOf${Ln(n.b)}`;if(m in c.states){let l=`${n.b}EntriesOf${Ln(n.a)}`;Object.assign(p,{get[m](){let f=c.states[m];return c.retrieve(f,i)},get[l](){let f=c.states[l];return c.retrieve(f,i)}})}break}case"n:n":{let a=`${n.a}KeysOf${Ln(n.b)}`,x=`${n.b}KeysOf${Ln(n.a)}`;p={get[a](){let l=c.states[a];return c.retrieve(l,i)},get[x](){let l=c.states[x];return c.retrieve(l,i)}};let m=`${n.a}EntriesOf${Ln(n.b)}`;if(m in c.states){let l=`${n.b}EntriesOf${Ln(n.a)}`;Object.assign(p,{get[m](){let f=c.states[m];return c.retrieve(f,i)},get[l](){let f=c.states[l];return c.retrieve(f,i)}})}}}return p}function k$(n,i){return np(n,i,nn.STORE)}function Mc(n,i,o){let c=fa(n,o),p=U(o);if(An(p)){let{toolkit:a}=p.transactionMeta;c.transact(a,({relations:x})=>{i(x)})}else i(c.relations)}function o8(n,i){return fa(n,i).core.findRelatedKeysState}function s$(n){return o8(n,nn.STORE)}function Tx(n){return{store:n}}function Fn(n,...i){let o,c,p;if(i.length===1){if(o=i[0],o.type!=="molecule"){if(c=fx(n,o)??null,c)p=o.family?oi(o.family.subKey):null,o=Jn(n,c,p)}}else{c=i[0],p=i[1];let a;if(c.type==="molecule_family")a=Bn(n,c,p)??dc(c,p);else a=Jn(n,c,p);o=a}if("counterfeit"in o&&"family"in o){c=o.type==="molecule"?d(o.family,n):n.families.get(o.family.key);let a=o.type==="molecule"?o.key:o.family.subKey,x=n.disposalTraces.buffer.find((m)=>m?.key===o.key);switch(n.logger.error("\u274C",o.type,o.key,`could not be retrieved because it was not found in the store "${n.config.name}".`,x?`This state was previously disposed:\n${x.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":case"mutable_atom_family":return n.defaults.get(c.key);case"selector_family":case"readonly_selector_family":{if(n.defaults.has(c.key))return n.defaults.get(o.family.key);let m=d(c,n).default(a);return n.defaults.set(c.key,m),m}case"molecule_family":throw new Ui(c,a,n)}}switch(o.type){case"atom":case"mutable_atom":case"selector":case"readonly_selector":return Po(d(o,n),n);case"molecule":return d(o,n).instance}}class ip{i;type="molecule";stringKey;family;_dependsOn;get dependsOn(){if(this.family)return this.family.dependsOn;return this._dependsOn}subject=new xn;tokens=new Map;above=new Map;below=new Map;joins=new Map;instance;constructor(n,i,o){this.key=i;if(this.stringKey=r(i),o)this.family=o,this._dependsOn=o.dependsOn;if(n)for(let c of n)this.above.set(c.stringKey,c)}}function Z$(n){return n[0].toUpperCase()+n.slice(1)}function bo(n,i,o,c,...p){let a=O$(n),x=U(n),m=r(c);x.moleculeInProgress=m;let l=Array.isArray(i)?i:[i],f=l.map((R)=>{if(R instanceof ip)return R;let G=r(R.key),Q=n.molecules.get(G);if(!Q)throw new Error(`Molecule ${G} not found in store "${n.config.name}"`);return Q}),v=new ip(f,c,o);x.molecules.set(m,v);for(let R of f)R.below.set(v.stringKey,v);let $={get:(...R)=>Fn(U(a),...R),set:(...R)=>{Qn(U(a),...R)},seek:(R,G)=>Bn(U(a),R,G),json:(R)=>Zn(U(a),R),run:(R,G=gc())=>qo(R,G,U(n)),make:(R,G,Q,...b)=>bo(U(a),R,G,Q,...b),dispose:(R)=>{zi(U(a),R)},env:()=>Tx(U(a)),bond:(R,G)=>{if(R.type==="join"){let{as:Q}=G,b=fa(R,a);b.molecules.set(m,v),v.joins.set(R.key,b);let D=T.subject.subscribe(`join:${R.key}-${m}`,(X)=>{if(X.type==="molecule_disposal"){if(r(X.token.key)===m)D(),b.molecules.delete(m)}});if(Q===null)return;let Y=R.a===Q?R.b:R.a,K=k$(R,c),E=K[`${Y}KeysOf${Z$(Q)}`],y=K[`${Y}EntriesOf${Z$(Q)}`],V={relatedKeys:E};if(y)V=Object.assign(V,{relatedEntries:y});return V}return lo(v,d(R,a),U(a))},claim:(R,G)=>{let{exclusive:Q}=G,b=U(n).molecules.get(r(R.key));if(b)if(Q){for(let D of b.above.values())D.below.delete(b.stringKey);b.above.clear(),b.above.set(v.stringKey,v),v.below.set(b.stringKey,b)}else b.above.set(v.stringKey,v),v.below.set(b.stringKey,b)},spawn:(R,G,...Q)=>bo(U(n),[v],d(R,n),G,...Q)},T=d(o,n),F=T.new;v.instance=new F($,c,...p);let M={type:"molecule",key:c,family:o},A={type:"molecule_creation",subType:"classic",token:M,family:o,context:l,params:p};if(tn(x))T.subject.next(A);else if(An(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push(A);return x.moleculeInProgress=null,M}function Fl(n,i,o){switch(i){case"newValue":{t$(n,o);break}case"oldValue":{zi(o,n.token);break}}}function Ml(n,i,o){switch(i){case"newValue":{zi(o,n.token);break}case"oldValue":{t$(n,o),o.valueMap.set(n.token.key,n.value);break}}}function t$(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)Jn(i,c,oi(o.subKey))}}function Rl(n,i,o){switch(i){case"newValue":switch(n.subType){case"classic":bo(o,n.context,n.family,n.token.key,...n.params);break;case"modern":Al(o,n.provenance,n.key);break}break;case"oldValue":switch(n.subType){case"classic":zi(o,n.token);break;case"modern":va(o,n.key);break}break}}function Wl(n,i,o){switch(i){case"newValue":switch(n.subType){case"classic":zi(o,n.token);break;case"modern":va(o,n.key);break}break;case"oldValue":switch(n.subType){case"classic":{let c=bo(o,n.context,n.family,n.token.key);for(let[p,a]of n.values){let x=`${p}(${r(c.key)})`,m=d(c,o),l=m.tokens.has(x),f=o.families.get(p);if(f&&!l)lo(m,f,o);o.valueMap.set(x,a)}}break;case"modern":{Al(o,n.provenance,n.key);for(let[c,p]of n.values){let a=o.families.get(c);if(a){Jn(o,a,n.key);let x=`${c}(${r(n.key)})`;o.valueMap.set(x,p)}}}}break}}function wx(n,i,o){let c=n==="newValue"?i.updates:[...i.updates].reverse();for(let p of c)switch(p.type){case"atom_update":case"selector_update":vx(n,p,o);break;case"state_creation":Fl(p,n,o);break;case"state_disposal":Ml(p,n,o);break;case"molecule_creation":Rl(p,n,o);break;case"molecule_disposal":Wl(p,n,o);break;case"transaction_update":wx(n,p,o);break}}function q$(n,i,o){if(tn(o)&&n)o.transactionMeta.epoch.set(n,i)}function P$(n,i,o){if(!tn(o))return;let p=o.transactionMeta.actionContinuities.getRelatedKey(n);if(p!==void 0)o.transactionMeta.epoch.set(p,i)}var r$=(n,i)=>{let o=U(i),{parent:c}=o;if(c===null||!An(o)||o.transactionMeta?.phase!=="building"){i.logger.warn("\uD83D\uDC1E","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}o.transactionMeta.phase="applying",o.transactionMeta.update.output=n,c.child=null,c.on.transactionApplying.next(o.transactionMeta);let{updates:p}=o.transactionMeta.update;if(i.logger.info("\uD83D\uDEC4","transaction",o.transactionMeta.update.key,`Applying transaction with ${p.length} updates:`,p),wx("newValue",o.transactionMeta.update,c),tn(c))P$(o.transactionMeta.update.key,o.transactionMeta.update.epoch,c),d({key:o.transactionMeta.update.key,type:"transaction"},i)?.subject.next(o.transactionMeta.update),i.logger.info("\uD83D\uDEEC","transaction",o.transactionMeta.update.key,"Finished applying transaction.");else if(An(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function g$(n,i,o){if(!tn(o))return;let{epoch:p,actionContinuities:a}=o.transactionMeta;if(a.set(n,i),!p.has(n))p.set(n,-1)}class ti extends Map{n;deleted=new Set;constructor(n){super();this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n);return}set(n,i){return this.deleted.delete(n),super.set(n,i)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}var d$=(n,i,o,c)=>{let p=U(o),a={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new ti(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new ti(p.families),operation:{open:!1},readonlySelectors:new ti(p.readonlySelectors),timelines:new ti(p.timelines),timelineTopics:new yi(p.timelineTopics.toJSON()),trackers:new Map,transactions:new ti(p.transactions),selectorAtoms:new yi(p.selectorAtoms.toJSON()),selectorGraph:new yi(p.selectorGraph.toJSON(),{makeContentKey:(...f)=>f.sort().join(":")}),selectors:new ti(p.selectors),valueMap:new ti(p.valueMap),defaults:p.defaults,disposalTraces:o.disposalTraces.copy(),molecules:new ti(p.molecules),moleculeFamilies:new ti(p.moleculeFamilies),moleculeInProgress:p.moleculeInProgress,miscResources:new ti(p.miscResources)},x=e$(n,o),m={phase:"building",update:{type:"transaction_update",key:n,id:c,epoch:x===void 0?Number.NaN:x+1,updates:[],params:i,output:void 0},toolkit:{get:(...f)=>Fn(l,...f),set:(...f)=>{Qn(l,...f)},run:(f,v=gc())=>qo(f,v,l),find:(f,v)=>Jn(l,f,v),seek:(f,v)=>Bn(l,f,v),json:(f)=>Zn(l,f),make:(f,v,$,...T)=>bo(l,f,v,$,...T),dispose:(...f)=>{zi(l,...f)},env:()=>Tx(l)}},l=Object.assign(a,{transactionMeta:m});return p.child=l,o.logger.info("\uD83D\uDEEB","transaction",n,"Building transaction with params:",i),l};function Kl(n,i){let o={key:n.key,type:"transaction",run:(a,x)=>{let m=d$(n.key,a,i,x);try{let l=U(i),{toolkit:f}=m.transactionMeta,v=n.do(f,...a);return r$(v,l),v}catch(l){throw V$(c),i.logger.warn("\uD83D\uDCA5","transaction",n.key,"caught:",l),l}},install:(a)=>Kl(n,a),subject:new xn},c=U(i);c.transactions.set(o.key,o);let p=si(o);return i.on.transactionCreation.next(p),p}function e$(n,i){let o=tn(i),c=o?i.transactionMeta.actionContinuities.getRelatedKey(n):void 0;return o&&c!==void 0?i.transactionMeta.epoch.get(c):void 0}class Jx{_buffer;_index=0;constructor(n){let i;if(typeof n==="number")i=n;else i=n.length;this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){let n=new Jx([...this._buffer]);return n._index=this._index,n}}class n0{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new yi({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new yi({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});trackers=new Map;families=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new yi({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new yi({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new Jx(100);molecules=new Map;moleculeFamilies=new Map;moleculeInProgress=null;miscResources=new Map;on={atomCreation:new xn,atomDisposal:new xn,selectorCreation:new xn,selectorDisposal:new xn,timelineCreation:new xn,transactionCreation:new xn,transactionApplying:new vl(null),operationClose:new xn,moleculeCreationStart:new xn,moleculeCreationDone:new xn,moleculeDisposal:new xn};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Rc("warn",(n,i,o)=>!o.includes("\uD83D\uDD0D"))];logger={error:(...n)=>{for(let i of this.loggers)i.error(...n)},info:(...n)=>{for(let i of this.loggers)i.info(...n)},warn:(...n)=>{for(let i of this.loggers)i.warn(...n)}};constructor(n,i=null){if(this.config={...i?.config,...n},i!==null){if(this.valueMap=new Map(i?.valueMap),this.operation={...i?.operation},tn(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new yi(i?.transactionMeta.actionContinuities.toJSON())};for(let[,c]of i.families){if(c.internalRoles?.includes("mutable")||c.internalRoles?.includes("join"))continue;c.install(this)}let o=new Set;for(let[,c]of i.atoms){if(o.has(c.key))continue;if(c.install(this),c.type==="mutable_atom"){let p=Zn(i,c),a=jo(c);o.add(p.key),o.add(a.key)}}for(let[,c]of i.readonlySelectors)c.install(this);for(let[,c]of i.selectors){if(o.has(c.key))continue;c.install(this)}for(let[,c]of i.transactions)c.install(this);for(let[,c]of i.timelines)c.install(this)}}}var nn={get STORE(){if(!globalThis.ATOM_IO_IMPLICIT_STORE)globalThis.ATOM_IO_IMPLICIT_STORE=new n0({name:"IMPLICIT_STORE",lifespan:"ephemeral"});return globalThis.ATOM_IO_IMPLICIT_STORE}};function d(n,i){let o,c=i;while(c!==null){switch(n.type){case"atom":case"mutable_atom":o=c.atoms.get(n.key);break;case"selector":o=c.selectors.get(n.key);break;case"readonly_selector":o=c.readonlySelectors.get(n.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":o=c.families.get(n.key);break;case"timeline":o=c.timelines.get(n.key);break;case"transaction":o=c.transactions.get(n.key);break;case"molecule":o=c.molecules.get(r(n.key));break;case"molecule_family":o=c.moleculeFamilies.get(n.key);break}if(o)return o;c=c.child}throw new Ui(n,i)}function Sx(n,i){let o;o=d(n,i);let{family:c}=n;for(let x of o.joins.values())x.relations.delete(o.key),x.molecules.delete(o.stringKey);let p=[];for(let x of o.above.values())p.push(si(x));let a=[];for(let x of o.tokens.values()){let m=x.family;a.push([m.key,i.valueMap.get(x.key)])}if(c){let x=d(c,i),m={type:"molecule_disposal",subType:"classic",token:n,family:c,context:p,values:a};if(n.family)m.family=n.family;for(let f of o.tokens.values())zi(i,f);for(let f of o.below.values())if(f.dependsOn==="all")Sx(f,i);else if(f.above.delete(o.stringKey),f.above.size===0)Sx(f,i);if(o.below.clear(),An(i)&&i.transactionMeta.phase==="building")i.transactionMeta.update.updates.push(m);else x.subject.next(m);i.molecules.delete(o.stringKey)}for(let x of o.above.values())x.below.delete(o.stringKey)}function _o(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Ui(i,n);let p=c(o),a=U(n);if(p.family&&a.moleculeInProgress===null){if(tn(a))switch(p.type){case"atom":case"mutable_atom":n.on.atomCreation.next(p);break;case"selector":case"readonly_selector":n.on.selectorCreation.next(p);break}else if(An(a)&&a.on.transactionApplying.state===null)a.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function Bn(n,i,o){let c=r(o),p=`${i.key}(${c})`,a=U(n),x;switch(i.type){case"atom_family":case"mutable_atom_family":x=a.atoms.get(p);break;case"selector_family":x=a.selectors.get(p);break;case"readonly_selector_family":x=a.readonlySelectors.get(p);break;case"molecule_family":x=a.molecules.get(r(o))}if(x)return si(x);return x}function Jn(n,i,o){let c=Bn(n,i,o);if(c)return c;let p=n.molecules.get(r(o));if(p)return lo(p,i,n);if(n.config.lifespan==="immortal"){let a=dc(i,o);return n.logger.error("\u274C",a.type,a.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),a}return c=_o(n,i,o),c}function zi(n,...i){let o,c;if(i.length===1)o=i[0],c=o.key;else{let a=i[0],x=i[1];o=a.type==="molecule_family"?Bn(n,a,x)??dc(a,x):Jn(n,a,x)}try{d(o,n)}catch(a){let x=n.disposalTraces.buffer.find((m)=>m?.key===o.key);n.logger.error("\u274C",o.type,o.key,`could not be disposed because it was not found in the store "${n.config.name}".`,x?`\n This state was most recently disposed\n${x.trace}`:"No previous disposal trace was found.");return}switch(o.type){case"atom":case"mutable_atom":Xl(o,n);break;case"selector":case"readonly_selector":i0(o,n);break;case"molecule":Sx(o,n);break}let{stack:p}=new Error;if(p){let a=p?.split("\n")?.slice(3)?.join("\n");n.disposalTraces.add({key:o.key,trace:a})}}var Ax=(n,i)=>U(i).atoms.has(n),c8=(n,i)=>U(i).selectors.has(n),p8=(n,i)=>U(i).readonlySelectors.has(n),o0=(n,i)=>Ax(n,i)||c8(n,i)||p8(n,i);var Fx=(n,i)=>{return U(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>o0(c,i))};var Gl=(n,i,o)=>{let c=[],p=Fx(n,o);while(p.length>0){let a=p.shift();if(i.has(a))continue;if(i.add(a),!Ax(a,o))p.push(...Fx(a,o));else if(!c.includes(a))c.push(a)}return c},c0=(n,i)=>{let o=n.key,c=Fx(o,i),p=new Set;return c.flatMap((a)=>Ax(a,i)?a:Gl(a,p,i))};var p0=(n,i,o,c)=>{let p=U(c);if(i.type==="atom"||i.type==="mutable_atom")p.selectorAtoms.set({selectorKey:n,atomKey:i.key}),c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atom "${i.key}"`);else{let a=Gl(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${a.map((x)=>`"${x}"`).join(", ")} ]`);for(let x of a)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:x})}o.add(i.key)};var Mx=(n,i,o)=>({get:(...c)=>{let p=U(o),a;if(c.length===2){let[l,f]=c;switch(l.type){case"molecule_family":return Fn(o,l,f);default:if(o.config.lifespan==="ephemeral")a=Jn(o,l,f);else{let v=Bn(o,l,f);if(v)a=v;else throw new Ui(l,f,o)}}}else[a]=c;if(a.type==="molecule")return Fn(o,a);let x=d(a,o),m=Po(x,o);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${a.key}" =`,m,")"),p.selectorGraph.set({upstreamSelectorKey:a.key,downstreamSelectorKey:n},{source:a.key}),p0(n,a,i,o),m},set:(...c)=>{let p,a;if(c.length===2)p=c[0],a=c[1];else{let l=c[0],f=c[1];a=c[2];let v=o.config.lifespan==="ephemeral"?Jn(o,l,f):Bn(o,l,f);if(!v)throw new Ui(l,f,o);p=v}let x=U(o),m=d(p,x);lx(m,a,x)},find:(c,p)=>Jn(o,c,p),seek:(c,p)=>Bn(o,c,p),json:(c)=>Zn(o,c)});var xa=(n,i,o)=>{let c=U(n),p=new xn,a=new Set,{get:x,find:m,seek:l,json:f}=Mx(i.key,a,c),v=()=>{let M=i.get({get:x,find:m,seek:l,json:f});return Zi(i.key,M,p,U(n)),a.clear(),M},$={...i,subject:p,install:(M)=>xa(M,i,o),get:v,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,$);let T=v();n.logger.info("\u2728",$.type,$.key,"=",T);let F={key:i.key,type:"readonly_selector"};if(o)F.family=o;return F};var $a=(n,i,o)=>{let c=U(n),p=new xn,a=new Set,x=Mx(i.key,a,c),{find:m,get:l,seek:f,json:v}=x,$={find:m,get:l,seek:f,json:v},T=(G=i.get,Q=U(n))=>{let b=G($);return Zi(i.key,b,p,Q),a.clear(),b},M={...i,subject:p,install:(G)=>$a(G,i,o),get:T,set:(G)=>{let Q=U(n),b=T(i.get,Q),D=mx(G)(b);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",b,"->",D,")"),Zi(i.key,D,p,Q),ec(Q,i.key),tn(Q))p.next({newValue:D,oldValue:b});i.set(x,D)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,M);let A=T();n.logger.info("\u2728",M.type,M.key,"=",A);let R={key:i.key,type:"selector"};if(o)R.family=o;return R};function pa(n,i){if("set"in i){let p=$a(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=xa(n,i,void 0);return n.on.selectorCreation.next(c),c}function i0(n,i){let o=U(i),{key:c}=n,p=d(n,o);if(!p.family)i.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{let a=o.molecules.get(p.family.subKey);if(a)a.tokens.delete(c);switch(n.type){case"selector":o.selectors.delete(c),d({key:p.family.key,type:"selector_family"},i).subject.next({type:"state_disposal",token:n});break;case"readonly_selector":o.readonlySelectors.delete(c),d({key:p.family.key,type:"readonly_selector_family"},i).subject.next({type:"state_disposal",token:n});break}if(o.valueMap.delete(c),o.selectorAtoms.delete(c),o.selectorGraph.delete(c),i.logger.info("\uD83D\uDD25",n.type,c,"deleted"),An(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.selectorDisposal.next(n)}}function ma(n,i,o){let c={key:i.key,type:"selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","selector_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new xn,m=Object.assign((l)=>{let f=r(l),v={key:i.key,subKey:f},$=`${i.key}(${f})`,T=U(n),F=$a(T,{key:$,get:i.get(l),set:i.set(l)},v);return a.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:a,install:(l)=>ma(l,i),default:(l)=>{return i.get(l)({get:(...v)=>Fn(n,...v),find:(v,$)=>Jn(n,v,$),seek:(v,$)=>Bn(n,v,$),json:(v)=>Zn(n,v)})}});return n.families.set(i.key,m),c}function a0(n,i,o=nn.STORE){let c=ma(o,{key:`${n.key}:JSON`,get:(a)=>({seek:x,get:m})=>{let l=x(n,a);if(l)return i.toJson(m(l));let f=r(a),v=o.molecules.get(f);if(v){let T=lo(v,n,o);return i.toJson(m(T))}if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${f}"`);let $=_o(o,n,a);return i.toJson(m($))},set:(a)=>({seek:x,set:m},l)=>{let f=x(n,a);if(f)m(f,i.fromJson(l));else{let v=r(a),$=o.molecules.get(v);if($){let T=lo($,n,o);m(T,i.fromJson(l))}else{if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${v}"`);m(_o(o,n,a),i.fromJson(l))}}}},["mutable","json"]);return d(n,o).subject.subscribe(`store=${o.config.name}::json-selector-family`,(a)=>{if(a.token.family)Bn(o,c,oi(a.token.family.subKey))}),c}var oi=(n)=>JSON.parse(n),r=(n)=>JSON.stringify(n),GE=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var x0=(n,i)=>{let o=U(i);if(o.operation.open)return o.operation.prev.get(n.key);return o.valueMap.get(n.key)};var Ql=(n,i)=>{let o=U(i);return c0(n,i).map((p)=>{let a=o.atoms.get(p);if(a===void 0)throw new Error(`Atom "${p}", a dependency of selector "${n.key}", not found in store "${i.config.name}".`);return a.subject.subscribe(`${n.type}:${n.key}`,(x)=>{i.logger.info("\uD83D\uDCE2",n.type,n.key,"root",p,"went",x.oldValue,"->",x.newValue);let m=x0(n,o),l=Po(n,o);i.logger.info("\u2728",n.type,n.key,"went",m,"->",l),n.subject.next({newValue:l,oldValue:m})})})};function Si(n,i,o,c){function p($){if(c.operation.open){let T=c.on.operationClose.subscribe(`state subscription ${o}`,()=>{T(),i($)})}else i($)}let a=d(n,c);c.logger.info("\uD83D\uDC40",a.type,a.key,`Adding subscription "${o}"`);let x=a.type==="selector"||a.type==="readonly_selector",m=null,l=p;if(x)m=Ql(a,c),l=($)=>{if(m)m.length=0,m.push(...Ql(a,c));p($)};let f=a.subject.subscribe(o,l);return()=>{if(c.logger.info("\uD83D\uDE48",a.type,a.key,`Removing subscription "${o}"`),f(),m)for(let $ of m)$()}}var Yl=(n,i,o,c)=>{let p=d(n,c);c.logger.info("\uD83D\uDC40","timeline",n.key,`Adding subscription "${o}"`);let a=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","timeline",n.key,`Removing subscription "${o}" from timeline`),a()}};var zl=(n,i,o,c)=>{let p=d(n,c);c.logger.info("\uD83D\uDC40","transaction",n.key,`Adding subscription "${o}"`);let a=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","transaction",n.key,`Removing subscription "${o}"`),a()}};class ro{Update;initializeState(n,i){let o=`*${n.key}`;i.atoms.delete(o),i.valueMap.delete(o);let c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,p=Zo(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let a=i.parent.valueMap.get(o);i.valueMap.set(o,a)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${An(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=Fn(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(a)=>{Qn(o,i,a)}),this.unsubscribeFromState=Si(n,(a)=>{if(a.newValue!==a.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=a.newValue.subscribe(c,(x)=>{Qn(o,i,x)})},c,o)}updateCore(n,i,o){let c=`tracker:${o.config.name}:${An(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Si(i,({newValue:p,oldValue:a})=>{let x=o.timelineTopics.getRelatedKey(i.key);if(x){if(o.timelines.get(x)?.timeTraveling){let f=Yl({key:x,type:"timeline"},(v)=>{f(),Qn(o,n,($)=>{if(v==="redo"&&p)$.do(p);else if(v==="undo"&&a)$.undo(a);return $})},c,o);return}}let m=o.on.operationClose.subscribe(c,()=>{m();let l=Fn(o,n),f=p===null?-1:l.getUpdateNumber(p),v=f-l.cacheUpdateNumber;if(p&&v===1)Qn(o,n,($)=>($.do(p),$));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${l.cacheUpdateNumber+1}, but got ${f}`)})},c,o)}mutableState;latestUpdateState;dispose;constructor(n,i){this.mutableState=n;let o=U(i);this.latestUpdateState=this.initializeState(n,o),this.observeCore(n,this.latestUpdateState,o),this.updateCore(n,this.latestUpdateState,o),o.trackers.set(n.key,this),this.dispose=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),o.trackers.delete(n.key)}}}function Ta(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=U(n),p=c.atoms.get(i.key);if(p&&p.type==="mutable_atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),si(p);let a=new xn,x={...i,type:"mutable_atom",install:(f)=>{return f.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${f.config.name}"`),Ta(f,i,o)},subject:a};if(o)x.family=o;let m=i.default();c.atoms.set(x.key,x),Rx(i.key,n),Zi(i.key,m,a,c);let l=si(x);if(i.effects){let f=0,v=[];for(let $ of i.effects){let T=$({setSelf:(F)=>{Qn(n,l,F)},onSet:(F)=>Si(l,F,`effect[${f}]`,n)});if(T)v.push(T);++f}x.cleanup=()=>{for(let $ of v)$()}}if(new ro(l,n),!o)E$(l,i,n);return l}class Hl{Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=so(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=d(o,i),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=oi(c.token.family.subKey);Bn(i,this.latestUpdateAtoms,p),new ro(c.token,i)}}),this.latestUpdateAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=oi(c.token.family.subKey),a=Bn(i,this.mutableAtoms,p);if(a)new ro(a,i)}})}}function aa(n,i,o){let c={key:i.key,type:"mutable_atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","mutable_atom_family",i.key,`Overwriting an existing ${mo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let a=new xn,m=Object.assign((l)=>{let f=r(l),v={key:i.key,subKey:f},$=`${i.key}(${f})`,T=U(n),F={key:$,default:()=>i.default(l),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)F.effects=i.effects(l);let M=Ta(T,F,v);return a.next({type:"state_creation",token:M}),M},c,{subject:a,install:(l)=>aa(l,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,m),a0(m,i,n),new Hl(m,n),c}var Jl=(n,i)=>{let o=U(i),c=`${n.key}:JSON`;return o.families.get(c)};var Zn=(n,i)=>{if(i.family){let c=U(n),a={key:`${i.family.key}:JSON`,type:"selector_family"},x=d(a,c),m=JSON.parse(i.family.subKey);return Jn(n,x,m)}return{type:"selector",key:`${i.key}:JSON`}};var jo=(n)=>{let o={type:"atom",key:`*${n.key}`};if(n.family)o.family={key:`*${n.family.key}`,subKey:n.family.subKey};return o};function N$(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function la(n,i,o){let c=i.valueMap.get(n.key),p=o.valueMap.get(n.key);if(c===p){if(c===void 0)return typeof n.default==="function"?n.default():n.default;i.logger.info("\uD83D\uDCC3","atom",n.key,"copying");let a=n.toJson(c),x=n.fromJson(a);return o.valueMap.set(n.key,x),new ro(n,i),x}return p}function Zi(n,i,o,c){let p=c.valueMap.get(n);if(p instanceof ca)p.use(i);if(i instanceof Promise){let a=new ca(i);return c.valueMap.set(n,a),a.then((x)=>{Zi(n,x,o,c),o.next({newValue:x,oldValue:a})}).catch((x)=>{c.logger.error("\uD83D\uDCA5","state",n,"rejected:",x)}),a}return c.valueMap.set(n,i),i}var u$=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&An(i)){let{parent:c}=i;o=la(n,c,i)}return o},B$=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof ca){let c=o,p=i.selectors.get(n)??i.readonlySelectors.get(n);if(p)c.use(p.get());return}if(i.operation.open)i.operation.prev.set(n,o);i.valueMap.delete(n),i.logger.info("\uD83D\uDDD1","state",n,"evicted")};var C$=(n,i)=>{return U(i).atomsThatAreDefault.has(n)},Rx=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(n)},h$=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(U(i).atomsThatAreDefault),o.atomsThatAreDefault.delete(n)};function Zo(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=U(n),p=c.atoms.get(i.key);if(p&&p.type==="atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),si(p);let a=new xn,x={...i,type:"atom",install:(f)=>{return f.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${f.config.name}"`),Zo(f,i,o)},subject:a};if(o)x.family=o;let m=i.default;if(i.default instanceof Function)m=i.default();c.atoms.set(x.key,x),Rx(i.key,n),Zi(i.key,m,a,c);let l=si(x);if(i.effects){let f=0,v=[];for(let $ of i.effects){let T=$({setSelf:(F)=>{Qn(n,l,F)},onSet:(F)=>Si(l,F,`effect[${f}]`,n)});if(T)v.push(T);++f}x.cleanup=()=>{for(let $ of v)$()}}return l}function m0(n,i){if("mutable"in i){let p=Ta(n,i,void 0);return n.on.atomCreation.next(p),p}let c=Zo(n,i,void 0);return n.on.atomCreation.next(c),c}function Xl(n,i){let o=U(i),{key:c}=n,p=d(n,o);if(!p.family)i.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{p.cleanup?.();let a=i.valueMap.get(p.key);d({key:p.family.key,type:"atom_family"},i).subject.next({type:"state_disposal",token:n,value:a});let m=o.molecules.get(p.family.subKey);if(m)m.tokens.delete(c);if(o.atoms.delete(c),o.valueMap.delete(c),o.selectorAtoms.delete(c),o.atomsThatAreDefault.delete(c),i.timelineTopics.delete(c),n.type==="mutable_atom"){let l=jo(n);Xl(l,i),i.trackers.delete(c)}if(i.logger.info("\uD83D\uDD25","atom",c,"deleted"),An(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.atomDisposal.next(n)}}var nV=Symbol("provenance");function Al(n,i,o){let c=r(o);try{let p=[],a;if(i==="root")p.push(n.molecules.get('"root"')),a="all";else if(typeof i==="string"&&i.startsWith(a8)){a="any";let v=r(i),$=n.molecules.get(v);if(!$)throw new Error(`Molecule ${v} not found in store "${n.config.name}"`);p.push($)}else if(o.startsWith("T$--")){a="all";for(let $ of i){let T=r($),F=n.molecules.get(T);if(!F)throw new Error(`Molecule ${T} not found in store "${n.config.name}"`);p.push(F)}}else{a="any";let $=r(i),T=n.molecules.get($);if(!T)throw new Error(`Molecule ${$} not found in store "${n.config.name}"`);p.push(T)}let x=new ip(p,o);x._dependsOn=a,n.molecules.set(c,x);for(let v of p)v.below.set(x.stringKey,x);let m={type:"molecule_creation",subType:"modern",key:x.key,provenance:i},l=U(n);if(An(l)&&l.transactionMeta.phase==="building")l.transactionMeta.update.updates.push(m);else l.on.moleculeCreationStart.next(m)}catch(p){if(p instanceof Error)n.logger.error("\u274C","molecule",c,"allocation failed:",p.message)}return o}function va(n,i){let o=r(i),c=n.molecules.get(o);if(!c)throw new Error(`Molecule ${o} not found in store "${n.config.name}"`);for(let f of c.joins.values())f.relations.delete(c.key),f.molecules.delete(c.stringKey);let p;if(c.above.size===1)p=c.above.values().next().value.key;else p=[...c.above.values()].map(({key:f})=>f);let a=[];for(let f of c.tokens.values()){let v=f.family;a.push([v.key,n.valueMap.get(f.key)])}for(let f of c.tokens.values())zi(n,f);for(let f of c.below.values())if(f.dependsOn==="all")va(n,f.key);else if(f.above.delete(c.stringKey),f.above.size===0)va(n,f.key);c.below.clear();let x={type:"molecule_disposal",subType:"modern",key:c.key,values:a,provenance:p},m=U(n);if(An(m)&&m.transactionMeta.phase==="building")m.transactionMeta.update.updates.push(x);else m.on.moleculeDisposal.next(x);m.molecules.delete(c.stringKey);for(let f of c.above.values())f.below.delete(c.stringKey)}var a8="T$";function go(n){return m0(nn.STORE,n)}function Wc(n){return U$(nn.STORE,n)}var El=(n)=>(i,o,c,p,...a)=>{console[n](`${i} ${o} "${c}" ${p}`,...a)},x8={error:El("error"),info:El("info"),warn:El("warn")};class Rc{n;i;o;constructor(n,i,o=x8){this.logLevel=n;this.filter=i;this.logger=o}error=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!==null)this.logger.error(...n)};info=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel==="info")this.logger.info(...n)};warn=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!=="error"&&this.logLevel!==null)this.logger.warn(...n)}}function Wx(n){return $l(nn.STORE,n)}function Kc(n){return Kl(n,nn.STORE)}class l0 extends Map{set(n,i){if(this.has(n))return console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this;return super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}class Kx{n;type="continuity";globals=[];actions=[];perspectives=[];constructor(n){this.key=n}static existing=new l0;static create(n,i){let o=new Kx(n),{type:c,globals:p,actions:a,perspectives:x}=i(o),m={type:c,key:n,globals:p,actions:a,perspectives:x};return Kx.existing.set(n,m),m}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function f0(n){let{key:i,config:o}=n,c=Kx.create(i,o),{actions:p}=c;for(let a of p)g$(i,a.key,nn.STORE);return q$(i,-1,nn.STORE),c}var JV=go({key:"usersInRoomIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Ol=go({key:"roomIndex",default:()=>new ci,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),m8={enteredAtEpoch:0},wa=$x({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},m8),SV=Wx({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=s$(wa);return[i(o,n)]}});import{spawn as l8}from"child_process";class op{n;listeners;globalListeners;handleEvent(n,...i){for(let c of this.globalListeners)c(n,...i);let o=this.listeners.get(n);if(o)for(let c of o)c(...i)}id="no_id_retrieved";constructor(n){this.emit=n;this.listeners=new Map,this.globalListeners=new Set}on(n,i){let o=this.listeners.get(n);if(o)o.add(i);else this.listeners.set(n,new Set([i]));return this}onAny(n){return this.globalListeners.add(n),this}off(n,i){let o=this.listeners.get(n);if(o)if(i)o.delete(i);else this.listeners.delete(n);return this}offAny(n){return this.globalListeners.delete(n),this}}class Ja extends op{n;i;o;incompleteData="";unprocessedEvents=[];incompleteLog="";unprocessedLogs=[];id="#####";handleLog(n){if(Array.isArray(n)){let[i,...o]=n;switch(i){case"i":this.logger.info(this.id,this.key,...o);break;case"w":this.logger.warn(this.id,this.key,...o);break;case"e":this.logger.error(this.id,this.key,...o);break}}}constructor(n,i,o=console){super((c,...p)=>{let a=JSON.stringify([c,...p])+"\x03",x=(m)=>{if(m.code==="EPIPE")console.error("EPIPE error during write",this.process.stdin);this.process.stdin.removeListener("error",x)};return this.process.stdin.once("error",x),this.process.stdin.write(a),this});this.process=n;this.key=i;this.logger=o;if(this.process=n,this.process.stdout.on("data",(c)=>{let p=c.toString();if(p==="\u2728")return;this.unprocessedEvents.push(...p.split("\x03"));let a=this.unprocessedEvents.shift();this.incompleteData+=a??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let x=oi(this.incompleteData);this.handleEvent(...x);while(this.unprocessedEvents.length>0){let m=this.unprocessedEvents.shift();if(m){if(this.unprocessedEvents.length===0)this.incompleteData=m;x=oi(m),this.handleEvent(...x)}}this.incompleteData=""}catch(x){console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.warn(this.incompleteData),console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.error(x)}}),this.process.stderr.on("data",(c)=>{let p=c.toString();this.unprocessedLogs.push(...p.split("\x03"));let a=this.unprocessedLogs.shift();this.incompleteLog+=a??"";try{let x=oi(this.incompleteLog);this.handleLog(x);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)x=oi(this.incompleteLog),this.handleLog(x)}catch(x){console.error("\u274C\u274C\u274C"),console.error(this.incompleteLog),console.error(x),console.error("\u274C\u274C\u274C\uFE0F")}}),n.pid)this.id=n.pid.toString()}}class v0 extends op{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new xn,this.out=new xn,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class Ul extends op{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(r(n.map((i)=>i instanceof ci?`{ ${i.toJSON().members.join(" | ")} }`:i))+"\x03")}logger={info:(...n)=>{this.log("i",...n)},warn:(...n)=>{this.log("w",...n)},error:(...n)=>{this.log("e",...n)}};constructor(){super((n,...i)=>{let o=JSON.stringify([n,...i]);return this.process.stdout.write(o+"\x03"),this});if(this.process=process,this.process.stdin.resume(),this.relays=new Map,this.relayServices=[],this.process.stdin.on("data",(n)=>{let i=n.toString();this.unprocessedEvents.push(...i.split("\x03"));let o=this.unprocessedEvents.shift();this.incompleteData+=o??"";try{let c=oi(this.incompleteData);this.logger.info("\uD83C\uDFB0","received",c),this.handleEvent(...c);while(this.unprocessedEvents.length>0){let p=this.unprocessedEvents.shift();if(p){if(this.unprocessedEvents.length===0)this.incompleteData=p;let a=oi(p);this.handleEvent(...a)}}this.incompleteData=""}catch(c){if(c instanceof Error)this.logger.error("\u2757",c.message,c.cause,c.stack)}}),this.on("exit",()=>{this.logger.info("\uD83D\uDD25",this.id,'received "exit"'),process.exit(0)}),process.on("exit",(n)=>{this.logger.info("\uD83D\uDD25",this.id,`exited with code ${n}`)}),process.on("end",()=>{this.logger.info("\uD83D\uDD25",this.id,"ended"),process.exit(0)}),process.on("SIGTERM",()=>{this.logger.error("\uD83D\uDD25",this.id,"terminated"),process.exit(0)}),process.on("SIGINT",()=>{this.logger.error("\uD83D\uDD25",this.id,"interrupted"),process.exit(0)}),process.pid)this.id=process.pid?.toString();this.on("user-joins",(n)=>{this.logger.info("\uD83D\uDC64","user",n,"joined");let i=new v0(`user:${n}`);this.relays.set(n,i),this.logger.info("\uD83D\uDD17","attaching services:",`[${[...this.relayServices.keys()].join(", ")}]`);for(let o of this.relayServices){let c=o(i);if(c)i.disposalFunctions.push(c)}this.on(`user:${n}`,(...o)=>{i.in.next(o)}),i.out.subscribe("socket",(o)=>{this.emit(...o)})}),this.on("user-leaves",(n)=>{let i=this.relays.get(n);if(this.off(`relay:${n}`),i)i.dispose(),this.relays.delete(n)}),process.stdout.write("\u2728")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}var Vl=Wc({key:"roomArguments",default:["echo",["Hello World!"]]}),$0=Wx({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Vl,n),p=i(c),[a,x]=p,m=await new Promise((l)=>{let f=l8(a,x,{env:process.env}),v=($)=>{if($.toString()==="\u2728")f.stdout.off("data",v),l(f)};f.stdout.on("data",v)});return new Ja(m,n)}});var IV=Kc({key:"createRoom",do:({get:n,set:i,find:o},c,p,a)=>{let x=a?[p,a]:[p],m=o(Vl,c);i(m,x),i(Ol,(v)=>v.add(c));let l=o($0,c);return n(l)}}),kV=Kc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return Mc(wa,(a)=>{a.set({room:i,user:o},p)},n.env().store),p}}),sV=Kc({key:"leaveRoom",do:(n,i,o)=>{Mc(wa,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),ZV=Kc({key:"destroyRoom",do:(n,i)=>{Mc(wa,(o)=>{o.delete({room:i})},n.env().store),n.set(Ol,(o)=>(o.delete(i),o))}});function ul(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=ul(n,o.updates);return{...o,updates:c}}default:return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":return n.includes(o.token.key);case"molecule_creation":return!0;case"transaction_update":return!0}})}var PV=Wc({key:"redactor",default:{occlude:(n)=>n}}),cp=Wc({key:"unacknowledgedUpdates",default:()=>[]});var Xx=Wc({key:"sockets",default:null}),_l=go({key:"socketsIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),bl=go({key:"usersIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Xc=$x({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function T0(n,i,o,c){let p=i.key;return function a(){let x=[];for(let l of i.globals){let f=l.type==="mutable_atom"?Zn(n,l):l,v=Fn(n,f);x.push(f,v)}for(let l of i.perspectives){let{viewAtoms:f,resourceAtoms:v}=l,$=Jn(n,f,o),T=Fn(n,$);n.logger.info("\uD83D\uDC41","atom",v.key,`${o} can see`,{viewAtoms:f,resourceAtoms:v,userView:T});for(let F of T){let M=F.type==="mutable_atom"?Zn(n,F):F,A=Fn(n,M);x.push(M,A)}}let m=tn(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,m,x)}}function w0(n,i,o){let c=i.key;return function p(a){n.logger.info("\uD83D\uDECE\uFE0F","continuity",c,"received",a);let{key:x,id:m}=a,l=`tx-run:${x}:${m}`,f=`${l}:start`,v=`${l}:end`;performance.mark(f);try{qo({type:"transaction",key:x},m,n)(...a.params)}catch(T){if(T instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${x} from ${o} with update ${m}`,T.message)}performance.mark(v);let $=performance.measure(l,f,v);n?.logger.info("\uD83D\uDE80","transaction",x,m,o,$.duration)}}function J0(n,i,o,c){let p=i.key;return function a(x){if(n.logger.info("\uD83D\uDC4D","continuity",p,`${o} acknowledged epoch ${x}`),c[0]?.epoch===x)Qn(n,cp,o,(l)=>{return l.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,l.length,"items"),l})}}function S0(n,i,o,c){let p=i.key,a=[];for(let x of i.actions){let m=zl(x,(l)=>{try{let f=i.globals.map((T)=>{if(T.type==="atom")return T.key;return jo(T).key}).concat(i.perspectives.flatMap((T)=>{let{viewAtoms:F}=T,M=Jn(n,F,o);return Fn(n,M).map((R)=>{return R.type==="mutable_atom"?"*"+R.key:R.key})})),v=ul(f,l.updates),$={...l,updates:v};Qn(n,cp,o,(T)=>{if($)T.push($),T.sort((F,M)=>F.epoch-M.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,T.length,"items");return T}),c?.emit(`tx-new:${p}`,$)}catch(f){if(f instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${x.key} to ${o}`,f.message)}},`sync-continuity:${p}:${o}`,n);a.push(m)}return a}function A0(n,i,o,c){let p=i.key,a=[];for(let x of i.perspectives){let{viewAtoms:m}=x,l=Jn(n,m,o),f=Si(l,({oldValue:v,newValue:$})=>{let T=v.map((R)=>R.key),F=$.map((R)=>R.key),M=v.filter((R)=>!F.includes(R.key)),A=$.filter((R)=>!T.includes(R.key)).flatMap((R)=>{let G=R.type==="mutable_atom"?Zn(n,R):R,Q=Fn(n,G);return[G,Q]});if(n.logger.info("\uD83D\uDC41","atom",x.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:T,newKeys:F,revealed:A,concealed:M}),A.length>0)c?.emit(`reveal:${p}`,A);if(M.length>0)c?.emit(`conceal:${p}`,M)},`sync-continuity:${p}:${o}:perspective:${x.resourceAtoms.key}`,n);a.push(f)}return a}function F0({socket:n,store:i=nn.STORE}){return function o(c){let p=n,a=c.key,x=np(Xc,`socket::${p.id}`,i).userKeyOfSocket,m=Fn(i,x);if(!m)return i.logger.error("\u274C","continuity",a,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let l=np(Xc,m,i).socketKeyOfUser,f=Si(l,({newValue:G})=>{if(i.logger.info("\uD83D\uDC4B","continuity",a,`seeing ${m} on new socket ${G}`),G===null){i.logger.warn("\u274C","continuity",a,`User (${m}) is not connected to a socket, waiting for them to reappear.`);return}let Q=Jn(i,Xx,G);p=Fn(i,Q);for(let D of v)p?.emit(`tx-new:${a}`,D)},`sync-continuity:${a}:${m}`,i),v=Fn(i,cp,m),$=[],T=A0(i,c,m,p),F=S0(i,c,m,p);$.push(...T,...F);let M=T0(i,c,m,n);p.off(`get:${a}`,M),p.on(`get:${a}`,M);let A=w0(i,c,m);p.off(`tx-run:${a}`,A),p.on(`tx-run:${a}`,A);let R=J0(i,c,m,v);return p?.on(`ack:${a}`,R),()=>{for(let G of $)G();p?.off(`ack:${a}`,R),p?.off(`get:${a}`,M),p?.off(`tx-run:${a}`,A)}}}var n4=fl(vf(),1);var J=Symbol.for("drizzle:entityKind"),f_=Symbol.for("drizzle:hasOwnEntityKind");function z(n,i){if(!n||typeof n!=="object")return!1;if(n instanceof i)return!0;if(!Object.prototype.hasOwnProperty.call(i,J))throw new Error(`Class "${i.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let o=Object.getPrototypeOf(n).constructor;if(o)while(o){if(J in o&&o[J]===i[J])return!0;o=Object.getPrototypeOf(o)}return!1}class bn{constructor(n,i){this.table=n,this.config=i,this.name=i.name,this.keyAsName=i.keyAsName,this.notNull=i.notNull,this.default=i.default,this.defaultFn=i.defaultFn,this.onUpdateFn=i.onUpdateFn,this.hasDefault=i.hasDefault,this.primary=i.primaryKey,this.isUnique=i.isUnique,this.uniqueName=i.uniqueName,this.uniqueType=i.uniqueType,this.dataType=i.dataType,this.columnType=i.columnType,this.generated=i.generated,this.generatedIdentity=i.generatedIdentity}static[J]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(n){return n}mapToDriverValue(n){return n}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class $f{static[J]="ColumnBuilder";config;constructor(n,i,o){this.config={name:n,keyAsName:n==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:i,columnType:o,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(n){return this.config.default=n,this.config.hasDefault=!0,this}$defaultFn(n){return this.config.defaultFn=n,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(n){return this.config.onUpdateFn=n,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(n){if(this.config.name!=="")return;this.config.name=n}}var To=Symbol.for("drizzle:Name");class Tf{static[J]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(n,i){if(this.reference=()=>{let{name:o,columns:c,foreignColumns:p}=n();return{name:o,columns:c,foreignTable:p[0].table,foreignColumns:p}},i)this._onUpdate=i.onUpdate,this._onDelete=i.onDelete}onUpdate(n){return this._onUpdate=n===void 0?"no action":n,this}onDelete(n){return this._onDelete=n===void 0?"no action":n,this}build(n){return new K1(n,this)}}class K1{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[J]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:n,columns:i,foreignColumns:o}=this.reference(),c=i.map((x)=>x.name),p=o.map((x)=>x.name),a=[this.table[To],...c,o[0].table[To],...p];return n??`${a.join("_")}_fk`}}function Ix(n,...i){return n(...i)}function X1(n,i){return`${n[To]}_${i.join("_")}_unique`}function G1(n,i,o){for(let c=i;c<n.length;c++){let p=n[c];if(p==="\\"){c++;continue}if(p==='"')return[n.slice(i,c).replace(/\\/g,""),c+1];if(o)continue;if(p===","||p==="}")return[n.slice(i,c).replace(/\\/g,""),c]}return[n.slice(i).replace(/\\/g,""),n.length]}function Y1(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let a=n[c];if(a===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,a==="\\"){c+=2;continue}if(a==='"'){let[l,f]=G1(n,c+1,!0);o.push(l),c=f;continue}if(a==="}")return[o,c+1];if(a==="{"){let[l,f]=Y1(n,c+1);o.push(l),c=f;continue}let[x,m]=G1(n,c,!1);o.push(x),c=m}return[o,c]}function z1(n){let[i]=Y1(n,1);return i}function wf(n){return`{${n.map((i)=>{if(Array.isArray(i))return wf(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return`${i}`}).join(",")}}`}class I extends $f{foreignKeyConfigs=[];static[J]="PgColumnBuilder";array(n){return new H1(this.config.name,this,n)}references(n,i={}){return this.foreignKeyConfigs.push({ref:n,actions:i}),this}unique(n,i){return this.config.isUnique=!0,this.config.uniqueName=n,this.config.uniqueType=i?.nulls,this}generatedAlwaysAs(n){return this.config.generated={as:n,type:"always",mode:"stored"},this}buildForeignKeys(n,i){return this.foreignKeyConfigs.map(({ref:o,actions:c})=>{return Ix((p,a)=>{let x=new Tf(()=>{let m=p();return{columns:[n],foreignColumns:[m]}});if(a.onUpdate)x.onUpdate(a.onUpdate);if(a.onDelete)x.onDelete(a.onDelete);return x.build(i)},o,c)})}buildExtraConfigColumn(n){return new Q1(n,this.config)}}class u extends bn{constructor(n,i){if(!i.uniqueName)i.uniqueName=X1(n,[i.name]);super(n,i);this.table=n}static[J]="PgColumn"}class Q1 extends u{static[J]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(n){return this.indexConfig.opClass=n,this}}class za{static[J]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class H1 extends I{static[J]="PgArrayBuilder";constructor(n,i,o){super(n,"array","PgArray");this.config.baseBuilder=i,this.config.size=o}build(n){let i=this.config.baseBuilder.build(n);return new Jf(n,this.config,i)}}class Jf extends u{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[J]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=z1(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:z(this.baseColumn,Jf)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return wf(o)}}var Sf=Symbol.for("drizzle:isPgEnum");function E1(n){return!!n&&typeof n==="function"&&Sf in n&&n[Sf]===!0}class O1 extends I{static[J]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new U1(n,this.config)}}class U1 extends u{static[J]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(n,i){super(n,i);this.enum=i.enum}getSQLType(){return this.enum.enumName}}function kx(n,i){return OW(n,i,void 0)}function OW(n,i,o){let c=Object.assign((p)=>new O1(p??"",c),{enumName:n,enumValues:i,schema:o,[Sf]:!0});return c}class fi{static[J]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Qa extends fi{static[J]="WithSubquery"}var V1="0.36.1";var Af,Ff,Un={startActiveSpan(n,i){if(!Af)return i();if(!Ff)Ff=Af.trace.getTracer("drizzle-orm",V1);return Ix((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(a){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:a instanceof Error?a.message:"Unknown error"}),a}finally{p.end()}}),Af,Ff)}};var hn=Symbol.for("drizzle:ViewBaseConfig");var sx=Symbol.for("drizzle:Schema"),u1=Symbol.for("drizzle:Columns"),_1=Symbol.for("drizzle:ExtraConfigColumns"),Mf=Symbol.for("drizzle:OriginalName"),Rf=Symbol.for("drizzle:BaseName"),b1=Symbol.for("drizzle:IsAlias"),j1=Symbol.for("drizzle:ExtraConfigBuilder"),UW=Symbol.for("drizzle:IsDrizzleTable");class L{static[J]="Table";static Symbol={Name:To,Schema:sx,OriginalName:Mf,Columns:u1,ExtraConfigColumns:_1,BaseName:Rf,IsAlias:b1,ExtraConfigBuilder:j1};[To];[Mf];[sx];[u1];[_1];[Rf];[b1]=!1;[UW]=!0;[j1]=void 0;constructor(n,i,o){this[To]=this[Mf]=n,this[sx]=i,this[Rf]=o}}function di(n){return n[To]}function Ec(n){return`${n[sx]??"public"}.${n[To]}`}function Wf(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function VW(n){let i={sql:"",params:[]};for(let o of n)if(i.sql+=o.sql,i.params.push(...o.params),o.typings?.length){if(!i.typings)i.typings=[];i.typings.push(...o.typings)}return i}class pi{static[J]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new k([this])}}class k{constructor(n){this.queryChunks=n}static[J]="SQL";decoder=B1;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return Un.startActiveSpan("drizzle.buildSQL",(i)=>{let o=this.buildQueryFromSourceParams(this.queryChunks,n);return i?.setAttributes({"drizzle.query.text":o.sql,"drizzle.query.params":JSON.stringify(o.params)}),o})}buildQueryFromSourceParams(n,i){let o=Object.assign({},i,{inlineParams:i.inlineParams||this.shouldInlineParams,paramStartIndex:i.paramStartIndex||{value:0}}),{casing:c,escapeName:p,escapeParam:a,prepareTyping:x,inlineParams:m,paramStartIndex:l}=o;return VW(n.map((f)=>{if(z(f,pi))return{sql:f.value.join(""),params:[]};if(z(f,Zx))return{sql:p(f.value),params:[]};if(f===void 0)return{sql:"",params:[]};if(Array.isArray(f)){let v=[new pi("(")];for(let[$,T]of f.entries())if(v.push(T),$<f.length-1)v.push(new pi(", "));return v.push(new pi(")")),this.buildQueryFromSourceParams(v,o)}if(z(f,k))return this.buildQueryFromSourceParams(f.queryChunks,{...o,inlineParams:m||f.shouldInlineParams});if(z(f,L)){let v=f[L.Symbol.Schema],$=f[L.Symbol.Name];return{sql:v===void 0?p($):p(v)+"."+p($),params:[]}}if(z(f,bn)){let v=c.getColumnCasing(f);if(i.invokeSource==="indexes")return{sql:p(v),params:[]};return{sql:p(f.table[L.Symbol.Name])+"."+p(v),params:[]}}if(z(f,Vi)){let v=f[hn].schema,$=f[hn].name;return{sql:v===void 0?p($):p(v)+"."+p($),params:[]}}if(z(f,Li)){if(z(f.value,pc))return{sql:a(l.value++,f),params:[f],typings:["none"]};let v=f.value===null?null:f.encoder.mapToDriverValue(f.value);if(z(v,k))return this.buildQueryFromSourceParams([v],o);if(m)return{sql:this.mapInlineParam(v,o),params:[]};let $=["none"];if(x)$=[x(f.encoder)];return{sql:a(l.value++,v),params:[v],typings:$}}if(z(f,pc))return{sql:a(l.value++,f),params:[f],typings:["none"]};if(z(f,k.Aliased)&&f.fieldAlias!==void 0)return{sql:p(f.fieldAlias),params:[]};if(z(f,fi)){if(f._.isWith)return{sql:p(f._.alias),params:[]};return this.buildQueryFromSourceParams([new pi("("),f._.sql,new pi(") "),new Zx(f._.alias)],o)}if(E1(f)){if(f.schema)return{sql:p(f.schema)+"."+p(f.enumName),params:[]};return{sql:p(f.enumName),params:[]}}if(Wf(f)){if(f.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([f.getSQL()],o);return this.buildQueryFromSourceParams([new pi("("),f.getSQL(),new pi(")")],o)}if(m)return{sql:this.mapInlineParam(f,o),params:[]};return{sql:a(l.value++,f),params:[f],typings:["none"]}}))}mapInlineParam(n,{escapeString:i}){if(n===null)return"null";if(typeof n==="number"||typeof n==="boolean")return n.toString();if(typeof n==="string")return i(n);if(typeof n==="object"){let o=n.toString();if(o==="[object Object]")return i(JSON.stringify(n));return i(o)}throw new Error("Unexpected param value: "+n)}getSQL(){return this}as(n){if(n===void 0)return this;return new k.Aliased(this,n)}mapWith(n){return this.decoder=typeof n==="function"?{mapFromDriverValue:n}:n,this}inlineParams(){return this.shouldInlineParams=!0,this}if(n){return n?this:void 0}}class Zx{constructor(n){this.value=n}static[J]="Name";brand;getSQL(){return new k([this])}}function y1(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var B1={mapFromDriverValue:(n)=>n},L1={mapToDriverValue:(n)=>n},g_={...B1,...L1};class Li{constructor(n,i=L1){this.value=n,this.encoder=i}static[J]="Param";brand;getSQL(){return new k([this])}}function S(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new pi(n[0]));for(let[c,p]of i.entries())o.push(p,new pi(n[c+1]));return new k(o)}((n)=>{function i(){return new k([])}n.empty=i;function o(l){return new k(l)}n.fromList=o;function c(l){return new k([new pi(l)])}n.raw=c;function p(l,f){let v=[];for(let[$,T]of l.entries()){if($>0&&f!==void 0)v.push(f);v.push(T)}return new k(v)}n.join=p;function a(l){return new Zx(l)}n.identifier=a;function x(l){return new pc(l)}n.placeholder=x;function m(l,f){return new Li(l,f)}n.param=m})(S||(S={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[J]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(k||(k={}));class pc{constructor(n){this.name=n}static[J]="Placeholder";getSQL(){return new k([this])}}function Kf(n,i){return n.map((o)=>{if(z(o,pc)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(z(o,Li)&&z(o.value,pc)){if(!(o.value.name in i))throw new Error(`No value for placeholder "${o.value.name}" was provided`);return o.encoder.mapToDriverValue(i[o.value.name])}return o})}class Vi{static[J]="View";[hn];constructor({name:n,schema:i,selectedFields:o,query:c}){this[hn]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new k([this])}}bn.prototype.getSQL=function(){return new k([this])};L.prototype.getSQL=function(){return new k([this])};fi.prototype.getSQL=function(){return new k([this])};class Ap{constructor(n){this.table=n}static[J]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class Ha{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[J]="TableAliasProxyHandler";get(n,i){if(i===L.Symbol.IsAlias)return!0;if(i===L.Symbol.Name)return this.alias;if(this.replaceOriginalName&&i===L.Symbol.OriginalName)return this.alias;if(i===hn)return{...n[hn],name:this.alias,isAlias:!0};if(i===L.Symbol.Columns){let c=n[L.Symbol.Columns];if(!c)return c;let p={};return Object.keys(c).map((a)=>{p[a]=new Proxy(c[a],new Ap(new Proxy(n,this)))}),p}let o=n[i];if(z(o,bn))return new Proxy(o,new Ap(new Proxy(n,this)));return o}}function tx(n,i){return new Proxy(n,new Ha(i,!1))}function Ho(n,i){return new Proxy(n,new Ap(new Proxy(n.table,new Ha(i,!1))))}function Xf(n,i){return new k.Aliased(Ea(n.sql,i),n.fieldAlias)}function Ea(n,i){return S.join(n.queryChunks.map((o)=>{if(z(o,bn))return Ho(o,i);if(z(o,k))return Ea(o,i);if(z(o,k.Aliased))return Xf(o,i);return o}))}class qx extends Error{static[J]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Gf extends qx{static[J]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function ui(n,i){if(y1(i)&&!Wf(n)&&!z(n,Li)&&!z(n,pc)&&!z(n,bn)&&!z(n,L)&&!z(n,Vi))return new Li(n,i);return n}var Eo=(n,i)=>{return S`${n} = ${ui(i,n)}`},N1=(n,i)=>{return S`${n} <> ${ui(i,n)}`};function Oc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new k(i);return new k([new pi("("),S.join(i,new pi(" and ")),new pi(")")])}function D1(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new k(i);return new k([new pi("("),S.join(i,new pi(" or ")),new pi(")")])}function C1(n){return S`not ${n}`}var Px=(n,i)=>{return S`${n} > ${ui(i,n)}`},h1=(n,i)=>{return S`${n} >= ${ui(i,n)}`},I1=(n,i)=>{return S`${n} < ${ui(i,n)}`},k1=(n,i)=>{return S`${n} <= ${ui(i,n)}`};function s1(n,i){if(Array.isArray(i)){if(i.length===0)return S`false`;return S`${n} in ${i.map((o)=>ui(o,n))}`}return S`${n} in ${ui(i,n)}`}function Z1(n,i){if(Array.isArray(i)){if(i.length===0)return S`true`;return S`${n} not in ${i.map((o)=>ui(o,n))}`}return S`${n} not in ${ui(i,n)}`}function t1(n){return S`${n} is null`}function q1(n){return S`${n} is not null`}function P1(n){return S`exists ${n}`}function r1(n){return S`not exists ${n}`}function g1(n,i,o){return S`${n} between ${ui(i,n)} and ${ui(o,n)}`}function d1(n,i,o){return S`${n} not between ${ui(i,n)} and ${ui(o,n)}`}function e1(n,i){return S`${n} like ${i}`}function nw(n,i){return S`${n} not like ${i}`}function iw(n,i){return S`${n} ilike ${i}`}function ow(n,i){return S`${n} not ilike ${i}`}function cw(n){return S`${n} asc`}function pw(n){return S`${n} desc`}class aw{static[J]="ConsoleLogWriter";write(n){console.log(n)}}class Yf{static[J]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new aw}logQuery(n,i){let o=i.map((p)=>{try{return JSON.stringify(p)}catch{return String(p)}}),c=o.length?` -- params: [${o.join(", ")}]`:"";this.writer.write(`Query: ${n}${c}`)}}class zf{static[J]="NoopLogger";logQuery(){}}class Qi{static[J]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}then(n,i){return this.execute().then(n,i)}}function xw(n,i,o){let c={},p=n.reduce((a,{path:x,field:m},l)=>{let f;if(z(m,bn))f=m;else if(z(m,k))f=m.decoder;else f=m.sql.decoder;let v=a;for(let[$,T]of x.entries())if($<x.length-1){if(!(T in v))v[T]={};v=v[T]}else{let F=i[l],M=v[T]=F===null?null:f.mapFromDriverValue(F);if(o&&z(m,bn)&&x.length===2){let A=x[0];if(!(A in c))c[A]=M===null?di(m.table):!1;else if(typeof c[A]==="string"&&c[A]!==di(m.table))c[A]=!1}}return a},{});if(o&&Object.keys(c).length>0){for(let[a,x]of Object.entries(c))if(typeof x==="string"&&!o[x])p[a]=null}return p}function ei(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let a=i?[...i,c]:[c];if(z(p,bn)||z(p,k)||z(p,k.Aliased))o.push({path:a,field:p});else if(z(p,L))o.push(...ei(p[L.Symbol.Columns],a));else o.push(...ei(p,a));return o},[])}function Qf(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,a]of o.entries())if(a!==c[p])return!1;return!0}function rx(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(z(p,k))return[c,p];else return[c,new Li(p,n[L.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function mw(n,i){for(let o of i)for(let c of Object.getOwnPropertyNames(o.prototype)){if(c==="constructor")continue;Object.defineProperty(n.prototype,c,Object.getOwnPropertyDescriptor(o.prototype,c)||Object.create(null))}}function lw(n){return n[L.Symbol.Columns]}function Hf(n){return z(n,fi)?n._.alias:z(n,Vi)?n[hn].name:z(n,k)?void 0:n[L.Symbol.IsAlias]?n[L.Symbol.Name]:n[L.Symbol.BaseName]}function Sn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function fw(n){if(typeof n!=="object"||n===null)return!1;if(n.constructor.name!=="Object")return!1;if("logger"in n){let i=typeof n.logger;if(i!=="boolean"&&(i!=="object"||typeof n.logger.logQuery!=="function")&&i!=="undefined")return!1;return!0}if("schema"in n){let i=typeof n.logger;if(i!=="object"&&i!=="undefined")return!1;return!0}if("casing"in n){let i=typeof n.logger;if(i!=="string"&&i!=="undefined")return!1;return!0}if("mode"in n){if(n.mode!=="default"||n.mode!=="planetscale"||n.mode!==void 0)return!1;return!0}if("connection"in n){let i=typeof n.connection;if(i!=="string"&&i!=="object"&&i!=="undefined")return!1;return!0}if("client"in n){let i=typeof n.client;if(i!=="object"&&i!=="function"&&i!=="undefined")return!1;return!0}if(Object.keys(n).length===0)return!0;return!1}class ac extends I{static[J]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"always",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"byDefault",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}class vw extends ac{static[J]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new $w(n,this.config)}}class $w extends u{static[J]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class Tw extends ac{static[J]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new ww(n,this.config)}}class ww extends u{static[J]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function Jw(n,i){let{name:o,config:c}=Sn(n,i);if(c.mode==="number")return new vw(o);return new Tw(o)}class Sw extends I{static[J]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new Aw(n,this.config)}}class Aw extends u{static[J]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class Fw extends I{static[J]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new Mw(n,this.config)}}class Mw extends u{static[J]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function Rw(n,i){let{name:o,config:c}=Sn(n,i);if(c.mode==="number")return new Sw(o);return new Fw(o)}class Ww extends I{static[J]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new Kw(n,this.config)}}class Kw extends u{static[J]="PgBoolean";getSQLType(){return"boolean"}}function Oa(n){return new Ww(n??"")}class Xw extends I{static[J]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new Gw(n,this.config)}}class Gw extends u{static[J]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function Yw(n,i={}){let{name:o,config:c}=Sn(n,i);return new Xw(o,c)}class zw extends I{static[J]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new Qw(n,this.config)}}class Qw extends u{static[J]="PgCidr";getSQLType(){return"cidr"}}function Hw(n){return new zw(n??"")}class Ew extends I{static[J]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new Ow(n,this.config)}}class Ow extends u{static[J]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(n,i){super(n,i);this.sqlName=i.customTypeParams.dataType(i.fieldConfig),this.mapTo=i.customTypeParams.toDriver,this.mapFrom=i.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(n){return typeof this.mapFrom==="function"?this.mapFrom(n):n}mapToDriverValue(n){return typeof this.mapTo==="function"?this.mapTo(n):n}}function Uw(n){return(i,o)=>{let{name:c,config:p}=Sn(i,o);return new Ew(c,p,n)}}class Bo extends I{static[J]="PgDateColumnBaseBuilder";defaultNow(){return this.default(S`now()`)}}class Vw extends Bo{static[J]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new gx(n,this.config)}}class gx extends u{static[J]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class uw extends Bo{static[J]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new dx(n,this.config)}}class dx extends u{static[J]="PgDateString";getSQLType(){return"date"}}function _w(n,i){let{name:o,config:c}=Sn(n,i);if(c?.mode==="date")return new Vw(o);return new uw(o)}class bw extends I{static[J]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new jw(n,this.config)}}class jw extends u{static[J]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function yw(n){return new bw(n??"")}class Bw extends I{static[J]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new Lw(n,this.config)}}class Lw extends u{static[J]="PgInet";getSQLType(){return"inet"}}function Nw(n){return new Bw(n??"")}class Dw extends ac{static[J]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new Cw(n,this.config)}}class Cw extends u{static[J]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function ex(n){return new Dw(n??"")}class hw extends I{static[J]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new Iw(n,this.config)}}class Iw extends u{static[J]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let n=this.fields?` ${this.fields}`:"",i=this.precision?`(${this.precision})`:"";return`interval${n}${i}`}}function kw(n,i={}){let{name:o,config:c}=Sn(n,i);return new hw(o,c)}class sw extends I{static[J]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new nm(n,this.config)}}class nm extends u{static[J]="PgJson";constructor(n,i){super(n,i)}getSQLType(){return"json"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function Zw(n){return new sw(n??"")}class tw extends I{static[J]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new im(n,this.config)}}class im extends u{static[J]="PgJsonb";constructor(n,i){super(n,i)}getSQLType(){return"jsonb"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function qw(n){return new tw(n??"")}class Pw extends I{static[J]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new rw(n,this.config)}}class rw extends u{static[J]="PgLine";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o),Number.parseFloat(c)]}mapToDriverValue(n){return`{${n[0]},${n[1]},${n[2]}}`}}class gw extends I{static[J]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new dw(n,this.config)}}class dw extends u{static[J]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return{a:Number.parseFloat(i),b:Number.parseFloat(o),c:Number.parseFloat(c)}}mapToDriverValue(n){return`{${n.a},${n.b},${n.c}}`}}function ew(n,i){let{name:o,config:c}=Sn(n,i);if(!c?.mode||c.mode==="tuple")return new Pw(o);return new gw(o)}class nJ extends I{static[J]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new iJ(n,this.config)}}class iJ extends u{static[J]="PgMacaddr";getSQLType(){return"macaddr"}}function oJ(n){return new nJ(n??"")}class cJ extends I{static[J]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new pJ(n,this.config)}}class pJ extends u{static[J]="PgMacaddr8";getSQLType(){return"macaddr8"}}function aJ(n){return new cJ(n??"")}class xJ extends I{static[J]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new om(n,this.config)}}class om extends u{static[J]="PgNumeric";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}function mJ(n,i){let{name:o,config:c}=Sn(n,i);return new xJ(o,c?.precision,c?.scale)}class lJ extends I{static[J]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new fJ(n,this.config)}}class fJ extends u{static[J]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o)]}return[n.x,n.y]}mapToDriverValue(n){return`(${n[0]},${n[1]})`}}class vJ extends I{static[J]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new $J(n,this.config)}}class $J extends u{static[J]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return{x:Number.parseFloat(i),y:Number.parseFloat(o)}}return n}mapToDriverValue(n){return`(${n.x},${n.y})`}}function TJ(n,i){let{name:o,config:c}=Sn(n,i);if(!c?.mode||c.mode==="tuple")return new lJ(o);return new vJ(o)}function uW(n){let i=[];for(let o=0;o<n.length;o+=2)i.push(Number.parseInt(n.slice(o,o+2),16));return new Uint8Array(i)}function wJ(n,i){let o=new ArrayBuffer(8),c=new DataView(o);for(let p=0;p<8;p++)c.setUint8(p,n[i+p]);return c.getFloat64(0,!0)}function Ef(n){let i=uW(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),a=p.getUint32(o,c===1);o+=4;let x;if(a&536870912)x=p.getUint32(o,c===1),o+=4;if((a&65535)===1){let m=wJ(i,o);o+=8;let l=wJ(i,o);return o+=8,[m,l]}throw new Error("Unsupported geometry type")}class JJ extends I{static[J]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new SJ(n,this.config)}}class SJ extends u{static[J]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return Ef(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class AJ extends I{static[J]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new FJ(n,this.config)}}class FJ extends u{static[J]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=Ef(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function MJ(n,i){let{name:o,config:c}=Sn(n,i);if(!c?.mode||c.mode==="tuple")return new JJ(o);return new AJ(o)}class RJ extends I{static[J]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new WJ(n,this.config)}}class WJ extends u{static[J]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function KJ(n){return new RJ(n??"")}class XJ extends I{static[J]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new GJ(n,this.config)}}class GJ extends u{static[J]="PgSerial";getSQLType(){return"serial"}}function YJ(n){return new XJ(n??"")}class zJ extends ac{static[J]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new QJ(n,this.config)}}class QJ extends u{static[J]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function HJ(n){return new zJ(n??"")}class EJ extends I{static[J]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new OJ(n,this.config)}}class OJ extends u{static[J]="PgSmallSerial";getSQLType(){return"smallserial"}}function UJ(n){return new EJ(n??"")}class VJ extends I{static[J]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new uJ(n,this.config)}}class uJ extends u{static[J]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function _J(n,i={}){let{name:o,config:c}=Sn(n,i);return new VJ(o,c)}class bJ extends Bo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[J]="PgTimeBuilder";build(n){return new cm(n,this.config)}}class cm extends u{static[J]="PgTime";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function jJ(n,i={}){let{name:o,config:c}=Sn(n,i);return new bJ(o,c.withTimezone??!1,c.precision)}class yJ extends Bo{static[J]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new pm(n,this.config)}}class pm extends u{static[J]="PgTimestamp";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue=(n)=>{return new Date(this.withTimezone?n:n+"+0000")};mapToDriverValue=(n)=>{return n.toISOString()}}class BJ extends Bo{static[J]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new am(n,this.config)}}class am extends u{static[J]="PgTimestampString";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function wo(n,i={}){let{name:o,config:c}=Sn(n,i);if(c?.mode==="string")return new BJ(o,c.withTimezone??!1,c.precision);return new yJ(o,c?.withTimezone??!1,c?.precision)}class LJ extends I{static[J]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(S`gen_random_uuid()`)}build(n){return new xm(n,this.config)}}class xm extends u{static[J]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new LJ(n??"")}class NJ extends I{static[J]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new DJ(n,this.config)}}class DJ extends u{static[J]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function vi(n,i={}){let{name:o,config:c}=Sn(n,i);return new NJ(o,c)}class CJ extends I{static[J]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new hJ(n,this.config)}}class hJ extends u{static[J]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function IJ(n,i){let{name:o,config:c}=Sn(n,i);return new CJ(o,c)}class kJ extends I{static[J]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new sJ(n,this.config)}}class sJ extends u{static[J]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function ZJ(n,i){let{name:o,config:c}=Sn(n,i);return new kJ(o,c)}class tJ extends I{static[J]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new qJ(n,this.config)}}class qJ extends u{static[J]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function PJ(n,i){let{name:o,config:c}=Sn(n,i);return new tJ(o,c)}class rJ extends I{static[J]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new gJ(n,this.config)}}class gJ extends u{static[J]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function dJ(n,i){let{name:o,config:c}=Sn(n,i);return new rJ(o,c)}function eJ(){return{bigint:Jw,bigserial:Rw,boolean:Oa,char:Yw,cidr:Hw,customType:Uw,date:_w,doublePrecision:yw,inet:Nw,integer:ex,interval:kw,json:Zw,jsonb:qw,line:ew,macaddr:oJ,macaddr8:aJ,numeric:mJ,point:TJ,geometry:MJ,real:KJ,serial:YJ,smallint:HJ,smallserial:UJ,text:_J,time:jJ,timestamp:wo,uuid:Ni,varchar:vi,bit:IJ,halfvec:ZJ,sparsevec:PJ,vector:dJ}}var Of=Symbol.for("drizzle:PgInlineForeignKeys"),nS=Symbol.for("drizzle:EnableRLS");class no extends L{static[J]="PgTable";static Symbol=Object.assign({},L.Symbol,{InlineForeignKeys:Of,EnableRLS:nS});[Of]=[];[nS]=!1;[L.Symbol.ExtraConfigBuilder]=void 0}function _W(n,i,o,c,p=n){let a=new no(n,c,p),x=typeof i==="function"?i(eJ()):i,m=Object.fromEntries(Object.entries(x).map(([v,$])=>{let T=$;T.setName(v);let F=T.build(a);return a[Of].push(...T.buildForeignKeys(F,a)),[v,F]})),l=Object.fromEntries(Object.entries(x).map(([v,$])=>{let T=$;T.setName(v);let F=T.buildExtraConfigColumn(a);return[v,F]})),f=Object.assign(a,m);if(f[L.Symbol.Columns]=m,f[L.Symbol.ExtraConfigColumns]=l,o)f[no.Symbol.ExtraConfigBuilder]=o;return Object.assign(f,{enableRLS:()=>{return f[no.Symbol.EnableRLS]=!0,f}})}var xc=(n,i,o)=>{return _W(n,i,o,void 0)};function iS(...n){if(n[0].columns)return new Ua(n[0].columns,n[0].name);return new Ua(n)}class Ua{static[J]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new oS(n,this.columns,this.name)}}class oS{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[J]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[no.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class Uf{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[L.Symbol.Name]}static[J]="Relation";referencedTableName;fieldName}class cS{constructor(n,i){this.table=n,this.config=i}static[J]="Relations"}class mc extends Uf{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[J]="One";withFieldName(n){let i=new mc(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class Va extends Uf{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[J]="Many";withFieldName(n){let i=new Va(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function pS(){return{and:Oc,between:g1,eq:Eo,exists:P1,gt:Px,gte:h1,ilike:iw,inArray:s1,isNull:t1,isNotNull:q1,like:e1,lt:I1,lte:k1,ne:N1,not:C1,notBetween:d1,notExists:r1,notLike:nw,notIlike:ow,notInArray:Z1,or:D1,sql:S}}function aS(){return{sql:S,asc:cw,desc:pw}}function xS(n,i){if(Object.keys(n).length===1&&"default"in n&&!z(n.default,L))n=n.default;let o={},c={},p={};for(let[a,x]of Object.entries(n))if(z(x,L)){let m=Ec(x),l=c[m];o[m]=a,p[a]={tsName:a,dbName:x[L.Symbol.Name],schema:x[L.Symbol.Schema],columns:x[L.Symbol.Columns],relations:l?.relations??{},primaryKey:l?.primaryKey??[]};for(let v of Object.values(x[L.Symbol.Columns]))if(v.primary)p[a].primaryKey.push(v);let f=x[L.Symbol.ExtraConfigBuilder]?.(x[L.Symbol.ExtraConfigColumns]);if(f){for(let v of Object.values(f))if(z(v,Ua))p[a].primaryKey.push(...v.columns)}}else if(z(x,cS)){let m=Ec(x.table),l=o[m],f=x.config(i(x.table)),v;for(let[$,T]of Object.entries(f))if(l){let F=p[l];if(F.relations[$]=T,v)F.primaryKey.push(...v)}else{if(!(m in c))c[m]={relations:{},primaryKey:v};c[m].relations[$]=T}}return{tables:p,tableNamesMap:o}}function bW(n){return function i(o,c){return new mc(n,o,c,c?.fields.reduce((p,a)=>p&&a.notNull,!0)??!1)}}function jW(n){return function i(o,c){return new Va(n,o,c)}}function mS(n,i,o){if(z(o,mc)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Ec(o.referencedTable)];if(!c)throw new Error(`Table "${o.referencedTable[L.Symbol.Name]}" not found in schema`);let p=n[c];if(!p)throw new Error(`Table "${c}" not found in schema`);let a=o.sourceTable,x=i[Ec(a)];if(!x)throw new Error(`Table "${a[L.Symbol.Name]}" not found in schema`);let m=[];for(let l of Object.values(p.relations))if(o.relationName&&o!==l&&l.relationName===o.relationName||!o.relationName&&l.referencedTable===o.sourceTable)m.push(l);if(m.length>1)throw o.relationName?new Error(`There are multiple relations with name "${o.relationName}" in table "${c}"`):new Error(`There are multiple relations between "${c}" and "${o.sourceTable[L.Symbol.Name]}". Please specify relation name`);if(m[0]&&z(m[0],mc)&&m[0].config)return{fields:m[0].config.references,references:m[0].config.fields};throw new Error(`There is not enough information to infer relation "${x}.${o.fieldName}"`)}function lS(n){return{one:bW(n),many:jW(n)}}function mm(n,i,o,c,p=(a)=>a){let a={};for(let[x,m]of c.entries())if(m.isJson){let l=i.relations[m.tsKey],f=o[x],v=typeof f==="string"?JSON.parse(f):f;a[m.tsKey]=z(l,mc)?v&&mm(n,n[m.relationTableTsKey],v,m.selection,p):v.map(($)=>mm(n,n[m.relationTableTsKey],$,m.selection,p))}else{let l=p(o[x]),f=m.field,v;if(z(f,bn))v=f;else if(z(f,k))v=f.decoder;else v=f.sql.decoder;a[m.tsKey]=l===null?null:v.mapFromDriverValue(l)}return a}var tM=fl(ZM(),1),{Server:qM,Namespace:dL,Socket:eL}=tM.default;import{readFileSync as lR}from"fs";import{resolve as Uv}from"path";var Rn;(function(n){n.assertEqual=(p)=>p;function i(p){}n.assertIs=i;function o(p){throw new Error}n.assertNever=o,n.arrayToEnum=(p)=>{let a={};for(let x of p)a[x]=x;return a},n.getValidEnumValues=(p)=>{let a=n.objectKeys(p).filter((m)=>typeof p[p[m]]!=="number"),x={};for(let m of a)x[m]=p[m];return n.objectValues(x)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(a){return p[a]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let a=[];for(let x in p)if(Object.prototype.hasOwnProperty.call(p,x))a.push(x);return a},n.find=(p,a)=>{for(let x of p)if(a(x))return x;return},n.isInteger=typeof Number.isInteger==="function"?(p)=>Number.isInteger(p):(p)=>typeof p==="number"&&isFinite(p)&&Math.floor(p)===p;function c(p,a=" | "){return p.map((x)=>typeof x==="string"?`'${x}'`:x).join(a)}n.joinValues=c,n.jsonStringifyReplacer=(p,a)=>{if(typeof a==="bigint")return a.toString();return a}})(Rn||(Rn={}));var Qv;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(Qv||(Qv={}));var N=Rn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Tc=(n)=>{switch(typeof n){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(n)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":if(Array.isArray(n))return N.array;if(n===null)return N.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return N.promise;if(typeof Map!=="undefined"&&n instanceof Map)return N.map;if(typeof Set!=="undefined"&&n instanceof Set)return N.set;if(typeof Date!=="undefined"&&n instanceof Date)return N.date;return N.object;default:return N.unknown}},O=Rn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Y5=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class Ii extends Error{constructor(n){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let i=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,i);else this.__proto__=i;this.name="ZodError",this.issues=n}get errors(){return this.issues}format(n){let i=n||function(p){return p.message},o={_errors:[]},c=(p)=>{for(let a of p.issues)if(a.code==="invalid_union")a.unionErrors.map(c);else if(a.code==="invalid_return_type")c(a.returnTypeError);else if(a.code==="invalid_arguments")c(a.argumentsError);else if(a.path.length===0)o._errors.push(i(a));else{let x=o,m=0;while(m<a.path.length){let l=a.path[m];if(m!==a.path.length-1)x[l]=x[l]||{_errors:[]};else x[l]=x[l]||{_errors:[]},x[l]._errors.push(i(a));x=x[l],m++}}};return c(this),o}static assert(n){if(!(n instanceof Ii))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(i)=>i.message){let i={},o=[];for(let c of this.issues)if(c.path.length>0)i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c));else o.push(n(c));return{formErrors:o,fieldErrors:i}}get formErrors(){return this.flatten()}}Ii.create=(n)=>{return new Ii(n)};var jp=(n,i)=>{let o;switch(n.code){case O.invalid_type:if(n.received===N.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case O.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Rn.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:o=`Unrecognized key(s) in object: ${Rn.joinValues(n.keys,", ")}`;break;case O.invalid_union:o="Invalid input";break;case O.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Rn.joinValues(n.options)}`;break;case O.invalid_enum_value:o=`Invalid enum value. Expected ${Rn.joinValues(n.options)}, received '${n.received}'`;break;case O.invalid_arguments:o="Invalid function arguments";break;case O.invalid_return_type:o="Invalid function return type";break;case O.invalid_date:o="Invalid date";break;case O.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if(o=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)o=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)o=`Invalid input: must end with "${n.validation.endsWith}"`;else Rn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case O.too_small:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else o="Invalid input";break;case O.too_big:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")o=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else o="Invalid input";break;case O.custom:o="Invalid input";break;case O.invalid_intersection_types:o="Intersection results could not be merged";break;case O.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case O.not_finite:o="Number must be finite";break;default:o=i.defaultError,Rn.assertNever(n)}return{message:o}},gM=jp;function z5(n){gM=n}function bm(){return gM}var jm=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,a=[...o,...p.path||[]],x={...p,path:a};if(p.message!==void 0)return{...p,path:a,message:p.message};let m="",l=c.filter((f)=>!!f).slice().reverse();for(let f of l)m=f(x,{data:i,defaultError:m}).message;return{...p,path:a,message:m}},Q5=[];function B(n,i){let o=bm(),c=jm({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===jp?void 0:jp].filter((p)=>!!p)});n.common.issues.push(c)}class Xi{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,i){let o=[];for(let c of i){if(c.status==="aborted")return e;if(c.status==="dirty")n.dirty();o.push(c.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,i){let o=[];for(let c of i){let p=await c.key,a=await c.value;o.push({key:p,value:a})}return Xi.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:a}=c;if(p.status==="aborted")return e;if(a.status==="aborted")return e;if(p.status==="dirty")n.dirty();if(a.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof a.value!=="undefined"||c.alwaysSet))o[p.value]=a.value}return{status:n.value,value:o}}}var e=Object.freeze({status:"aborted"}),_p=(n)=>({status:"dirty",value:n}),Ei=(n)=>({status:"valid",value:n}),Hv=(n)=>n.status==="aborted",Ev=(n)=>n.status==="dirty",Ca=(n)=>n.status==="valid",ha=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function ym(n,i,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(n):c?c.value:i.get(n)}function dM(n,i,o,c,p){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?n!==i||!p:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?p.call(n,o):p?p.value=o:i.set(n,o),o}var t;(function(n){n.errToObj=(i)=>typeof i==="string"?{message:i}:i||{},n.toString=(i)=>typeof i==="string"?i:i===null||i===void 0?void 0:i.message})(t||(t={}));var Na,Da;class Ko{constructor(n,i,o,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=o,this._key=c}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var PM=(n,i)=>{if(Ca(i))return{success:!0,data:i.value};else{if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new Ii(n.common.issues);return this._error=o,this._error}}}};function fn(n){if(!n)return{};let{errorMap:i,invalid_type_error:o,required_error:c,description:p}=n;if(i&&(o||c))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(i)return{errorMap:i,description:p};return{errorMap:(x,m)=>{var l,f;let{message:v}=n;if(x.code==="invalid_enum_value")return{message:v!==null&&v!==void 0?v:m.defaultError};if(typeof m.data==="undefined")return{message:(l=v!==null&&v!==void 0?v:c)!==null&&l!==void 0?l:m.defaultError};if(x.code!=="invalid_type")return{message:m.defaultError};return{message:(f=v!==null&&v!==void 0?v:o)!==null&&f!==void 0?f:m.defaultError}},description:p}}class vn{constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(n){return Tc(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Tc(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Xi,ctx:{common:n.parent.common,data:n.data,parsedType:Tc(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(ha(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){let i=this._parse(n);return Promise.resolve(i)}parse(n,i){let o=this.safeParse(n,i);if(o.success)return o.data;throw o.error}safeParse(n,i){var o;let c={common:{issues:[],async:(o=i===null||i===void 0?void 0:i.async)!==null&&o!==void 0?o:!1,contextualErrorMap:i===null||i===void 0?void 0:i.errorMap},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Tc(n)},p=this._parseSync({data:n,path:c.path,parent:c});return PM(c,p)}async parseAsync(n,i){let o=await this.safeParseAsync(n,i);if(o.success)return o.data;throw o.error}async safeParseAsync(n,i){let o={common:{issues:[],contextualErrorMap:i===null||i===void 0?void 0:i.errorMap,async:!0},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Tc(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(ha(c)?c:Promise.resolve(c));return PM(o,p)}refine(n,i){let o=(c)=>{if(typeof i==="string"||typeof i==="undefined")return{message:i};else if(typeof i==="function")return i(c);else return i};return this._refinement((c,p)=>{let a=n(c),x=()=>p.addIssue({code:O.custom,...o(c)});if(typeof Promise!=="undefined"&&a instanceof Promise)return a.then((m)=>{if(!m)return x(),!1;else return!0});if(!a)return x(),!1;else return!0})}refinement(n,i){return this._refinement((o,c)=>{if(!n(o))return c.addIssue(typeof i==="function"?i(o,c):i),!1;else return!0})}_refinement(n){return new co({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}optional(){return Wo.create(this,this._def)}nullable(){return ho.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ro.create(this,this._def)}promise(){return Cc.create(this,this._def)}or(n){return Np.create([this,n],this._def)}and(n){return Dp.create(this,n,this._def)}transform(n){return new co({...fn(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new kp({...fn(this._def),innerType:this,defaultValue:i,typeName:g.ZodDefault})}brand(){return new Lm({typeName:g.ZodBranded,type:this,...fn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new sp({...fn(this._def),innerType:this,catchValue:i,typeName:g.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return qa.create(this,n)}readonly(){return Zp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var H5=/^c[^\s-]{8,}$/i,E5=/^[0-9a-z]+$/,O5=/^[0-9A-HJKMNP-TV-Z]{26}$/,U5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,V5=/^[a-z0-9_-]{21}$/i,u5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,b5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zv,j5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,y5=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,B5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eM="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",L5=new RegExp(`^${eM}\$`);function nR(n){let i="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(n.precision)i=`${i}\\.\\d{${n.precision}}`;else if(n.precision==null)i=`${i}(\\.\\d+)?`;return i}function N5(n){return new RegExp(`^${nR(n)}\$`)}function iR(n){let i=`${eM}T${nR(n)}`,o=[];if(o.push(n.local?"Z?":"Z"),n.offset)o.push("([+-]\\d{2}:?\\d{2})");return i=`${i}(${o.join("|")})`,new RegExp(`^${i}\$`)}function D5(n,i){if((i==="v4"||!i)&&j5.test(n))return!0;if((i==="v6"||!i)&&y5.test(n))return!0;return!1}class Mo extends vn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==N.string){let p=this._getOrReturnCtx(n);return B(p,{code:O.invalid_type,expected:N.string,received:p.parsedType}),e}let o=new Xi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.length<p.value)c=this._getOrReturnCtx(n,c),B(c,{code:O.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="max"){if(n.data.length>p.value)c=this._getOrReturnCtx(n,c),B(c,{code:O.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let a=n.data.length>p.value,x=n.data.length<p.value;if(a||x){if(c=this._getOrReturnCtx(n,c),a)B(c,{code:O.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(x)B(c,{code:O.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!_5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"email",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!zv)zv=new RegExp(b5,"u");if(!zv.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"emoji",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!U5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"uuid",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!V5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"nanoid",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!H5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!E5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid2",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!O5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"ulid",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(a){c=this._getOrReturnCtx(n,c),B(c,{validation:"url",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="regex"){if(p.regex.lastIndex=0,!p.regex.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"regex",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="trim")n.data=n.data.trim();else if(p.kind==="includes"){if(!n.data.includes(p.value,p.position))c=this._getOrReturnCtx(n,c),B(c,{code:O.invalid_string,validation:{includes:p.value,position:p.position},message:p.message}),o.dirty()}else if(p.kind==="toLowerCase")n.data=n.data.toLowerCase();else if(p.kind==="toUpperCase")n.data=n.data.toUpperCase();else if(p.kind==="startsWith"){if(!n.data.startsWith(p.value))c=this._getOrReturnCtx(n,c),B(c,{code:O.invalid_string,validation:{startsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="endsWith"){if(!n.data.endsWith(p.value))c=this._getOrReturnCtx(n,c),B(c,{code:O.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!iR(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:O.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!L5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:O.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!N5(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:O.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!u5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"duration",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!D5(n.data,p.version))c=this._getOrReturnCtx(n,c),B(c,{validation:"ip",code:O.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!B5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"base64",code:O.invalid_string,message:p.message}),o.dirty()}else Rn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:O.invalid_string,...t.errToObj(o)})}_addCheck(n){return new Mo({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...t.errToObj(n)})}url(n){return this._addCheck({kind:"url",...t.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...t.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...t.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...t.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...t.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...t.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...t.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...t.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...t.errToObj(n)})}datetime(n){var i,o;if(typeof n==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n});return this._addCheck({kind:"datetime",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,offset:(i=n===null||n===void 0?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(o=n===null||n===void 0?void 0:n.local)!==null&&o!==void 0?o:!1,...t.errToObj(n===null||n===void 0?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){if(typeof n==="string")return this._addCheck({kind:"time",precision:null,message:n});return this._addCheck({kind:"time",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,...t.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...t.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...t.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...t.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...t.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...t.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...t.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...t.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...t.errToObj(i)})}nonempty(n){return this.min(1,t.errToObj(n))}trim(){return new Mo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Mo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Mo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((n)=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find((n)=>n.kind==="date")}get isTime(){return!!this._def.checks.find((n)=>n.kind==="time")}get isDuration(){return!!this._def.checks.find((n)=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find((n)=>n.kind==="email")}get isURL(){return!!this._def.checks.find((n)=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find((n)=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find((n)=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((n)=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((n)=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((n)=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find((n)=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find((n)=>n.kind==="ip")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get minLength(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxLength(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Mo.create=(n)=>{var i;return new Mo({checks:[],typeName:g.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...fn(n)})};function C5(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,a=parseInt(n.toFixed(p).replace(".","")),x=parseInt(i.toFixed(p).replace(".",""));return a%x/Math.pow(10,p)}class Jc extends vn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce)n.data=Number(n.data);if(this._getType(n)!==N.number){let p=this._getOrReturnCtx(n);return B(p,{code:O.invalid_type,expected:N.number,received:p.parsedType}),e}let o=void 0,c=new Xi;for(let p of this._def.checks)if(p.kind==="int"){if(!Rn.isInteger(n.data))o=this._getOrReturnCtx(n,o),B(o,{code:O.invalid_type,expected:"integer",received:"float",message:p.message}),c.dirty()}else if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:O.too_small,minimum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:O.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(C5(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),B(o,{code:O.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else if(p.kind==="finite"){if(!Number.isFinite(n.data))o=this._getOrReturnCtx(n,o),B(o,{code:O.not_finite,message:p.message}),c.dirty()}else Rn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,t.toString(i))}gt(n,i){return this.setLimit("min",n,!1,t.toString(i))}lte(n,i){return this.setLimit("max",n,!0,t.toString(i))}lt(n,i){return this.setLimit("max",n,!1,t.toString(i))}setLimit(n,i,o,c){return new Jc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:t.toString(c)}]})}_addCheck(n){return new Jc({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:t.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:t.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:t.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:t.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:t.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:t.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:t.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:t.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:t.toString(n)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}get isInt(){return!!this._def.checks.find((n)=>n.kind==="int"||n.kind==="multipleOf"&&Rn.isInteger(n.value))}get isFinite(){let n=null,i=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(i===null||o.value>i)i=o.value}else if(o.kind==="max"){if(n===null||o.value<n)n=o.value}return Number.isFinite(i)&&Number.isFinite(n)}}Jc.create=(n)=>{return new Jc({checks:[],typeName:g.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...fn(n)})};class Sc extends vn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)n.data=BigInt(n.data);if(this._getType(n)!==N.bigint){let p=this._getOrReturnCtx(n);return B(p,{code:O.invalid_type,expected:N.bigint,received:p.parsedType}),e}let o=void 0,c=new Xi;for(let p of this._def.checks)if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:O.too_small,type:"bigint",minimum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:O.too_big,type:"bigint",maximum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(n.data%p.value!==BigInt(0))o=this._getOrReturnCtx(n,o),B(o,{code:O.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Rn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,t.toString(i))}gt(n,i){return this.setLimit("min",n,!1,t.toString(i))}lte(n,i){return this.setLimit("max",n,!0,t.toString(i))}lt(n,i){return this.setLimit("max",n,!1,t.toString(i))}setLimit(n,i,o,c){return new Sc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:t.toString(c)}]})}_addCheck(n){return new Sc({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:t.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:t.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:t.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:t.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:t.toString(i)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Sc.create=(n)=>{var i;return new Sc({checks:[],typeName:g.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...fn(n)})};class yp extends vn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==N.boolean){let o=this._getOrReturnCtx(n);return B(o,{code:O.invalid_type,expected:N.boolean,received:o.parsedType}),e}return Ei(n.data)}}yp.create=(n)=>{return new yp({typeName:g.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...fn(n)})};class Lc extends vn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==N.date){let p=this._getOrReturnCtx(n);return B(p,{code:O.invalid_type,expected:N.date,received:p.parsedType}),e}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return B(p,{code:O.invalid_date}),e}let o=new Xi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.getTime()<p.value)c=this._getOrReturnCtx(n,c),B(c,{code:O.too_small,message:p.message,inclusive:!0,exact:!1,minimum:p.value,type:"date"}),o.dirty()}else if(p.kind==="max"){if(n.data.getTime()>p.value)c=this._getOrReturnCtx(n,c),B(c,{code:O.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Rn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Lc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:t.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:t.toString(i)})}get minDate(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n!=null?new Date(n):null}get maxDate(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n!=null?new Date(n):null}}Lc.create=(n)=>{return new Lc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:g.ZodDate,...fn(n)})};class Ia extends vn{_parse(n){if(this._getType(n)!==N.symbol){let o=this._getOrReturnCtx(n);return B(o,{code:O.invalid_type,expected:N.symbol,received:o.parsedType}),e}return Ei(n.data)}}Ia.create=(n)=>{return new Ia({typeName:g.ZodSymbol,...fn(n)})};class Bp extends vn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:O.invalid_type,expected:N.undefined,received:o.parsedType}),e}return Ei(n.data)}}Bp.create=(n)=>{return new Bp({typeName:g.ZodUndefined,...fn(n)})};class Lp extends vn{_parse(n){if(this._getType(n)!==N.null){let o=this._getOrReturnCtx(n);return B(o,{code:O.invalid_type,expected:N.null,received:o.parsedType}),e}return Ei(n.data)}}Lp.create=(n)=>{return new Lp({typeName:g.ZodNull,...fn(n)})};class Nc extends vn{constructor(){super(...arguments);this._any=!0}_parse(n){return Ei(n.data)}}Nc.create=(n)=>{return new Nc({typeName:g.ZodAny,...fn(n)})};class wc extends vn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Ei(n.data)}}wc.create=(n)=>{return new wc({typeName:g.ZodUnknown,...fn(n)})};class Uo extends vn{_parse(n){let i=this._getOrReturnCtx(n);return B(i,{code:O.invalid_type,expected:N.never,received:i.parsedType}),e}}Uo.create=(n)=>{return new Uo({typeName:g.ZodNever,...fn(n)})};class ka extends vn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:O.invalid_type,expected:N.void,received:o.parsedType}),e}return Ei(n.data)}}ka.create=(n)=>{return new ka({typeName:g.ZodVoid,...fn(n)})};class Ro extends vn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==N.array)return B(i,{code:O.invalid_type,expected:N.array,received:i.parsedType}),e;if(c.exactLength!==null){let a=i.data.length>c.exactLength.value,x=i.data.length<c.exactLength.value;if(a||x)B(i,{code:a?O.too_big:O.too_small,minimum:x?c.exactLength.value:void 0,maximum:a?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),o.dirty()}if(c.minLength!==null){if(i.data.length<c.minLength.value)B(i,{code:O.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),o.dirty()}if(c.maxLength!==null){if(i.data.length>c.maxLength.value)B(i,{code:O.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),o.dirty()}if(i.common.async)return Promise.all([...i.data].map((a,x)=>{return c.type._parseAsync(new Ko(i,a,i.path,x))})).then((a)=>{return Xi.mergeArray(o,a)});let p=[...i.data].map((a,x)=>{return c.type._parseSync(new Ko(i,a,i.path,x))});return Xi.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Ro({...this._def,minLength:{value:n,message:t.toString(i)}})}max(n,i){return new Ro({...this._def,maxLength:{value:n,message:t.toString(i)}})}length(n,i){return new Ro({...this._def,exactLength:{value:n,message:t.toString(i)}})}nonempty(n){return this.min(1,n)}}Ro.create=(n,i)=>{return new Ro({type:n,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...fn(i)})};function up(n){if(n instanceof In){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=Wo.create(up(c))}return new In({...n._def,shape:()=>i})}else if(n instanceof Ro)return new Ro({...n._def,type:up(n.element)});else if(n instanceof Wo)return Wo.create(up(n.unwrap()));else if(n instanceof ho)return ho.create(up(n.unwrap()));else if(n instanceof Vo)return Vo.create(n.items.map((i)=>up(i)));else return n}class In extends vn{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let n=this._def.shape(),i=Rn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==N.object){let l=this._getOrReturnCtx(n);return B(l,{code:O.invalid_type,expected:N.object,received:l.parsedType}),e}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:a}=this._getCached(),x=[];if(!(this._def.catchall instanceof Uo&&this._def.unknownKeys==="strip")){for(let l in c.data)if(!a.includes(l))x.push(l)}let m=[];for(let l of a){let f=p[l],v=c.data[l];m.push({key:{status:"valid",value:l},value:f._parse(new Ko(c,v,c.path,l)),alwaysSet:l in c.data})}if(this._def.catchall instanceof Uo){let l=this._def.unknownKeys;if(l==="passthrough")for(let f of x)m.push({key:{status:"valid",value:f},value:{status:"valid",value:c.data[f]}});else if(l==="strict"){if(x.length>0)B(c,{code:O.unrecognized_keys,keys:x}),o.dirty()}else if(l==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let f of x){let v=c.data[f];m.push({key:{status:"valid",value:f},value:l._parse(new Ko(c,v,c.path,f)),alwaysSet:f in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let l=[];for(let f of m){let v=await f.key,$=await f.value;l.push({key:v,value:$,alwaysSet:f.alwaysSet})}return l}).then((l)=>{return Xi.mergeObjectSync(o,l)});else return Xi.mergeObjectSync(o,m)}get shape(){return this._def.shape()}strict(n){return t.errToObj,new In({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,a,x;let m=(a=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&a!==void 0?a:o.defaultError;if(i.code==="unrecognized_keys")return{message:(x=t.errToObj(n).message)!==null&&x!==void 0?x:m};return{message:m}}}:{}})}strip(){return new In({...this._def,unknownKeys:"strip"})}passthrough(){return new In({...this._def,unknownKeys:"passthrough"})}extend(n){return new In({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new In({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:g.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new In({...this._def,catchall:n})}pick(n){let i={};return Rn.objectKeys(n).forEach((o)=>{if(n[o]&&this.shape[o])i[o]=this.shape[o]}),new In({...this._def,shape:()=>i})}omit(n){let i={};return Rn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new In({...this._def,shape:()=>i})}deepPartial(){return up(this)}partial(n){let i={};return Rn.objectKeys(this.shape).forEach((o)=>{let c=this.shape[o];if(n&&!n[o])i[o]=c;else i[o]=c.optional()}),new In({...this._def,shape:()=>i})}required(n){let i={};return Rn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof Wo)p=p._def.innerType;i[o]=p}}),new In({...this._def,shape:()=>i})}keyof(){return oR(Rn.objectKeys(this.shape))}}In.create=(n,i)=>{return new In({shape:()=>n,unknownKeys:"strip",catchall:Uo.create(),typeName:g.ZodObject,...fn(i)})};In.strictCreate=(n,i)=>{return new In({shape:()=>n,unknownKeys:"strict",catchall:Uo.create(),typeName:g.ZodObject,...fn(i)})};In.lazycreate=(n,i)=>{return new In({shape:n,unknownKeys:"strip",catchall:Uo.create(),typeName:g.ZodObject,...fn(i)})};class Np extends vn{_parse(n){let{ctx:i}=this._processInputParams(n),o=this._def.options;function c(p){for(let x of p)if(x.result.status==="valid")return x.result;for(let x of p)if(x.result.status==="dirty")return i.common.issues.push(...x.ctx.common.issues),x.result;let a=p.map((x)=>new Ii(x.ctx.common.issues));return B(i,{code:O.invalid_union,unionErrors:a}),e}if(i.common.async)return Promise.all(o.map(async(p)=>{let a={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:a}),ctx:a}})).then(c);else{let p=void 0,a=[];for(let m of o){let l={...i,common:{...i.common,issues:[]},parent:null},f=m._parseSync({data:i.data,path:i.path,parent:l});if(f.status==="valid")return f;else if(f.status==="dirty"&&!p)p={result:f,ctx:l};if(l.common.issues.length)a.push(l.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let x=a.map((m)=>new Ii(m));return B(i,{code:O.invalid_union,unionErrors:x}),e}}get options(){return this._def.options}}Np.create=(n,i)=>{return new Np({options:n,typeName:g.ZodUnion,...fn(i)})};var Co=(n)=>{if(n instanceof Cp)return Co(n.schema);else if(n instanceof co)return Co(n.innerType());else if(n instanceof hp)return[n.value];else if(n instanceof Ac)return n.options;else if(n instanceof Ip)return Rn.objectValues(n.enum);else if(n instanceof kp)return Co(n._def.innerType);else if(n instanceof Bp)return[void 0];else if(n instanceof Lp)return[null];else if(n instanceof Wo)return[void 0,...Co(n.unwrap())];else if(n instanceof ho)return[null,...Co(n.unwrap())];else if(n instanceof Lm)return Co(n.unwrap());else if(n instanceof Zp)return Co(n.unwrap());else if(n instanceof sp)return Co(n._def.innerType);else return[]};class Bm extends vn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.object)return B(i,{code:O.invalid_type,expected:N.object,received:i.parsedType}),e;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return B(i,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),e;if(i.common.async)return p._parseAsync({data:i.data,path:i.path,parent:i});else return p._parseSync({data:i.data,path:i.path,parent:i})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,o){let c=new Map;for(let p of i){let a=Co(p.shape[n]);if(!a.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let x of a){if(c.has(x))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(x)}`);c.set(x,p)}}return new Bm({typeName:g.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...fn(o)})}}function Ov(n,i){let o=Tc(n),c=Tc(i);if(n===i)return{valid:!0,data:n};else if(o===N.object&&c===N.object){let p=Rn.objectKeys(i),a=Rn.objectKeys(n).filter((m)=>p.indexOf(m)!==-1),x={...n,...i};for(let m of a){let l=Ov(n[m],i[m]);if(!l.valid)return{valid:!1};x[m]=l.data}return{valid:!0,data:x}}else if(o===N.array&&c===N.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let a=0;a<n.length;a++){let x=n[a],m=i[a],l=Ov(x,m);if(!l.valid)return{valid:!1};p.push(l.data)}return{valid:!0,data:p}}else if(o===N.date&&c===N.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class Dp extends vn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,a)=>{if(Hv(p)||Hv(a))return e;let x=Ov(p.value,a.value);if(!x.valid)return B(o,{code:O.invalid_intersection_types}),e;if(Ev(p)||Ev(a))i.dirty();return{status:i.value,value:x.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([p,a])=>c(p,a));else return c(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Dp.create=(n,i,o)=>{return new Dp({left:n,right:i,typeName:g.ZodIntersection,...fn(o)})};class Vo extends vn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.array)return B(o,{code:O.invalid_type,expected:N.array,received:o.parsedType}),e;if(o.data.length<this._def.items.length)return B(o,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e;if(!this._def.rest&&o.data.length>this._def.items.length)B(o,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((a,x)=>{let m=this._def.items[x]||this._def.rest;if(!m)return null;return m._parse(new Ko(o,a,o.path,x))}).filter((a)=>!!a);if(o.common.async)return Promise.all(p).then((a)=>{return Xi.mergeArray(i,a)});else return Xi.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new Vo({...this._def,rest:n})}}Vo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vo({items:n,typeName:g.ZodTuple,rest:null,...fn(i)})};class sa extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.object)return B(o,{code:O.invalid_type,expected:N.object,received:o.parsedType}),e;let c=[],p=this._def.keyType,a=this._def.valueType;for(let x in o.data)c.push({key:p._parse(new Ko(o,x,o.path,x)),value:a._parse(new Ko(o,o.data[x],o.path,x)),alwaysSet:x in o.data});if(o.common.async)return Xi.mergeObjectAsync(i,c);else return Xi.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof vn)return new sa({keyType:n,valueType:i,typeName:g.ZodRecord,...fn(o)});return new sa({keyType:Mo.create(),valueType:n,typeName:g.ZodRecord,...fn(i)})}}class Za extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.map)return B(o,{code:O.invalid_type,expected:N.map,received:o.parsedType}),e;let c=this._def.keyType,p=this._def.valueType,a=[...o.data.entries()].map(([x,m],l)=>{return{key:c._parse(new Ko(o,x,o.path,[l,"key"])),value:p._parse(new Ko(o,m,o.path,[l,"value"]))}});if(o.common.async){let x=new Map;return Promise.resolve().then(async()=>{for(let m of a){let l=await m.key,f=await m.value;if(l.status==="aborted"||f.status==="aborted")return e;if(l.status==="dirty"||f.status==="dirty")i.dirty();x.set(l.value,f.value)}return{status:i.value,value:x}})}else{let x=new Map;for(let m of a){let{key:l,value:f}=m;if(l.status==="aborted"||f.status==="aborted")return e;if(l.status==="dirty"||f.status==="dirty")i.dirty();x.set(l.value,f.value)}return{status:i.value,value:x}}}}Za.create=(n,i,o)=>{return new Za({valueType:i,keyType:n,typeName:g.ZodMap,...fn(o)})};class Dc extends vn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.set)return B(o,{code:O.invalid_type,expected:N.set,received:o.parsedType}),e;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)B(o,{code:O.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()}if(c.maxSize!==null){if(o.data.size>c.maxSize.value)B(o,{code:O.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function a(m){let l=new Set;for(let f of m){if(f.status==="aborted")return e;if(f.status==="dirty")i.dirty();l.add(f.value)}return{status:i.value,value:l}}let x=[...o.data.values()].map((m,l)=>p._parse(new Ko(o,m,o.path,l)));if(o.common.async)return Promise.all(x).then((m)=>a(m));else return a(x)}min(n,i){return new Dc({...this._def,minSize:{value:n,message:t.toString(i)}})}max(n,i){return new Dc({...this._def,maxSize:{value:n,message:t.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Dc.create=(n,i)=>{return new Dc({valueType:n,minSize:null,maxSize:null,typeName:g.ZodSet,...fn(i)})};class bp extends vn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.function)return B(i,{code:O.invalid_type,expected:N.function,received:i.parsedType}),e;function o(x,m){return jm({data:x,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,bm(),jp].filter((l)=>!!l),issueData:{code:O.invalid_arguments,argumentsError:m}})}function c(x,m){return jm({data:x,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,bm(),jp].filter((l)=>!!l),issueData:{code:O.invalid_return_type,returnTypeError:m}})}let p={errorMap:i.common.contextualErrorMap},a=i.data;if(this._def.returns instanceof Cc){let x=this;return Ei(async function(...m){let l=new Ii([]),f=await x._def.args.parseAsync(m,p).catch((T)=>{throw l.addIssue(o(m,T)),l}),v=await Reflect.apply(a,this,f);return await x._def.returns._def.type.parseAsync(v,p).catch((T)=>{throw l.addIssue(c(v,T)),l})})}else{let x=this;return Ei(function(...m){let l=x._def.args.safeParse(m,p);if(!l.success)throw new Ii([o(m,l.error)]);let f=Reflect.apply(a,this,l.data),v=x._def.returns.safeParse(f,p);if(!v.success)throw new Ii([c(f,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new bp({...this._def,args:Vo.create(n).rest(wc.create())})}returns(n){return new bp({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new bp({args:n?n:Vo.create([]).rest(wc.create()),returns:i||wc.create(),typeName:g.ZodFunction,...fn(o)})}}class Cp extends vn{get schema(){return this._def.getter()}_parse(n){let{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Cp.create=(n,i)=>{return new Cp({getter:n,typeName:g.ZodLazy,...fn(i)})};class hp extends vn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return B(i,{received:i.data,code:O.invalid_literal,expected:this._def.value}),e}return{status:"valid",value:n.data}}get value(){return this._def.value}}hp.create=(n,i)=>{return new hp({value:n,typeName:g.ZodLiteral,...fn(i)})};function oR(n,i){return new Ac({values:n,typeName:g.ZodEnum,...fn(i)})}class Ac extends vn{constructor(){super(...arguments);Na.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{expected:Rn.joinValues(o),received:i.parsedType,code:O.invalid_type}),e}if(!ym(this,Na,"f"))dM(this,Na,new Set(this._def.values),"f");if(!ym(this,Na,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{received:i.data,code:O.invalid_enum_value,options:o}),e}return Ei(n.data)}get options(){return this._def.values}get enum(){let n={};for(let i of this._def.values)n[i]=i;return n}get Values(){let n={};for(let i of this._def.values)n[i]=i;return n}get Enum(){let n={};for(let i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return Ac.create(n,{...this._def,...i})}exclude(n,i=this._def){return Ac.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}Na=new WeakMap;Ac.create=oR;class Ip extends vn{constructor(){super(...arguments);Da.set(this,void 0)}_parse(n){let i=Rn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==N.string&&o.parsedType!==N.number){let c=Rn.objectValues(i);return B(o,{expected:Rn.joinValues(c),received:o.parsedType,code:O.invalid_type}),e}if(!ym(this,Da,"f"))dM(this,Da,new Set(Rn.getValidEnumValues(this._def.values)),"f");if(!ym(this,Da,"f").has(n.data)){let c=Rn.objectValues(i);return B(o,{received:o.data,code:O.invalid_enum_value,options:c}),e}return Ei(n.data)}get enum(){return this._def.values}}Da=new WeakMap;Ip.create=(n,i)=>{return new Ip({values:n,typeName:g.ZodNativeEnum,...fn(i)})};class Cc extends vn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.promise&&i.common.async===!1)return B(i,{code:O.invalid_type,expected:N.promise,received:i.parsedType}),e;let o=i.parsedType===N.promise?i.data:Promise.resolve(i.data);return Ei(o.then((c)=>{return this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}Cc.create=(n,i)=>{return new Cc({type:n,typeName:g.ZodPromise,...fn(i)})};class co extends vn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=this._def.effect||null,p={addIssue:(a)=>{if(B(o,a),a.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let a=c.transform(o.data,p);if(o.common.async)return Promise.resolve(a).then(async(x)=>{if(i.value==="aborted")return e;let m=await this._def.schema._parseAsync({data:x,path:o.path,parent:o});if(m.status==="aborted")return e;if(m.status==="dirty")return _p(m.value);if(i.value==="dirty")return _p(m.value);return m});else{if(i.value==="aborted")return e;let x=this._def.schema._parseSync({data:a,path:o.path,parent:o});if(x.status==="aborted")return e;if(x.status==="dirty")return _p(x.value);if(i.value==="dirty")return _p(x.value);return x}}if(c.type==="refinement"){let a=(x)=>{let m=c.refinement(x,p);if(o.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return x};if(o.common.async===!1){let x=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(x.status==="aborted")return e;if(x.status==="dirty")i.dirty();return a(x.value),{status:i.value,value:x.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((x)=>{if(x.status==="aborted")return e;if(x.status==="dirty")i.dirty();return a(x.value).then(()=>{return{status:i.value,value:x.value}})})}if(c.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Ca(a))return a;let x=c.transform(a.value,p);if(x instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:x}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((a)=>{if(!Ca(a))return a;return Promise.resolve(c.transform(a.value,p)).then((x)=>({status:i.value,value:x}))});Rn.assertNever(c)}}co.create=(n,i,o)=>{return new co({schema:n,typeName:g.ZodEffects,effect:i,...fn(o)})};co.createWithPreprocess=(n,i,o)=>{return new co({schema:i,effect:{type:"preprocess",transform:n},typeName:g.ZodEffects,...fn(o)})};class Wo extends vn{_parse(n){if(this._getType(n)===N.undefined)return Ei(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Wo.create=(n,i)=>{return new Wo({innerType:n,typeName:g.ZodOptional,...fn(i)})};class ho extends vn{_parse(n){if(this._getType(n)===N.null)return Ei(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ho.create=(n,i)=>{return new ho({innerType:n,typeName:g.ZodNullable,...fn(i)})};class kp extends vn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===N.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}kp.create=(n,i)=>{return new kp({innerType:n,typeName:g.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...fn(i)})};class sp extends vn{_parse(n){let{ctx:i}=this._processInputParams(n),o={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(ha(c))return c.then((p)=>{return{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new Ii(o.common.issues)},input:o.data})}});else return{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Ii(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}sp.create=(n,i)=>{return new sp({innerType:n,typeName:g.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...fn(i)})};class ta extends vn{_parse(n){if(this._getType(n)!==N.nan){let o=this._getOrReturnCtx(n);return B(o,{code:O.invalid_type,expected:N.nan,received:o.parsedType}),e}return{status:"valid",value:n.data}}}ta.create=(n)=>{return new ta({typeName:g.ZodNaN,...fn(n)})};var h5=Symbol("zod_brand");class Lm extends vn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;return this._def.type._parse({data:o,path:i.path,parent:i})}unwrap(){return this._def.type}}class qa extends vn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{let p=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(p.status==="aborted")return e;if(p.status==="dirty")return i.dirty(),_p(p.value);else return this._def.out._parseAsync({data:p.value,path:o.path,parent:o})})();else{let c=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(c.status==="aborted")return e;if(c.status==="dirty")return i.dirty(),{status:"dirty",value:c.value};else return this._def.out._parseSync({data:c.value,path:o.path,parent:o})}}static create(n,i){return new qa({in:n,out:i,typeName:g.ZodPipeline})}}class Zp extends vn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Ca(c))c.value=Object.freeze(c.value);return c};return ha(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}Zp.create=(n,i)=>{return new Zp({innerType:n,typeName:g.ZodReadonly,...fn(i)})};function cR(n,i={},o){if(n)return Nc.create().superRefine((c,p)=>{var a,x;if(!n(c)){let m=typeof i==="function"?i(c):typeof i==="string"?{message:i}:i,l=(x=(a=m.fatal)!==null&&a!==void 0?a:o)!==null&&x!==void 0?x:!0,f=typeof m==="string"?{message:m}:m;p.addIssue({code:"custom",...f,fatal:l})}});return Nc.create()}var I5={object:In.lazycreate},g;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(g||(g={}));var k5=(n,i={message:`Input not instance of ${n.name}`})=>cR((o)=>o instanceof n,i),pR=Mo.create,aR=Jc.create,s5=ta.create,Z5=Sc.create,xR=yp.create,t5=Lc.create,q5=Ia.create,P5=Bp.create,r5=Lp.create,g5=Nc.create,d5=wc.create,e5=Uo.create,n9=ka.create,i9=Ro.create,Pa=In.create,o9=In.strictCreate,c9=Np.create,p9=Bm.create,a9=Dp.create,x9=Vo.create,m9=sa.create,l9=Za.create,f9=Dc.create,v9=bp.create,$9=Cp.create,T9=hp.create,w9=Ac.create,J9=Ip.create,S9=Cc.create,rM=co.create,A9=Wo.create,F9=ho.create,M9=co.createWithPreprocess,R9=qa.create,W9=()=>pR().optional(),K9=()=>aR().optional(),X9=()=>xR().optional(),G9={string:(n)=>Mo.create({...n,coerce:!0}),number:(n)=>Jc.create({...n,coerce:!0}),boolean:(n)=>yp.create({...n,coerce:!0}),bigint:(n)=>Sc.create({...n,coerce:!0}),date:(n)=>Lc.create({...n,coerce:!0})},Y9=e,Gn=Object.freeze({__proto__:null,defaultErrorMap:jp,setErrorMap:z5,getErrorMap:bm,makeIssue:jm,EMPTY_PATH:Q5,addIssueToContext:B,ParseStatus:Xi,INVALID:e,DIRTY:_p,OK:Ei,isAborted:Hv,isDirty:Ev,isValid:Ca,isAsync:ha,get util(){return Rn},get objectUtil(){return Qv},ZodParsedType:N,getParsedType:Tc,ZodType:vn,datetimeRegex:iR,ZodString:Mo,ZodNumber:Jc,ZodBigInt:Sc,ZodBoolean:yp,ZodDate:Lc,ZodSymbol:Ia,ZodUndefined:Bp,ZodNull:Lp,ZodAny:Nc,ZodUnknown:wc,ZodNever:Uo,ZodVoid:ka,ZodArray:Ro,ZodObject:In,ZodUnion:Np,ZodDiscriminatedUnion:Bm,ZodIntersection:Dp,ZodTuple:Vo,ZodRecord:sa,ZodMap:Za,ZodSet:Dc,ZodFunction:bp,ZodLazy:Cp,ZodLiteral:hp,ZodEnum:Ac,ZodNativeEnum:Ip,ZodPromise:Cc,ZodEffects:co,ZodTransformer:co,ZodOptional:Wo,ZodNullable:ho,ZodDefault:kp,ZodCatch:sp,ZodNaN:ta,BRAND:h5,ZodBranded:Lm,ZodPipeline:qa,ZodReadonly:Zp,custom:cR,Schema:vn,ZodSchema:vn,late:I5,get ZodFirstPartyTypeKind(){return g},coerce:G9,any:g5,array:i9,bigint:Z5,boolean:xR,date:t5,discriminatedUnion:p9,effect:rM,enum:w9,function:v9,instanceof:k5,intersection:a9,lazy:$9,literal:T9,map:l9,nan:s5,nativeEnum:J9,never:e5,null:r5,nullable:F9,number:aR,object:Pa,oboolean:X9,onumber:K9,optional:A9,ostring:W9,pipeline:R9,preprocess:M9,promise:S9,record:m9,set:f9,strictObject:o9,string:pR,symbol:q5,transformer:rM,tuple:x9,undefined:P5,union:c9,unknown:d5,void:n9,NEVER:Y9,ZodIssueCode:O,quotelessJson:Y5,ZodError:Ii});function mR(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[K,E]of Object.entries(i))if(E==="")delete i[K]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},a=typeof n.server==="object"?n.server:{},x=typeof n.shared==="object"?n.shared:{},m=Pa(p),l=Pa(a),f=Pa(x),v=n.isServer??(typeof window==="undefined"||("Deno"in window)),$=m.merge(f),T=l.merge(f).merge(m),F=v?T.safeParse(i):$.safeParse(i),M=n.onValidationError??((K)=>{throw console.error("\u274C Invalid environment variables:",K.flatten().fieldErrors),new Error("Invalid environment variables")}),A=n.onInvalidAccess??((K)=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(F.success===!1)return M(F.error);let R=(K)=>{if(!n.clientPrefix)return!0;return!K.startsWith(n.clientPrefix)&&!(K in f.shape)},G=(K)=>{return v||!R(K)},Q=(K)=>{return K==="__esModule"||K==="$$typeof"},b=(n.extends??[]).reduce((K,E)=>{return Object.assign(K,E)},{}),D=Object.assign(F.data,b);return new Proxy(D,{get(K,E){if(typeof E!=="string")return;if(Q(E))return;if(!G(E))return A(E);return Reflect.get(K,E)}})}var z9="__vite_start_time"in globalThis,Q9=typeof window!=="undefined",xN="vitest"in globalThis,rn=mR({isServer:!z9&&!Q9,server:{CI:Gn.string().transform((n)=>!0).optional(),POSTGRES_USER:Gn.string(),POSTGRES_PASSWORD:Gn.string(),POSTGRES_DATABASE:Gn.string(),POSTGRES_HOST:Gn.string(),POSTGRES_PORT:Gn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Gn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Gn.union([Gn.literal("true"),Gn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Gn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Gn.string().transform((n)=>JSON.parse(n)).pipe(Gn.array(Gn.string())),OPENAI_API_KEY:Gn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Gn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Gn.union([Gn.literal("true"),Gn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var fR=Uv(import.meta.dirname,"../dev"),Vv=rn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:lR(Uv(fR,"./cert.pem"),"utf-8"),key:lR(Uv(fR,"./key.pem"),"utf-8")}:void 0;var hc=new Ul,Wn=rn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:hc.logger;nn.STORE.loggers[0]=new Rc("warn",void 0,Wn);import{spawn as H9}from"child_process";import{resolve as E9}from"path";function uv(n,i,o=n.logger){let c=rn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",x=[E9(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")x.push("--experimental-strip-types");let m=H9(p,x);return new Ja(m,i,o)}var vR=fl(vf(),1);var O9=604800000,Nm=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new vR.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[a,x]of c.entries())if(p-x>O9)c.delete(a);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),Wn.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import KG from"path";import e9 from"os";import nG from"fs";var Dm=new Map,_v=new Map,bv=Symbol("OriginError"),tp={};class po extends Promise{constructor(n,i,o,c,p={}){let a,x;super((m,l)=>{a=m,x=l});this.tagged=Array.isArray(n.raw),this.strings=n,this.args=i,this.handler=o,this.canceller=c,this.options=p,this.state=null,this.statement=null,this.resolve=(m)=>(this.active=!1,a(m)),this.reject=(m)=>(this.active=!1,x(m)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[bv]=this.handler.debug?new Error:this.tagged&&U9(this.strings)}get origin(){return(this.handler.debug?this[bv].stack:this.tagged&&_v.has(this.strings)?_v.get(this.strings):_v.set(this.strings,this[bv].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(n=1,i){if(this.options.simple=!1,typeof n==="function")i=n,n=1;if(this.cursorRows=n,typeof i==="function")return this.cursorFn=i,this;let o;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};o&&o();let c=new Promise((p,a)=>{this.cursorFn=(x)=>{return p({value:x,done:!1}),new Promise((m)=>o=m)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(x)=>(this.active=!1,a(x))});return this.execute(),c},return(){return o&&o(tp),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw new Error(".stream has been renamed to .forEach")}forEach(n){return this.forEachFn=n,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function U9(n){if(Dm.has(n))return Dm.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,Dm.set(n,new Error),Error.stackTraceLimit=i,Dm.get(n)}class qp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var en={connection:$R,postgres:TR,generic:wR,notSupported:JR};function $R(n,i,o){let{host:c,port:p}=o||i,a=Object.assign(new Error("write "+n+" "+(i.path||c+":"+p)),{code:n,errno:n,address:i.path||c},i.path?{}:{port:p});return Error.captureStackTrace(a,$R),a}function TR(n){let i=new qp(n);return Error.captureStackTrace(i,TR),i}function wR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,wR),o}function JR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,JR),i}var V9={string:{to:25,from:null,serialize:(n)=>""+n},number:{to:0,from:[21,23,26,700,701],serialize:(n)=>""+n,parse:(n)=>+n},json:{to:114,from:[114,3802],serialize:(n)=>JSON.stringify(n),parse:(n)=>JSON.parse(n)},boolean:{to:16,from:16,serialize:(n)=>n===!0?"t":"f",parse:(n)=>n==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(n)=>(n instanceof Date?n:new Date(n)).toISOString(),parse:(n)=>new Date(n)},bytea:{to:17,from:17,serialize:(n)=>"\\x"+Buffer.from(n).toString("hex"),parse:(n)=>Buffer.from(n.slice(2),"hex")}};class Im{then(){jv()}catch(){jv()}finally(){jv()}}class ea extends Im{constructor(n){super();this.value=Zm(n)}}class uo extends Im{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class km extends Im{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=u9.map(([a,x])=>({fn:x,i:n.search(a)})).sort((a,x)=>a.i-x.i).pop();return p.i===-1?Dv(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function sm(n,i,o,c){let p=n instanceof uo?n.value:n;if(p===void 0){if(n instanceof uo?n.value=c.transform.undefined:p=n=c.transform.undefined,p===void 0)throw en.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof uo?(i.push(n.value),n.array?n.array[n.type||hm(n.value)]||n.type||MR(n.value):n.type):(i.push(n),hm(n)))}var AR=WR(V9);function Lv(n,i,o,c,p,a){for(let x=1;x<n.strings.length;x++)i+=Nv(i,o,c,p,a)+n.strings[x],o=n.args[x];return i}function Nv(n,i,o,c,p){return i instanceof km?i.build(n,o,c,p):i instanceof po?Bv(i,o,c,p):i instanceof ea?i.value:i&&i[0]instanceof po?i.reduce((a,x)=>a+" "+Bv(x,o,c,p),""):sm(i,o,c,p)}function Bv(n,i,o,c){return n.fragment=!0,Lv(n,n.strings[0],n.args[0],i,o,c)}function FR(n,i,o,c,p){return n.map((a)=>"("+c.map((x)=>Nv("values",a[x],i,o,p)).join(",")+")").join(",")}function SR(n,i,o,c,p){let a=Array.isArray(n[0]),x=i.length?i.flat():Object.keys(a?n[0]:n);return FR(a?n:[n],o,c,x,p)}function Cm(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return Dv(n,p);let a;return(i.length?i.flat():Object.keys(n)).map((m)=>{return a=n[m],(a instanceof po?Bv(a,o,c,p):a instanceof ea?a.value:sm(a,o,c,p))+" as "+Zm(p.transform.column.to?p.transform.column.to(m):m)}).join(",")}var u9=Object.entries({values:SR,in:(...n)=>{let i=SR(...n);return i==="()"?"(null)":i},select:Cm,as:Cm,returning:Cm,"\\(":Cm,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((a)=>Zm(p.transform.column.to?p.transform.column.to(a):a)+"="+Nv("values",n[a],o,c,p))},insert(n,i,o,c,p){let a=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+Dv(a,p)+")values"+FR(Array.isArray(n)?n:[n],o,c,a,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function jv(){throw en.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:_9,parsers:b9}=AR;function MR(n){if(Array.isArray(n))return MR(n[0]);return typeof n==="string"?1009:0}var RR=function(n){let i=WR(n||{});return{serializers:Object.assign({},_9,i.serializers),parsers:Object.assign({},b9,i.parsers)}};function WR(n){return Object.keys(n).reduce((i,o)=>{if(n[o].from&&[].concat(n[o].from).forEach((c)=>i.parsers[c]=n[o].parse),n[o].serialize)i.serializers[n[o].to]=n[o].serialize,n[o].from&&[].concat(n[o].from).forEach((c)=>i.serializers[c]=n[o].serialize);return i},{parsers:{},serializers:{}})}function Dv(n,{transform:{column:i}}){return n.map((o)=>Zm(i.to?i.to(o):o)).join(",")}var Zm=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},hm=function n(i){return i instanceof uo?i.type:i instanceof Date?1184:i instanceof Uint8Array?17:i===!0||i===!1?16:typeof i==="bigint"?20:Array.isArray(i)?n(i[0]):0},j9=/\\/g,y9=/"/g;function B9(n){return n.replace(j9,"\\\\").replace(y9,'\\"')}var KR=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let a=i[0],x=p===1020?";":",";if(Array.isArray(a)&&!a.type)return"{"+i.map((m)=>n(m,o,c,p)).join(x)+"}";return"{"+i.map((m)=>{if(m===void 0){if(m=c.transform.undefined,m===void 0)throw en.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return m===null?"null":'"'+B9(o?o(m.type?m.value:m):""+m)+'"'}).join(x)+"}"},yv={i:0,char:null,str:"",quoted:!1,last:0},XR=function n(i,o,c){return yv.i=yv.last=0,GR(yv,i,o,c)};function GR(n,i,o,c){let p=[],a=c===1020?";":",";for(;n.i<i.length;n.i++){if(n.char=i[n.i],n.quoted)if(n.char==="\\")n.str+=i[++n.i];else if(n.char==='"')p.push(o?o(n.str):n.str),n.str="",n.quoted=i[n.i+1]==='"',n.last=n.i+2;else n.str+=n.char;else if(n.char==='"')n.quoted=!0;else if(n.char==="{")n.last=++n.i,p.push(GR(n,i,o,c));else if(n.char==="}"){n.quoted=!1,n.last<n.i&&p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;break}else if(n.char===a&&n.p!=="}"&&n.p!=='"')p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;n.p=n.char}return n.last<n.i&&p.push(o?o(i.slice(n.last,n.i+1)):i.slice(n.last,n.i+1)),p}var Ic=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},kc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},sc=(n)=>n.replace(/_/g,"-"),ra=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),ga=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),da=(n)=>n.replace(/-/g,"_");function Cv(n){return function i(o,c){return typeof o==="object"&&o!==null&&(c.type===114||c.type===3802)?Array.isArray(o)?o.map((p)=>i(p,c)):Object.entries(o).reduce((p,[a,x])=>Object.assign(p,{[n(a)]:i(x,c)}),{}):o}}Ic.column={from:Ic};Ic.value={from:Cv(Ic)};ra.column={to:ra};var hv={...Ic};hv.column.to=ra;kc.column={from:kc};kc.value={from:Cv(kc)};ga.column={to:ga};var Iv={...kc};Iv.column.to=ga;sc.column={from:sc};sc.value={from:Cv(sc)};da.column={to:da};var kv={...sc};kv.column.to=da;import YR from"net";import C9 from"tls";import nx from"crypto";import sv from"stream";import{performance as zR}from"perf_hooks";class Zc extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var ki=L9;function L9(n=[]){let i=n.slice(),o=0;return{get length(){return i.length-o},remove:(c)=>{let p=i.indexOf(c);return p===-1?null:(i.splice(p,1),c)},push:(c)=>(i.push(c),c),shift:()=>{let c=i[o++];if(o===i.length)o=0,i=[];else i[o-1]=void 0;return c}}}var Gi=Buffer.allocUnsafe(256),N9="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return Gi[0]=o,On.i=5,On},n},{}),On=Object.assign(D9,N9,{N:String.fromCharCode(0),i:0,inc(n){return On.i+=n,On},str(n){let i=Buffer.byteLength(n);return tm(i),On.i+=Gi.write(n,On.i,i,"utf8"),On},i16(n){return tm(2),Gi.writeUInt16BE(n,On.i),On.i+=2,On},i32(n,i){if(i||i===0)return Gi.writeUInt32BE(n,i),On;return tm(4),Gi.writeUInt32BE(n,On.i),On.i+=4,On},z(n){return tm(n),Gi.fill(0,On.i,On.i+n),On.i+=n,On},raw(n){return Gi=Buffer.concat([Gi.subarray(0,On.i),n]),On.i=Gi.length,On},end(n=1){Gi.writeUInt32BE(On.i-n,n);let i=Gi.subarray(0,On.i);return On.i=0,Gi=Buffer.allocUnsafe(256),i}}),q=On;function tm(n){if(Gi.length-On.i<n){let i=Gi,o=i.length;Gi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(Gi)}}function D9(){return On.i=0,On}var qv=ER,h9=1,Fc=q().S().end(),QR=q().H().end(),I9=q().i32(8).i32(80877103).end(8),k9=Buffer.concat([q().E().str(q.N).i32(0).end(),Fc]),s9=q().D().str("S").str(q.N).end(),Pp=()=>{},Z9=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),t9={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function ER(n,i={},{onopen:o=Pp,onend:c=Pp,onclose:p=Pp}={}){let{ssl:a,max:x,user:m,host:l,port:f,database:v,parsers:$,transform:T,onnotice:F,onnotify:M,onparameter:A,max_pipeline:R,keep_alive:G,backoff:Q,target_session_attrs:b}=n,D=ki(),Y=h9++,K={pid:null,secret:null},E=tv(xl,n.idle_timeout),y=tv(xl,n.max_lifetime),V=tv(m4,n.connect_timeout),X=null,Z,C=new Zc,on=Buffer.alloc(0),mn=n.fetch_types,ln={},Vn={},ji=Math.random().toString(36).slice(2),H=1,s=0,wn=0,Yn=0,ni=0,Tn=0,un=0,gn=0,Dn=null,jn=null,$i=!1,_n=null,ao=null,Ti=null,Io=null,ii=null,yn=null,xo=null,Go=null,_=null,na=null,wi={queue:i.closed,idleTimer:E,connect(w){Ti=w||!0,X$()},terminate:oa,execute:ia,cancel:c4,end:xl,count:0,id:Y};return i.closed&&i.closed.push(wi),wi;async function o4(){let w;try{w=n.socket?await Promise.resolve(n.socket(n)):new YR.Socket}catch(W){rc(W);return}return w.on("error",rc),w.on("close",G$),w.on("drain",W$),w}async function c4({pid:w,secret:W},P,Kn){try{Z=q().i32(16).i32(80877102).i32(w).i32(W).end(16),await K$(),X.once("error",Kn),X.once("close",P)}catch(kn){Kn(kn)}}function ia(w){if($i)return xx(w,en.connection("CONNECTION_DESTROYED",n));if(w.cancelled)return;try{return w.state=K,_?D.push(w):(_=w,_.active=!0),x4(w),mi(p4(w))&&!w.describeFirst&&!w.cursorFn&&D.length<R&&(!w.options.onexecute||w.options.onexecute(wi))}catch(W){return D.length===0&&mi(Fc),Yo(W),!0}}function p4(w){if(w.parameters.length>=65534)throw en.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return w.options.simple?q().Q().str(w.statement.string+q.N).end():w.describeFirst?Buffer.concat([F$(w),QR]):w.prepare?w.prepared?ax(w):Buffer.concat([F$(w),ax(w)]):a4(w)}function F$(w){return Buffer.concat([z$(w.statement.string,w.parameters,w.statement.types,w.statement.name),s4("S",w.statement.name)])}function ax(w){return Buffer.concat([k4(w.parameters,w.statement.types,w.statement.name,w.cursorName),w.cursorFn?Q$("",w.cursorRows):k9])}function a4(w){return Buffer.concat([z$(w.statement.string,w.parameters,w.statement.types),s9,ax(w)])}function x4(w){let W=[],P=[],Kn=Lv(w,w.strings[0],w.args[0],W,P,n);!w.tagged&&w.args.forEach((kn)=>sm(kn,W,P,n)),w.prepare=n.prepare&&("prepare"in w.options?w.options.prepare:!0),w.string=Kn,w.signature=w.prepare&&P+Kn,w.onlyDescribe&&delete Vn[w.signature],w.parameters=w.parameters||W,w.prepared=w.prepare&&w.signature in Vn,w.describeFirst=w.onlyDescribe||W.length&&!w.prepared,w.statement=w.prepared?Vn[w.signature]:{string:Kn,types:P,name:w.prepare?ji+H++:""},typeof n.debug==="function"&&n.debug(Y,Kn,W,P)}function mi(w,W){if(yn=yn?Buffer.concat([yn,w]):Buffer.from(w),W||yn.length>=1024)return M$(W);return jn===null&&(jn=setImmediate(M$)),!0}function M$(w){let W=X.write(yn,w);return jn!==null&&clearImmediate(jn),yn=jn=null,W}function m4(){Yo(en.connection("CONNECT_TIMEOUT",n,X)),X.destroy()}async function R$(){if(mi(I9),!await new Promise((W)=>X.once("data",(P)=>W(P[0]===83)))&&a==="prefer")return Pc();X.removeAllListeners(),X=C9.connect({socket:X,servername:YR.isIP(X.host)?void 0:X.host,...a==="require"||a==="allow"||a==="prefer"?{rejectUnauthorized:!1}:a==="verify-full"?{}:typeof a==="object"?a:{}}),X.on("secureConnect",Pc),X.on("error",rc),X.on("close",G$),X.on("drain",W$)}function W$(){!_&&o(wi)}function al(w){if(_n){if(_n.push(w),wn-=w.length,wn>=0)return}on=_n?Buffer.concat(_n,Tn-wn):on.length===0?w:Buffer.concat([on,w],on.length+w.length);while(on.length>4){if(Tn=on.readUInt32BE(1),Tn>=on.length){wn=Tn-on.length,_n=[on];break}try{l4(on.subarray(0,Tn+1))}catch(W){_&&(_.cursorFn||_.describeFirst)&&mi(Fc),Yo(W)}on=on.subarray(Tn+1),wn=0,_n=null}}async function K$(){if($i=!1,ln={},X||(X=await o4()),!X)return;if(V.start(),n.socket)return a?R$():Pc();if(X.on("connect",a?R$:Pc),n.path)return X.connect(n.path);X.ssl=a,X.connect(f[Yn],l[Yn]),X.host=l[Yn],X.port=f[Yn],Yn=(Yn+1)%f.length}function X$(){setTimeout(K$,s?s+un-zR.now():0)}function Pc(){try{Vn={},mn=n.fetch_types,ji=Math.random().toString(36).slice(2),H=1,y.start(),X.on("data",al),G&&X.setKeepAlive&&X.setKeepAlive(!0,1000*G);let w=t4();mi(w)}catch(w){rc(w)}}function rc(w){if(wi.queue===i.connecting&&n.host[ni+1])return;Yo(w);while(D.length)xx(D.shift(),w)}function Yo(w){ii&&(ii.destroy(w),ii=null),_&&xx(_,w),Ti&&(xx(Ti,w),Ti=null)}function xx(w,W){"query"in W||"parameters"in W||Object.defineProperties(W,{stack:{value:W.stack+w.origin.replace(/.*\n/,"\n"),enumerable:n.debug},query:{value:w.string,enumerable:n.debug},parameters:{value:w.parameters,enumerable:n.debug},args:{value:w.args,enumerable:n.debug},types:{value:w.statement&&w.statement.types,enumerable:n.debug}}),w.reject(W)}function xl(){return Io||(!wi.reserved&&c(wi),!wi.reserved&&!Ti&&!_&&D.length===0?(oa(),new Promise((w)=>X&&X.readyState!=="closed"?X.once("close",w):w())):Io=new Promise((w)=>xo=w))}function oa(){if($i=!0,ii||_||Ti||D.length)rc(en.connection("CONNECTION_DESTROYED",n));if(clearImmediate(jn),X)X.removeListener("data",al),X.removeListener("connect",Pc),X.readyState==="open"&&X.end(q().X().end());xo&&(xo(),Io=xo=null)}async function G$(w){if(on=Buffer.alloc(0),wn=0,_n=null,clearImmediate(jn),X.removeListener("data",al),X.removeListener("connect",Pc),E.cancel(),y.cancel(),V.cancel(),X.removeAllListeners(),X=null,Ti)return X$();!w&&(_||D.length)&&rc(en.connection("CONNECTION_CLOSED",n,X)),s=zR.now(),w&&n.shared.retries++,un=(typeof Q==="function"?Q(n.shared.retries):Q)*1000,p(wi,en.connection("CONNECTION_CLOSED",n,X))}function l4(w,W=w[0]){(W===68?f4:W===100?y4:W===65?U4:W===83?v4:W===90?$4:W===67?T4:W===50?Y$:W===49?w4:W===116?J4:W===84?S4:W===82?A4:W===110?X4:W===75?G4:W===69?E4:W===115?V4:W===51?u4:W===71?_4:W===78?L4:W===72?b4:W===99?B4:W===73?N4:W===86?D4:W===118?C4:W===87?j4:h4)(w)}function f4(w){let W=7,P,Kn,kn,Ji=_.isRaw?new Array(_.statement.columns.length):{};for(let Yi=0;Yi<_.statement.columns.length;Yi++)Kn=_.statement.columns[Yi],P=w.readInt32BE(W),W+=4,kn=P===-1?null:_.isRaw===!0?w.subarray(W,W+=P):Kn.parser===void 0?w.toString("utf8",W,W+=P):Kn.parser.array===!0?Kn.parser(w.toString("utf8",W+1,W+=P)):Kn.parser(w.toString("utf8",W,W+=P)),_.isRaw?Ji[Yi]=_.isRaw===!0?kn:T.value.from?T.value.from(kn,Kn):kn:Ji[Kn.name]=T.value.from?T.value.from(kn,Kn):kn;_.forEachFn?_.forEachFn(T.row.from?T.row.from(Ji):Ji,C):C[gn++]=T.row.from?T.row.from(Ji):Ji}function v4(w){let[W,P]=w.toString("utf8",5,w.length-1).split(q.N);if(ln[W]=P,n.parameters[W]!==P)n.parameters[W]=P,A&&A(W,P)}function $4(w){if(_&&_.options.simple&&_.resolve(ao||C),_=ao=null,C=new Zc,V.cancel(),Ti){if(b){if(!ln.in_hot_standby||!ln.default_transaction_read_only)return H4();else if(Q4(b,ln))return oa()}if(mn)return Ti===!0&&(Ti=null),Y4();Ti!==!0&&ia(Ti),n.shared.retries=ni=0,Ti=null;return}while(D.length&&(_=D.shift())&&(_.active=!0,_.cancelled))ER(n).cancel(_.state,_.cancelled.resolve,_.cancelled.reject);if(_)return;wi.reserved?!wi.reserved.release&&w[5]===73?Io?oa():(wi.reserved=null,o(wi)):wi.reserved():Io?oa():o(wi)}function T4(w){gn=0;for(let W=w.length-1;W>0;W--){if(w[W]===32&&w[W+1]<58&&C.count===null)C.count=+w.toString("utf8",W+1,w.length-1);if(w[W-1]>=65){C.command=w.toString("utf8",5,W),C.state=K;break}}if(na&&(na(),na=null),C.command==="BEGIN"&&x!==1&&!wi.reserved)return Yo(en.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(_.options.simple)return Y$();if(_.cursorFn)C.count&&_.cursorFn(C),mi(Fc);_.resolve(C)}function w4(){_.parsing=!1}function Y$(){!C.statement&&(C.statement=_.statement),C.columns=_.statement.columns}function J4(w){let W=w.readUInt16BE(5);for(let P=0;P<W;++P)!_.statement.types[P]&&(_.statement.types[P]=w.readUInt32BE(7+P*4));_.prepare&&(Vn[_.signature]=_.statement),_.describeFirst&&!_.onlyDescribe&&(mi(ax(_)),_.describeFirst=!1)}function S4(w){if(C.command)ao=ao||[C],ao.push(C=new Zc),C.count=null,_.statement.columns=null;let W=w.readUInt16BE(5),P=7,Kn;_.statement.columns=Array(W);for(let kn=0;kn<W;++kn){Kn=P;while(w[P++]!==0);let Ji=w.readUInt32BE(P),Yi=w.readUInt16BE(P+4),ko=w.readUInt32BE(P+6);_.statement.columns[kn]={name:T.column.from?T.column.from(w.toString("utf8",Kn,P-1)):w.toString("utf8",Kn,P-1),parser:$[ko],table:Ji,number:Yi,type:ko},P+=18}if(C.statement=_.statement,_.onlyDescribe)return _.resolve(_.statement),mi(Fc)}async function A4(w,W=w.readUInt32BE(5)){(W===3?F4:W===5?M4:W===10?R4:W===11?W4:W===12?K4:W!==0?I4:Pp)(w,W)}async function F4(){let w=await ml();mi(q().p().str(w).z(1).end())}async function M4(w){let W="md5"+await HR(Buffer.concat([Buffer.from(await HR(await ml()+m)),w.subarray(9)]));mi(q().p().str(W).z(1).end())}async function R4(){Go=(await nx.randomBytes(18)).toString("base64"),q().p().str("SCRAM-SHA-256"+q.N);let w=q.i;mi(q.inc(4).str("n,,n=*,r="+Go).i32(q.i-w-4,w).end())}async function W4(w){let W=w.toString("utf8",9).split(",").reduce((Yi,ko)=>(Yi[ko[0]]=ko.slice(2),Yi),{}),P=await nx.pbkdf2Sync(await ml(),Buffer.from(W.s,"base64"),parseInt(W.i),32,"sha256"),Kn=await qm(P,"Client Key"),kn="n=*,r="+Go+",r="+W.r+",s="+W.s+",i="+W.i+",c=biws,r="+W.r;Dn=(await qm(await qm(P,"Server Key"),kn)).toString("base64");let Ji="c=biws,r="+W.r+",p="+P9(Kn,Buffer.from(await qm(await q9(Kn),kn))).toString("base64");mi(q().p().str(Ji).end())}function K4(w){if(w.toString("utf8",9).split(q.N,1)[0].slice(2)===Dn)return;Yo(en.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),X.destroy()}function ml(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function X4(){if(C.statement=_.statement,C.statement.columns=[],_.onlyDescribe)return _.resolve(_.statement),mi(Fc)}function G4(w){K.pid=w.readUInt32BE(5),K.secret=w.readUInt32BE(9)}async function Y4(){mn=!1,(await new po([`
38
38
  select b.oid, b.typarray
39
39
  from pg_catalog.pg_type a
40
40
  left join pg_catalog.pg_type b on b.oid = a.typelem
41
41
  where a.typcategory = 'A'
42
42
  group by b.oid, b.typarray
43
43
  order by b.oid
44
- `],[],gp)).forEach(({oid:W,typarray:e})=>A4(W,e))}function A4(T,W){if(!!n.parsers[W]&&!!n.serializers[W])return;let e=n.parsers[T];n.shared.typeArrayMap[T]=W,n.parsers[W]=(Kn)=>TM(Kn,e,W),n.parsers[W].array=!0,n.serializers[W]=(Kn)=>vM(Kn,n.serializers[T],n,W)}function J4(T,W){return T==="read-write"&&W.default_transaction_read_only==="on"||T==="read-only"&&W.default_transaction_read_only==="off"||T==="primary"&&W.in_hot_standby==="on"||T==="standby"&&W.in_hot_standby==="off"||T==="prefer-standby"&&W.in_hot_standby==="off"&&n.host[ni]}function F4(){let T=new co([`
44
+ `],[],ia)).forEach(({oid:W,typarray:P})=>z4(W,P))}function z4(w,W){if(!!n.parsers[W]&&!!n.serializers[W])return;let P=n.parsers[w];n.shared.typeArrayMap[w]=W,n.parsers[W]=(Kn)=>XR(Kn,P,W),n.parsers[W].array=!0,n.serializers[W]=(Kn)=>KR(Kn,n.serializers[w],n,W)}function Q4(w,W){return w==="read-write"&&W.default_transaction_read_only==="on"||w==="read-only"&&W.default_transaction_read_only==="off"||w==="primary"&&W.in_hot_standby==="on"||w==="standby"&&W.in_hot_standby==="off"||w==="prefer-standby"&&W.in_hot_standby==="off"&&n.host[ni]}function H4(){let w=new po([`
45
45
  show transaction_read_only;
46
46
  select pg_catalog.pg_is_in_recovery()
47
- `],[],gp,null,{simple:!0});T.resolve=([[W],[e]])=>{xn.default_transaction_read_only=W.transaction_read_only,xn.in_hot_standby=e.pg_is_in_recovery?"on":"off"},T.execute()}function R4(T){j&&(j.cursorFn||j.describeFirst)&&xi(Jc);let W=dn.postgres(t$(T));j&&j.retried?zo(j.retried):j&&j.prepared&&VG.has(W.routine)?M4(j,W):zo(W)}function M4(T,W){delete sn[T.signature],T.retried=W,gp(T)}function K4(T){if(!M)return;let W=9;while(T[W++]!==0);M(T.toString("utf8",9,W-1),T.toString("utf8",W,T.length-1))}async function W4(){try{let T=await Promise.resolve(j.cursorFn(_));en=0,T===Ip?xi(y4(j.portal)):(_=new kc,xi(Wv("",j.cursorRows)))}catch(T){xi(Jc),j.reject(T)}}function X4(){_.count&&j.cursorFn(_),j.resolve(_)}function G4(){ii=new L$.Writable({autoDestroy:!0,write(T,W,e){K.write(Z().d().raw(T).end(),e)},destroy(T,W){W(T),K.write(Z().f().str(T+Z.N).end()),ii=null},final(T){K.write(Z().c().end()),Pp=T}}),j.resolve(ii)}function z4(){ii=new L$.Readable({read(){K.resume()}}),j.resolve(ii)}function u4(){ii=new L$.Duplex({autoDestroy:!0,read(){K.resume()},write(T,W,e){K.write(Z().d().raw(T).end(),e)},destroy(T,W){W(T),K.write(Z().f().str(T+Z.N).end()),ii=null},final(T){K.write(Z().c().end()),Pp=T}}),j.resolve(ii)}function Y4(T){ii&&(ii.push(T.subarray(5))||K.pause())}function O4(){ii&&ii.push(null),ii=null}function H4(T){F?F(t$(T)):console.log(t$(T))}function E4(){}function Q4(){zo(dn.notSupported("FunctionCallResponse"))}function s4(){zo(dn.notSupported("NegotiateProtocolVersion"))}function U4(T){console.error("Postgres.js : Unknown Message:",T[0])}function b4(T,W){console.error("Postgres.js : Unknown Auth:",W)}function V4(T,W,e="",Kn=""){let In,wi;return Z().B().str(Kn+Z.N).str(e+Z.N).i16(0).i16(T.length),T.forEach((Xi,Io)=>{if(Xi===null)return Z.i32(4294967295);wi=W[Io],T[Io]=Xi=wi in n.serializers?n.serializers[wi](Xi):""+Xi,In=Z.i,Z.inc(4).str(Xi).i32(Z.i-In-4,In)}),Z.i16(0),Z.end()}function Kv(T,W,e,Kn=""){return Z().P().str(Kn+Z.N).str(T+Z.N).i16(W.length),W.forEach((In,wi)=>Z.i32(e[wi]||0)),Z.end()}function _4(T,W=""){return Z().D().str(T).str(W+Z.N).end()}function Wv(T="",W=0){return Buffer.concat([Z().E().str(T+Z.N).i32(W).end(),JM])}function y4(T=""){return Buffer.concat([Z().C().str("P").str(T+Z.N).end(),Z().S().end()])}function j4(){return L||Z().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:x,database:$,client_encoding:"UTF8"},n.connection)).filter(([,T])=>T).map(([T,W])=>T+Z.N+W).join(Z.N)).z(2).end(0)}}function t$(n){let i={},o=5;for(let c=5;c<n.length-1;c++)if(n[c]===0)i[_G[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function FM(n){return Pa.createHash("md5").update(n).digest("hex")}function Ix(n,i){return Pa.createHmac("sha256",n).update(i).digest()}function yG(n){return Pa.createHash("sha256").update(n).digest()}function jG(n,i){let o=Math.max(n.length,i.length),c=Buffer.allocUnsafe(o);for(let p=0;p<o;p++)c[p]=n[p]^i[p];return c}function D$(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:kp,start:kp};let o;return{cancel(){o&&(clearTimeout(o),o=null)},start(){o&&clearTimeout(o),o=setTimeout(c,i*1000,arguments)}};function c(p){n.apply(null,p),o=null}}var MM=()=>{};function I$(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},a,m,x=!1,l=v.sql=n({...i,transform:{column:{},value:{},row:{}},max:1,fetch_types:!1,idle_timeout:null,max_lifetime:null,connection:{...i.connection,replication:"database"},onclose:async function(){if(x)return;m=null,p.pid=p.secret=void 0,w(await F(l,c,i.publications)),o.forEach((J)=>J.forEach(({onsubscribe:X})=>X()))},no_subscribe:!0}),f=l.end,$=l.close;return l.end=async()=>{return x=!0,m&&await new Promise((J)=>(m.once("close",J),m.end())),f()},l.close=async()=>{return m&&await new Promise((J)=>(m.once("close",J),m.end())),$()},v;async function v(J,X,G=MM,u=MM){if(J=LG(J),!a)a=F(l,c,i.publications);let Q={fn:X,onsubscribe:G},V=o.has(J)?o.get(J).add(Q):o.set(J,new Set([Q])).get(J),z=()=>{V.delete(Q),V.size===0&&o.delete(J)};return a.then((R)=>{return w(R),G(),m&&m.on("error",u),{unsubscribe:z,state:p,sql:l}})}function w(J){m=J.stream,p.pid=J.state.pid,p.secret=J.state.secret}async function F(J,X,G){if(!G)throw new Error("Missing publication names");let u=await J.unsafe(`CREATE_REPLICATION_SLOT ${X} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[Q]=u,V=await J.unsafe(`START_REPLICATION SLOT ${X} LOGICAL ${Q.consistent_point} (proto_version '1', publication_names '${G}')`).writable(),z={lsn:Buffer.concat(Q.consistent_point.split("/").map((K)=>Buffer.from(("00000000"+K).slice(-8),"hex")))};return V.on("data",O),V.on("error",R),V.on("close",J.close),{stream:V,state:u.state};function R(K){console.error("Unexpected error during logical streaming - reconnecting",K)}function O(K){if(K[0]===119)NG(K.subarray(25),z,J.options.parsers,b,i.transform);else if(K[0]===107&&K[17])z.lsn=K.subarray(1,9),H()}function b(K,L){let _=L.relation.schema+"."+L.relation.table;M("*",K,L),M("*:"+_,K,L),L.relation.keys.length&&M("*:"+_+"="+L.relation.keys.map((q)=>K[q.name]),K,L),M(L.command,K,L),M(L.command+":"+_,K,L),L.relation.keys.length&&M(L.command+":"+_+"="+L.relation.keys.map((q)=>K[q.name]),K,L)}function H(){let K=Buffer.alloc(34);K[0]="r".charCodeAt(0),K.fill(z.lsn,1),K.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),V.write(K)}}function M(J,X,G){o.has(J)&&o.get(J).forEach(({fn:u})=>u(X,G,J))}}function BG(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function NG(n,i,o,c,p){let a=(m,[x,l])=>(m[x.charCodeAt(0)]=l,m);Object.entries({R:(m)=>{let x=1,l=i[m.readUInt32BE(x)]={schema:m.toString("utf8",x+=4,x=m.indexOf(0,x))||"pg_catalog",table:m.toString("utf8",x+1,x=m.indexOf(0,x+1)),columns:Array(m.readUInt16BE(x+=2)),keys:[]};x+=2;let f=0,$;while(x<m.length)$=l.columns[f++]={key:m[x++],name:p.column.from?p.column.from(m.toString("utf8",x,x=m.indexOf(0,x))):m.toString("utf8",x,x=m.indexOf(0,x)),type:m.readUInt32BE(x+=1),parser:o[m.readUInt32BE(x)],atttypmod:m.readUInt32BE(x+=4)},$.key&&l.keys.push($),x+=4},Y:()=>{},O:()=>{},B:(m)=>{i.date=BG(m.readBigInt64BE(9)),i.lsn=m.subarray(1,9)},I:(m)=>{let x=1,l=i[m.readUInt32BE(x)],{row:f}=Cx(m,l.columns,x+=7,p);c(f,{command:"insert",relation:l})},D:(m)=>{let x=1,l=i[m.readUInt32BE(x)];x+=4;let f=m[x]===75;c(f||m[x]===79?Cx(m,l.columns,x+=3,p).row:null,{command:"delete",relation:l,key:f})},U:(m)=>{let x=1,l=i[m.readUInt32BE(x)];x+=4;let f=m[x]===75,$=f||m[x]===79?Cx(m,l.columns,x+=3,p):null;$&&(x=$.i);let{row:v}=Cx(m,l.columns,x+3,p);c(v,{command:"update",relation:l,key:f,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(a,{})[n[0]](n)}function Cx(n,i,o,c){let p,a,m,x=c.raw?new Array(i.length):{};for(let l=0;l<i.length;l++)p=n[o++],a=i[l],m=p===110?null:p===117?void 0:a.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):a.parser.array===!0?a.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):a.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?x[l]=c.raw===!0?m:c.value.from?c.value.from(m,a):m:x[a.name]=c.value.from?c.value.from(m,a):m;return{i:o,row:c.row.from?c.row.from(x):x}}function LG(n){let i=n.match(/^(\*|insert|update|delete)?:?([^.]+?\.?[^=]+)?=?(.+)?/i)||[];if(!i)throw new Error("Malformed subscribe pattern: "+n);let[,o,c,p]=i;return(o||"*")+(c?":"+(c.indexOf(".")===-1?"public."+c:c):"")+(p?"="+p:"")}import KM from"stream";function C$(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(a)=>{let m;!i&&([{oid:i}]=await a`select lo_creat(-1) as oid`);let[{fd:x}]=await a`select lo_open(${i}, ${o}) as fd`,l={writable:$,readable:f,close:()=>a`select lo_close(${x})`.then(m),tell:()=>a`select lo_tell64(${x})`,read:(v)=>a`select loread(${x}, ${v}) as data`,write:(v)=>a`select lowrite(${x}, ${v})`,truncate:(v)=>a`select lo_truncate64(${x}, ${v})`,seek:(v,w=0)=>a`select lo_lseek64(${x}, ${v}, ${w})`,size:()=>a`
47
+ `],[],ia,null,{simple:!0});w.resolve=([[W],[P]])=>{ln.default_transaction_read_only=W.transaction_read_only,ln.in_hot_standby=P.pg_is_in_recovery?"on":"off"},w.execute()}function E4(w){_&&(_.cursorFn||_.describeFirst)&&mi(Fc);let W=en.postgres(Zv(w));_&&_.retried?Yo(_.retried):_&&_.prepared&&Z9.has(W.routine)?O4(_,W):Yo(W)}function O4(w,W){delete Vn[w.signature],w.retried=W,ia(w)}function U4(w){if(!M)return;let W=9;while(w[W++]!==0);M(w.toString("utf8",9,W-1),w.toString("utf8",W,w.length-1))}async function V4(){try{let w=await Promise.resolve(_.cursorFn(C));gn=0,w===tp?mi(Z4(_.portal)):(C=new Zc,mi(Q$("",_.cursorRows)))}catch(w){mi(Fc),_.reject(w)}}function u4(){C.count&&_.cursorFn(C),_.resolve(C)}function _4(){ii=new sv.Writable({autoDestroy:!0,write(w,W,P){X.write(q().d().raw(w).end(),P)},destroy(w,W){W(w),X.write(q().f().str(w+q.N).end()),ii=null},final(w){X.write(q().c().end()),na=w}}),_.resolve(ii)}function b4(){ii=new sv.Readable({read(){X.resume()}}),_.resolve(ii)}function j4(){ii=new sv.Duplex({autoDestroy:!0,read(){X.resume()},write(w,W,P){X.write(q().d().raw(w).end(),P)},destroy(w,W){W(w),X.write(q().f().str(w+q.N).end()),ii=null},final(w){X.write(q().c().end()),na=w}}),_.resolve(ii)}function y4(w){ii&&(ii.push(w.subarray(5))||X.pause())}function B4(){ii&&ii.push(null),ii=null}function L4(w){F?F(Zv(w)):console.log(Zv(w))}function N4(){}function D4(){Yo(en.notSupported("FunctionCallResponse"))}function C4(){Yo(en.notSupported("NegotiateProtocolVersion"))}function h4(w){console.error("Postgres.js : Unknown Message:",w[0])}function I4(w,W){console.error("Postgres.js : Unknown Auth:",W)}function k4(w,W,P="",Kn=""){let kn,Ji;return q().B().str(Kn+q.N).str(P+q.N).i16(0).i16(w.length),w.forEach((Yi,ko)=>{if(Yi===null)return q.i32(4294967295);Ji=W[ko],w[ko]=Yi=Ji in n.serializers?n.serializers[Ji](Yi):""+Yi,kn=q.i,q.inc(4).str(Yi).i32(q.i-kn-4,kn)}),q.i16(0),q.end()}function z$(w,W,P,Kn=""){return q().P().str(Kn+q.N).str(w+q.N).i16(W.length),W.forEach((kn,Ji)=>q.i32(P[Ji]||0)),q.end()}function s4(w,W=""){return q().D().str(w).str(W+q.N).end()}function Q$(w="",W=0){return Buffer.concat([q().E().str(w+q.N).i32(W).end(),QR])}function Z4(w=""){return Buffer.concat([q().C().str("P").str(w+q.N).end(),q().S().end()])}function t4(){return Z||q().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:m,database:v,client_encoding:"UTF8"},n.connection)).filter(([,w])=>w).map(([w,W])=>w+q.N+W).join(q.N)).z(2).end(0)}}function Zv(n){let i={},o=5;for(let c=5;c<n.length-1;c++)if(n[c]===0)i[t9[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function HR(n){return nx.createHash("md5").update(n).digest("hex")}function qm(n,i){return nx.createHmac("sha256",n).update(i).digest()}function q9(n){return nx.createHash("sha256").update(n).digest()}function P9(n,i){let o=Math.max(n.length,i.length),c=Buffer.allocUnsafe(o);for(let p=0;p<o;p++)c[p]=n[p]^i[p];return c}function tv(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:Pp,start:Pp};let o;return{cancel(){o&&(clearTimeout(o),o=null)},start(){o&&clearTimeout(o),o=setTimeout(c,i*1000,arguments)}};function c(p){n.apply(null,p),o=null}}var OR=()=>{};function Pv(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},a,x,m=!1,l=$.sql=n({...i,transform:{column:{},value:{},row:{}},max:1,fetch_types:!1,idle_timeout:null,max_lifetime:null,connection:{...i.connection,replication:"database"},onclose:async function(){if(m)return;x=null,p.pid=p.secret=void 0,T(await F(l,c,i.publications)),o.forEach((A)=>A.forEach(({onsubscribe:R})=>R()))},no_subscribe:!0}),f=l.end,v=l.close;return l.end=async()=>{return m=!0,x&&await new Promise((A)=>(x.once("close",A),x.end())),f()},l.close=async()=>{return x&&await new Promise((A)=>(x.once("close",A),x.end())),v()},$;async function $(A,R,G=OR,Q=OR){if(A=d9(A),!a)a=F(l,c,i.publications);let b={fn:R,onsubscribe:G},D=o.has(A)?o.get(A).add(b):o.set(A,new Set([b])).get(A),Y=()=>{D.delete(b),D.size===0&&o.delete(A)};return a.then((K)=>{return T(K),G(),x&&x.on("error",Q),{unsubscribe:Y,state:p,sql:l}})}function T(A){x=A.stream,p.pid=A.state.pid,p.secret=A.state.secret}async function F(A,R,G){if(!G)throw new Error("Missing publication names");let Q=await A.unsafe(`CREATE_REPLICATION_SLOT ${R} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[b]=Q,D=await A.unsafe(`START_REPLICATION SLOT ${R} LOGICAL ${b.consistent_point} (proto_version '1', publication_names '${G}')`).writable(),Y={lsn:Buffer.concat(b.consistent_point.split("/").map((X)=>Buffer.from(("00000000"+X).slice(-8),"hex")))};return D.on("data",E),D.on("error",K),D.on("close",A.close),{stream:D,state:Q.state};function K(X){console.error("Unexpected error during logical streaming - reconnecting",X)}function E(X){if(X[0]===119)g9(X.subarray(25),Y,A.options.parsers,y,i.transform);else if(X[0]===107&&X[17])Y.lsn=X.subarray(1,9),V()}function y(X,Z){let C=Z.relation.schema+"."+Z.relation.table;M("*",X,Z),M("*:"+C,X,Z),Z.relation.keys.length&&M("*:"+C+"="+Z.relation.keys.map((on)=>X[on.name]),X,Z),M(Z.command,X,Z),M(Z.command+":"+C,X,Z),Z.relation.keys.length&&M(Z.command+":"+C+"="+Z.relation.keys.map((on)=>X[on.name]),X,Z)}function V(){let X=Buffer.alloc(34);X[0]="r".charCodeAt(0),X.fill(Y.lsn,1),X.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),D.write(X)}}function M(A,R,G){o.has(A)&&o.get(A).forEach(({fn:Q})=>Q(R,G,A))}}function r9(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function g9(n,i,o,c,p){let a=(x,[m,l])=>(x[m.charCodeAt(0)]=l,x);Object.entries({R:(x)=>{let m=1,l=i[x.readUInt32BE(m)]={schema:x.toString("utf8",m+=4,m=x.indexOf(0,m))||"pg_catalog",table:x.toString("utf8",m+1,m=x.indexOf(0,m+1)),columns:Array(x.readUInt16BE(m+=2)),keys:[]};m+=2;let f=0,v;while(m<x.length)v=l.columns[f++]={key:x[m++],name:p.column.from?p.column.from(x.toString("utf8",m,m=x.indexOf(0,m))):x.toString("utf8",m,m=x.indexOf(0,m)),type:x.readUInt32BE(m+=1),parser:o[x.readUInt32BE(m)],atttypmod:x.readUInt32BE(m+=4)},v.key&&l.keys.push(v),m+=4},Y:()=>{},O:()=>{},B:(x)=>{i.date=r9(x.readBigInt64BE(9)),i.lsn=x.subarray(1,9)},I:(x)=>{let m=1,l=i[x.readUInt32BE(m)],{row:f}=Pm(x,l.columns,m+=7,p);c(f,{command:"insert",relation:l})},D:(x)=>{let m=1,l=i[x.readUInt32BE(m)];m+=4;let f=x[m]===75;c(f||x[m]===79?Pm(x,l.columns,m+=3,p).row:null,{command:"delete",relation:l,key:f})},U:(x)=>{let m=1,l=i[x.readUInt32BE(m)];m+=4;let f=x[m]===75,v=f||x[m]===79?Pm(x,l.columns,m+=3,p):null;v&&(m=v.i);let{row:$}=Pm(x,l.columns,m+3,p);c($,{command:"update",relation:l,key:f,old:v&&v.row})},T:()=>{},C:()=>{}}).reduce(a,{})[n[0]](n)}function Pm(n,i,o,c){let p,a,x,m=c.raw?new Array(i.length):{};for(let l=0;l<i.length;l++)p=n[o++],a=i[l],x=p===110?null:p===117?void 0:a.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):a.parser.array===!0?a.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):a.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?m[l]=c.raw===!0?x:c.value.from?c.value.from(x,a):x:m[a.name]=c.value.from?c.value.from(x,a):x;return{i:o,row:c.row.from?c.row.from(m):m}}function d9(n){let i=n.match(/^(\*|insert|update|delete)?:?([^.]+?\.?[^=]+)?=?(.+)?/i)||[];if(!i)throw new Error("Malformed subscribe pattern: "+n);let[,o,c,p]=i;return(o||"*")+(c?":"+(c.indexOf(".")===-1?"public."+c:c):"")+(p?"="+p:"")}import UR from"stream";function rv(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(a)=>{let x;!i&&([{oid:i}]=await a`select lo_creat(-1) as oid`);let[{fd:m}]=await a`select lo_open(${i}, ${o}) as fd`,l={writable:v,readable:f,close:()=>a`select lo_close(${m})`.then(x),tell:()=>a`select lo_tell64(${m})`,read:($)=>a`select loread(${m}, ${$}) as data`,write:($)=>a`select lowrite(${m}, ${$})`,truncate:($)=>a`select lo_truncate64(${m}, ${$})`,seek:($,T=0)=>a`select lo_lseek64(${m}, ${$}, ${T})`,size:()=>a`
48
48
  select
49
- lo_lseek64(${x}, location, 0) as position,
49
+ lo_lseek64(${m}, location, 0) as position,
50
50
  seek.size
51
51
  from (
52
52
  select
@@ -54,10 +54,10 @@ var B4=Object.create;var{getPrototypeOf:N4,defineProperty:pl,getOwnPropertyNames
54
54
  tell.location
55
55
  from (select lo_tell64($1) as location) tell
56
56
  ) seek
57
- `};return c(l),new Promise(async(v)=>m=v);async function f({highWaterMark:v=16384,start:w=0,end:F=1/0}={}){let M=F-w;return w&&await l.seek(w),new KM.Readable({highWaterMark:v,async read(J){let X=J>M?J-M:J;M-=J;let[{data:G}]=await l.read(X);if(this.push(G),G.length<J)this.push(null)}})}async function $({highWaterMark:v=16384,start:w=0}={}){return w&&await l.seek(w),new KM.Writable({highWaterMark:v,write(F,M,J){l.write(F).then(()=>J(),J)}})}}).catch(p)})}Object.assign(kx,{PostgresError:Cp,toPascal:Ic,pascal:B$,toCamel:hc,camel:j$,toKebab:Cc,kebab:N$,fromPascal:Za,fromCamel:ra,fromKebab:qa,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var rp=kx;function kx(n,i){let o=hG(n,i),c=o.no_subscribe||I$(kx,{...o}),p=!1,a=Ii(),m=Ii(),x=Ii(),l=Ii(),f=Ii(),$=Ii(),v=Ii(),w=Ii(),F={connecting:m,reserved:x,closed:l,ended:f,open:$,busy:v,full:w},M=[...Array(o.max)].map(()=>h$(o,F,{onopen:sn,onend:xn,onclose:_i})),J=X(b);return Object.assign(J,{get parameters(){return o.parameters},largeObject:C$.bind(null,J),subscribe:c,CLOSE:Ip,END:Ip,PostgresError:Cp,options:o,reserve:Q,listen:G,begin:V,close:_,end:L}),J;function X(E){return E.debug=o.debug,Object.entries(o.types).reduce((Tn,[Un,en])=>{return Tn[Un]=(Nn)=>new Uo(Nn,en.to),Tn},k),Object.assign(wn,{types:k,typed:k,unsafe:zn,notify:u,array:O,json:R,file:ni}),wn;function k(Tn,Un){return new Uo(Tn,Un)}function wn(Tn,...Un){return Tn&&Array.isArray(Tn.raw)?new co(Tn,Un,E,K):typeof Tn==="string"&&!Un.length?new ea(o.transform.column.to?o.transform.column.to(Tn):Tn):new Lx(Tn,Un)}function zn(Tn,Un=[],en={}){return arguments.length===2&&!Array.isArray(Un)&&(en=Un,Un=[]),new co([Tn],Un,E,K,{prepare:!1,...en,simple:"simple"in en?en.simple:Un.length===0})}function ni(Tn,Un=[],en={}){return arguments.length===2&&!Array.isArray(Un)&&(en=Un,Un=[]),new co([],Un,(_n)=>{DG.readFile(Tn,"utf8",($i,bn)=>{if($i)return _n.reject($i);_n.strings=[bn],E(_n)})},K,{...en,simple:"simple"in en?en.simple:Un.length===0})}}async function G(E,k,wn){let zn={fn:k,onlisten:wn},ni=G.sql||(G.sql=kx({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(G.channels).forEach(([_n,{listeners:$i}])=>{delete G.channels[_n],Promise.all($i.map((bn)=>G(_n,bn.fn,bn.onlisten).catch(()=>{})))})},onnotify(_n,$i){_n in G.channels&&G.channels[_n].listeners.forEach((bn)=>bn.fn($i))}})),Tn=G.channels||(G.channels={});if(E in Tn){Tn[E].listeners.push(zn);let _n=await Tn[E].result;return zn.onlisten&&zn.onlisten(),{state:_n.state,unlisten:Nn}}Tn[E]={result:ni`listen ${ni.unsafe('"'+E.replace(/"/g,'""')+'"')}`,listeners:[zn]};let en=await Tn[E].result;return zn.onlisten&&zn.onlisten(),{state:en.state,unlisten:Nn};async function Nn(){if(E in Tn===!1)return;if(Tn[E].listeners=Tn[E].listeners.filter((_n)=>_n!==zn),Tn[E].listeners.length)return;return delete Tn[E],ni`unlisten ${ni.unsafe('"'+E.replace(/"/g,'""')+'"')}`}}async function u(E,k){return await J`select pg_notify(${E}, ${""+k})`}async function Q(){let E=Ii(),k=$.length?$.shift():await new Promise((ni)=>{a.push({reserve:ni}),l.length&&cn(l.shift())});z(k,x),k.reserved=()=>E.length?k.execute(E.shift()):z(k,x),k.reserved.release=!0;let wn=X(zn);return wn.release=()=>{k.reserved=null,sn(k)},wn;function zn(ni){k.queue===w?E.push(ni):k.execute(ni)||z(k,w)}}async function V(E,k){!k&&(k=E,E="");let wn=Ii(),zn=0,ni,Tn=null;try{return await J.unsafe("begin "+E.replace(/[^a-z ]/ig,""),[],{onexecute:en}).execute(),await Promise.race([Un(ni,k),new Promise((Nn,_n)=>ni.onclose=_n)])}catch(Nn){throw Nn}async function Un(Nn,_n,$i){let bn=X(ii);bn.savepoint=ho,bn.prepare=(yn)=>Tn=yn.replace(/[^a-z0-9$-_. ]/gi);let po,vi;$i&&await bn`savepoint ${bn($i)}`;try{if(vi=await new Promise((yn,ao)=>{let Go=_n(bn);Promise.resolve(Array.isArray(Go)?Promise.all(Go):Go).then(yn,ao)}),po)throw po}catch(yn){throw await($i?bn`rollback to ${bn($i)}`:bn`rollback`),yn instanceof Cp&&yn.code==="25P02"&&po||yn}if(!$i)Tn?await bn`prepare transaction '${bn.unsafe(Tn)}'`:await bn`commit`;return vi;function ho(yn,ao){if(yn&&Array.isArray(yn.raw))return ho((Go)=>Go.apply(Go,arguments));return arguments.length===1&&(ao=yn,yn=null),Un(Nn,ao,"s"+zn+++(yn?"_"+yn:""))}function ii(yn){yn.catch((ao)=>po||(po=ao)),Nn.queue===w?wn.push(yn):Nn.execute(yn)||z(Nn,w)}}function en(Nn){ni=Nn,z(Nn,x),Nn.reserved=()=>wn.length?Nn.execute(wn.shift()):z(Nn,x)}}function z(E,k){return E.queue.remove(E),k.push(E),E.queue=k,k===$?E.idleTimer.start():E.idleTimer.cancel(),E}function R(E){return new Uo(E,3802)}function O(E,k){if(!Array.isArray(E))return O(Array.from(arguments));return new Uo(E,k||(E.length?Bx(E)||25:0),o.shared.typeArrayMap)}function b(E){if(p)return E.reject(dn.connection("CONNECTION_ENDED",o,o));if($.length)return H($.shift(),E);if(l.length)return cn(l.shift(),E);v.length?H(v.shift(),E):a.push(E)}function H(E,k){return E.execute(k)?z(E,v):z(E,w)}function K(E){return new Promise((k,wn)=>{E.state?E.active?h$(o).cancel(E.state,k,wn):E.cancelled={resolve:k,reject:wn}:(a.remove(E),E.cancelled=!0,E.reject(dn.generic("57014","canceling statement due to user request")),k())})}async function L({timeout:E=null}={}){if(p)return p;await 1;let k;return p=Promise.race([new Promise((wn)=>E!==null&&(k=setTimeout(q,E*1000,wn))),Promise.all(M.map((wn)=>wn.end()).concat(G.sql?G.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(k))}async function _(){await Promise.all(M.map((E)=>E.end()))}async function q(E){await Promise.all(M.map((k)=>k.terminate()));while(a.length)a.shift().reject(dn.connection("CONNECTION_DESTROYED",o));E()}function cn(E,k){return z(E,m),E.connect(k),E}function xn(E){z(E,f)}function sn(E){if(a.length===0)return z(E,$);let k=Math.ceil(a.length/(m.length+1)),wn=!0;while(wn&&a.length&&k-- >0){let zn=a.shift();if(zn.reserve)return zn.reserve(E);wn=E.execute(zn)}wn?z(E,v):z(E,w)}function _i(E,k){z(E,l),E.reserved=null,E.onclose&&(E.onclose(k),E.onclose=null),o.onclose&&o.onclose(E.id),a.length&&cn(E,a.shift())}}function hG(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:a}=ZG(n),m=[...p.searchParams].reduce((w,[F,M])=>(w[F]=M,w),{}),x=c.hostname||c.host||a||p.hostname||o.PGHOST||"localhost",l=c.port||p.port||o.PGPORT||5432,f=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||qG();c.no_prepare&&(c.prepare=!1),m.sslmode&&(m.ssl=m.sslmode,delete m.sslmode),"timeout"in c&&(console.log("The timeout option is deprecated, use idle_timeout instead"),c.idle_timeout=c.timeout),m.sslrootcert==="system"&&(m.ssl="verify-full");let $=["idle_timeout","connect_timeout","max_lifetime","max_pipeline","backoff","keep_alive"],v={max:10,ssl:!1,idle_timeout:null,connect_timeout:30,max_lifetime:kG,max_pipeline:100,backoff:CG,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(x)?x:x.split(",").map((w)=>w.split(":")[0]),port:Array.isArray(l)?l:x.split(",").map((w)=>parseInt(w.split(":")[1]||l)),path:c.path||x.indexOf("/")>-1&&x+"/.s.PGSQL."+l,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||f,user:f,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(v).reduce((w,[F,M])=>{let J=F in c?c[F]:(F in m)?m[F]==="disable"||m[F]==="false"?!1:m[F]:o["PG"+F.toUpperCase()]||M;return w[F]=typeof J==="string"&&$.includes(F)?+J:J,w},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((w,[F,M])=>((F in v)||(w[F]=M),w),{})},types:c.types||{},target_session_attrs:IG(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:rG(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...fM(c.types)}}function IG(n,i,o){let c=n.target_session_attrs||i.searchParams.get("target_session_attrs")||o.PGTARGETSESSIONATTRS;if(!c||["read-write","read-only","primary","standby","prefer-standby"].includes(c))return c;throw new Error("target_session_attrs "+c+" is not supported")}function CG(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function kG(){return 60*(30+Math.random()*30)}function rG(n){return{undefined:n.undefined,column:{from:typeof n.column==="function"?n.column:n.column&&n.column.from,to:n.column&&n.column.to},value:{from:typeof n.value==="function"?n.value:n.value&&n.value.from,to:n.value&&n.value.to},row:{from:typeof n.row==="function"?n.row:n.row&&n.row.from,to:n.row&&n.row.to}}}function ZG(n){if(!n||typeof n!=="string")return{url:{searchParams:new Map}};let i=n;i=i.slice(i.indexOf("://")+3).split(/[?/]/)[0],i=decodeURIComponent(i.slice(i.indexOf("@")+1));let o=new URL(n.replace(i,i.split(",")[0]));return{url:{username:decodeURIComponent(o.username),password:decodeURIComponent(o.password),host:o.host,hostname:o.hostname,port:o.port,pathname:o.pathname,searchParams:o.searchParams},multihost:i.indexOf(",")>-1&&i}}function qG(){try{return tG.userInfo().username}catch(n){return process.env.USERNAME||"runner"}}class rx extends Yi{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[S]="PgDelete";config;where(n){return this.config.where=n,this}returning(n=this.config.table[t.Symbol.Columns]){return this.config.returning=di(n),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Qn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}execute=(n)=>{return Qn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})};$dynamic(){return this}}class Zx{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[S]="PgInsertBuilder";values(n){if(n=Array.isArray(n)?n:[n],n.length===0)throw new Error("values() must be called with at least one value");let i=n.map((o)=>{let c={},p=this.table[t.Symbol.Columns];for(let a of Object.keys(o)){let m=o[a];c[a]=Y(m,C)?m:new Bi(m,p[a])}return c});return new WM(this.table,i,this.session,this.dialect,this.withList)}}class WM extends Yi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p}}static[S]="PgInsert";config;returning(n=this.config.table[t.Symbol.Columns]){return this.config.returning=di(n),this}onConflictDoNothing(n={}){if(n.target===void 0)this.config.onConflict=A`do nothing`;else{let i="";i=Array.isArray(n.target)?n.target.map((c)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(c))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target));let o=n.where?A` where ${n.where}`:void 0;this.config.onConflict=A`(${A.raw(i)})${o} do nothing`}return this}onConflictDoUpdate(n){if(n.where&&(n.targetWhere||n.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let i=n.where?A` where ${n.where}`:void 0,o=n.targetWhere?A` where ${n.targetWhere}`:void 0,c=n.setWhere?A` where ${n.setWhere}`:void 0,p=this.dialect.buildUpdateSet(this.config.table,km(this.config.table,n.set)),a="";return a=Array.isArray(n.target)?n.target.map((m)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(m))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target)),this.config.onConflict=A`(${A.raw(a)})${o} do update set ${p}${i}${c}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Qn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}execute=(n)=>{return Qn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})};$dynamic(){return this}}function eG(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function PG(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((o,c,p)=>{let a=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+a},"")}function gG(n){return n}class k${static[S]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?eG:n==="camelCase"?PG:gG}getColumnCasing(n){if(!n.keyAsName)return n.name;let i=n.table[t.Symbol.Schema]??"public",o=n.table[t.Symbol.OriginalName],c=`${i}.${o}.${n.name}`;if(!this.cache[c])this.cacheTable(n.table);return this.cache[c]}cacheTable(n){let i=n[t.Symbol.Schema]??"public",o=n[t.Symbol.OriginalName],c=`${i}.${o}`;if(!this.cachedTables[c]){for(let p of Object.values(n[t.Symbol.Columns])){let a=`${c}.${p.name}`;this.cache[a]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class ga extends si{static[S]="PgViewBase"}class rc{static[S]="PgDialect";casing;constructor(n){this.casing=new k$(n?.casing)}async migrate(n,i,o){let c=typeof o==="string"?"__drizzle_migrations":o.migrationsTable??"__drizzle_migrations",p=typeof o==="string"?"drizzle":o.migrationsSchema??"drizzle",a=A`
58
- CREATE TABLE IF NOT EXISTS ${A.identifier(p)}.${A.identifier(c)} (
57
+ `};return c(l),new Promise(async($)=>x=$);async function f({highWaterMark:$=16384,start:T=0,end:F=1/0}={}){let M=F-T;return T&&await l.seek(T),new UR.Readable({highWaterMark:$,async read(A){let R=A>M?A-M:A;M-=A;let[{data:G}]=await l.read(R);if(this.push(G),G.length<A)this.push(null)}})}async function v({highWaterMark:$=16384,start:T=0}={}){return T&&await l.seek(T),new UR.Writable({highWaterMark:$,write(F,M,A){l.write(F).then(()=>A(),A)}})}}).catch(p)})}Object.assign(rm,{PostgresError:qp,toPascal:kc,pascal:Iv,toCamel:Ic,camel:hv,toKebab:sc,kebab:kv,fromPascal:ga,fromCamel:ra,fromKebab:da,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var rp=rm;function rm(n,i){let o=iG(n,i),c=o.no_subscribe||Pv(rm,{...o}),p=!1,a=ki(),x=ki(),m=ki(),l=ki(),f=ki(),v=ki(),$=ki(),T=ki(),F={connecting:x,reserved:m,closed:l,ended:f,open:v,busy:$,full:T},M=[...Array(o.max)].map(()=>qv(o,F,{onopen:Vn,onend:ln,onclose:ji})),A=R(y);return Object.assign(A,{get parameters(){return o.parameters},largeObject:rv.bind(null,A),subscribe:c,CLOSE:tp,END:tp,PostgresError:qp,options:o,reserve:b,listen:G,begin:D,close:C,end:Z}),A;function R(H){return H.debug=o.debug,Object.entries(o.types).reduce((Tn,[un,gn])=>{return Tn[un]=(Dn)=>new uo(Dn,gn.to),Tn},s),Object.assign(wn,{types:s,typed:s,unsafe:Yn,notify:Q,array:E,json:K,file:ni}),wn;function s(Tn,un){return new uo(Tn,un)}function wn(Tn,...un){return Tn&&Array.isArray(Tn.raw)?new po(Tn,un,H,X):typeof Tn==="string"&&!un.length?new ea(o.transform.column.to?o.transform.column.to(Tn):Tn):new km(Tn,un)}function Yn(Tn,un=[],gn={}){return arguments.length===2&&!Array.isArray(un)&&(gn=un,un=[]),new po([Tn],un,H,X,{prepare:!1,...gn,simple:"simple"in gn?gn.simple:un.length===0})}function ni(Tn,un=[],gn={}){return arguments.length===2&&!Array.isArray(un)&&(gn=un,un=[]),new po([],un,(jn)=>{nG.readFile(Tn,"utf8",($i,_n)=>{if($i)return jn.reject($i);jn.strings=[_n],H(jn)})},X,{...gn,simple:"simple"in gn?gn.simple:un.length===0})}}async function G(H,s,wn){let Yn={fn:s,onlisten:wn},ni=G.sql||(G.sql=rm({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(G.channels).forEach(([jn,{listeners:$i}])=>{delete G.channels[jn],Promise.all($i.map((_n)=>G(jn,_n.fn,_n.onlisten).catch(()=>{})))})},onnotify(jn,$i){jn in G.channels&&G.channels[jn].listeners.forEach((_n)=>_n.fn($i))}})),Tn=G.channels||(G.channels={});if(H in Tn){Tn[H].listeners.push(Yn);let jn=await Tn[H].result;return Yn.onlisten&&Yn.onlisten(),{state:jn.state,unlisten:Dn}}Tn[H]={result:ni`listen ${ni.unsafe('"'+H.replace(/"/g,'""')+'"')}`,listeners:[Yn]};let gn=await Tn[H].result;return Yn.onlisten&&Yn.onlisten(),{state:gn.state,unlisten:Dn};async function Dn(){if(H in Tn===!1)return;if(Tn[H].listeners=Tn[H].listeners.filter((jn)=>jn!==Yn),Tn[H].listeners.length)return;return delete Tn[H],ni`unlisten ${ni.unsafe('"'+H.replace(/"/g,'""')+'"')}`}}async function Q(H,s){return await A`select pg_notify(${H}, ${""+s})`}async function b(){let H=ki(),s=v.length?v.shift():await new Promise((ni)=>{a.push({reserve:ni}),l.length&&mn(l.shift())});Y(s,m),s.reserved=()=>H.length?s.execute(H.shift()):Y(s,m),s.reserved.release=!0;let wn=R(Yn);return wn.release=()=>{s.reserved=null,Vn(s)},wn;function Yn(ni){s.queue===T?H.push(ni):s.execute(ni)||Y(s,T)}}async function D(H,s){!s&&(s=H,H="");let wn=ki(),Yn=0,ni,Tn=null;try{return await A.unsafe("begin "+H.replace(/[^a-z ]/ig,""),[],{onexecute:gn}).execute(),await Promise.race([un(ni,s),new Promise((Dn,jn)=>ni.onclose=jn)])}catch(Dn){throw Dn}async function un(Dn,jn,$i){let _n=R(ii);_n.savepoint=Io,_n.prepare=(yn)=>Tn=yn.replace(/[^a-z0-9$-_. ]/gi);let ao,Ti;$i&&await _n`savepoint ${_n($i)}`;try{if(Ti=await new Promise((yn,xo)=>{let Go=jn(_n);Promise.resolve(Array.isArray(Go)?Promise.all(Go):Go).then(yn,xo)}),ao)throw ao}catch(yn){throw await($i?_n`rollback to ${_n($i)}`:_n`rollback`),yn instanceof qp&&yn.code==="25P02"&&ao||yn}if(!$i)Tn?await _n`prepare transaction '${_n.unsafe(Tn)}'`:await _n`commit`;return Ti;function Io(yn,xo){if(yn&&Array.isArray(yn.raw))return Io((Go)=>Go.apply(Go,arguments));return arguments.length===1&&(xo=yn,yn=null),un(Dn,xo,"s"+Yn+++(yn?"_"+yn:""))}function ii(yn){yn.catch((xo)=>ao||(ao=xo)),Dn.queue===T?wn.push(yn):Dn.execute(yn)||Y(Dn,T)}}function gn(Dn){ni=Dn,Y(Dn,m),Dn.reserved=()=>wn.length?Dn.execute(wn.shift()):Y(Dn,m)}}function Y(H,s){return H.queue.remove(H),s.push(H),H.queue=s,s===v?H.idleTimer.start():H.idleTimer.cancel(),H}function K(H){return new uo(H,3802)}function E(H,s){if(!Array.isArray(H))return E(Array.from(arguments));return new uo(H,s||(H.length?hm(H)||25:0),o.shared.typeArrayMap)}function y(H){if(p)return H.reject(en.connection("CONNECTION_ENDED",o,o));if(v.length)return V(v.shift(),H);if(l.length)return mn(l.shift(),H);$.length?V($.shift(),H):a.push(H)}function V(H,s){return H.execute(s)?Y(H,$):Y(H,T)}function X(H){return new Promise((s,wn)=>{H.state?H.active?qv(o).cancel(H.state,s,wn):H.cancelled={resolve:s,reject:wn}:(a.remove(H),H.cancelled=!0,H.reject(en.generic("57014","canceling statement due to user request")),s())})}async function Z({timeout:H=null}={}){if(p)return p;await 1;let s;return p=Promise.race([new Promise((wn)=>H!==null&&(s=setTimeout(on,H*1000,wn))),Promise.all(M.map((wn)=>wn.end()).concat(G.sql?G.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(s))}async function C(){await Promise.all(M.map((H)=>H.end()))}async function on(H){await Promise.all(M.map((s)=>s.terminate()));while(a.length)a.shift().reject(en.connection("CONNECTION_DESTROYED",o));H()}function mn(H,s){return Y(H,x),H.connect(s),H}function ln(H){Y(H,f)}function Vn(H){if(a.length===0)return Y(H,v);let s=Math.ceil(a.length/(x.length+1)),wn=!0;while(wn&&a.length&&s-- >0){let Yn=a.shift();if(Yn.reserve)return Yn.reserve(H);wn=H.execute(Yn)}wn?Y(H,$):Y(H,T)}function ji(H,s){Y(H,l),H.reserved=null,H.onclose&&(H.onclose(s),H.onclose=null),o.onclose&&o.onclose(H.id),a.length&&mn(H,a.shift())}}function iG(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:a}=xG(n),x=[...p.searchParams].reduce((T,[F,M])=>(T[F]=M,T),{}),m=c.hostname||c.host||a||p.hostname||o.PGHOST||"localhost",l=c.port||p.port||o.PGPORT||5432,f=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||mG();c.no_prepare&&(c.prepare=!1),x.sslmode&&(x.ssl=x.sslmode,delete x.sslmode),"timeout"in c&&(console.log("The timeout option is deprecated, use idle_timeout instead"),c.idle_timeout=c.timeout),x.sslrootcert==="system"&&(x.ssl="verify-full");let v=["idle_timeout","connect_timeout","max_lifetime","max_pipeline","backoff","keep_alive"],$={max:10,ssl:!1,idle_timeout:null,connect_timeout:30,max_lifetime:pG,max_pipeline:100,backoff:cG,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(m)?m:m.split(",").map((T)=>T.split(":")[0]),port:Array.isArray(l)?l:m.split(",").map((T)=>parseInt(T.split(":")[1]||l)),path:c.path||m.indexOf("/")>-1&&m+"/.s.PGSQL."+l,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||f,user:f,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries($).reduce((T,[F,M])=>{let A=F in c?c[F]:(F in x)?x[F]==="disable"||x[F]==="false"?!1:x[F]:o["PG"+F.toUpperCase()]||M;return T[F]=typeof A==="string"&&v.includes(F)?+A:A,T},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(x).reduce((T,[F,M])=>((F in $)||(T[F]=M),T),{})},types:c.types||{},target_session_attrs:oG(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:aG(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...RR(c.types)}}function oG(n,i,o){let c=n.target_session_attrs||i.searchParams.get("target_session_attrs")||o.PGTARGETSESSIONATTRS;if(!c||["read-write","read-only","primary","standby","prefer-standby"].includes(c))return c;throw new Error("target_session_attrs "+c+" is not supported")}function cG(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function pG(){return 60*(30+Math.random()*30)}function aG(n){return{undefined:n.undefined,column:{from:typeof n.column==="function"?n.column:n.column&&n.column.from,to:n.column&&n.column.to},value:{from:typeof n.value==="function"?n.value:n.value&&n.value.from,to:n.value&&n.value.to},row:{from:typeof n.row==="function"?n.row:n.row&&n.row.from,to:n.row&&n.row.to}}}function xG(n){if(!n||typeof n!=="string")return{url:{searchParams:new Map}};let i=n;i=i.slice(i.indexOf("://")+3).split(/[?/]/)[0],i=decodeURIComponent(i.slice(i.indexOf("@")+1));let o=new URL(n.replace(i,i.split(",")[0]));return{url:{username:decodeURIComponent(o.username),password:decodeURIComponent(o.password),host:o.host,hostname:o.hostname,port:o.port,pathname:o.pathname,searchParams:o.searchParams},multihost:i.indexOf(",")>-1&&i}}function mG(){try{return e9.userInfo().username}catch(n){return process.env.USERNAME||"runner"}}class gm extends Qi{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[J]="PgDelete";config;where(n){return this.config.where=n,this}returning(n=this.config.table[L.Symbol.Columns]){return this.config.returning=ei(n),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Un.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}execute=(n)=>{return Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})};$dynamic(){return this}}class dm{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[J]="PgInsertBuilder";values(n){if(n=Array.isArray(n)?n:[n],n.length===0)throw new Error("values() must be called with at least one value");let i=n.map((o)=>{let c={},p=this.table[L.Symbol.Columns];for(let a of Object.keys(o)){let x=o[a];c[a]=z(x,k)?x:new Li(x,p[a])}return c});return new VR(this.table,i,this.session,this.dialect,this.withList)}}class VR extends Qi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p}}static[J]="PgInsert";config;returning(n=this.config.table[L.Symbol.Columns]){return this.config.returning=ei(n),this}onConflictDoNothing(n={}){if(n.target===void 0)this.config.onConflict=S`do nothing`;else{let i="";i=Array.isArray(n.target)?n.target.map((c)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(c))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target));let o=n.where?S` where ${n.where}`:void 0;this.config.onConflict=S`(${S.raw(i)})${o} do nothing`}return this}onConflictDoUpdate(n){if(n.where&&(n.targetWhere||n.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let i=n.where?S` where ${n.where}`:void 0,o=n.targetWhere?S` where ${n.targetWhere}`:void 0,c=n.setWhere?S` where ${n.setWhere}`:void 0,p=this.dialect.buildUpdateSet(this.config.table,rx(this.config.table,n.set)),a="";return a=Array.isArray(n.target)?n.target.map((x)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(x))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target)),this.config.onConflict=S`(${S.raw(a)})${o} do update set ${p}${i}${c}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Un.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}execute=(n)=>{return Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})};$dynamic(){return this}}function lG(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function fG(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((o,c,p)=>{let a=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+a},"")}function vG(n){return n}class gv{static[J]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?lG:n==="camelCase"?fG:vG}getColumnCasing(n){if(!n.keyAsName)return n.name;let i=n.table[L.Symbol.Schema]??"public",o=n.table[L.Symbol.OriginalName],c=`${i}.${o}.${n.name}`;if(!this.cache[c])this.cacheTable(n.table);return this.cache[c]}cacheTable(n){let i=n[L.Symbol.Schema]??"public",o=n[L.Symbol.OriginalName],c=`${i}.${o}`;if(!this.cachedTables[c]){for(let p of Object.values(n[L.Symbol.Columns])){let a=`${c}.${p.name}`;this.cache[a]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class ix extends Vi{static[J]="PgViewBase"}class tc{static[J]="PgDialect";casing;constructor(n){this.casing=new gv(n?.casing)}async migrate(n,i,o){let c=typeof o==="string"?"__drizzle_migrations":o.migrationsTable??"__drizzle_migrations",p=typeof o==="string"?"drizzle":o.migrationsSchema??"drizzle",a=S`
58
+ CREATE TABLE IF NOT EXISTS ${S.identifier(p)}.${S.identifier(c)} (
59
59
  id SERIAL PRIMARY KEY,
60
60
  hash text NOT NULL,
61
61
  created_at bigint
62
62
  )
63
- `;await i.execute(A`CREATE SCHEMA IF NOT EXISTS ${A.identifier(p)}`),await i.execute(a);let x=(await i.all(A`select id, hash, created_at from ${A.identifier(p)}.${A.identifier(c)} order by created_at desc limit 1`))[0];await i.transaction(async(l)=>{for await(let f of n)if(!x||Number(x.created_at)<f.folderMillis){for(let $ of f.sql)await l.execute(A.raw($));await l.execute(A`insert into ${A.identifier(p)}.${A.identifier(c)} ("hash", "created_at") values(${f.hash}, ${f.folderMillis})`)}})}escapeName(n){return`"${n}"`}escapeParam(n){return`\$${n+1}`}escapeString(n){return`'${n.replace(/'/g,"''")}'`}buildWithCTE(n){if(!n?.length)return;let i=[A`with `];for(let[o,c]of n.entries())if(i.push(A`${A.identifier(c._.alias)} as (${c._.sql})`),o<n.length-1)i.push(A`, `);return i.push(A` `),A.join(i)}buildDeleteQuery({table:n,where:i,returning:o,withList:c}){let p=this.buildWithCTE(c),a=o?A` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,m=i?A` where ${i}`:void 0;return A`${p}delete from ${n}${m}${a}`}buildUpdateSet(n,i){let o=n[t.Symbol.Columns],c=Object.keys(o).filter((a)=>i[a]!==void 0||o[a]?.onUpdateFn!==void 0),p=c.length;return A.join(c.flatMap((a,m)=>{let x=o[a],l=i[a]??A.param(x.onUpdateFn(),x),f=A`${A.identifier(this.casing.getColumnCasing(x))} = ${l}`;if(m<p-1)return[f,A.raw(", ")];return[f]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p}){let a=this.buildWithCTE(p),m=this.buildUpdateSet(n,i),x=c?A` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,l=o?A` where ${o}`:void 0;return A`${a}update ${n} set ${m}${l}${x}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},a)=>{let m=[];if(Y(p,C.Aliased)&&p.isSelectionField)m.push(A.identifier(p.fieldAlias));else if(Y(p,C.Aliased)||Y(p,C)){let x=Y(p,C.Aliased)?p.sql:p;if(i)m.push(new C(x.queryChunks.map((l)=>{if(Y(l,y))return A.identifier(this.casing.getColumnCasing(l));return l})));else m.push(x);if(Y(p,C.Aliased))m.push(A` as ${A.identifier(p.fieldAlias)}`)}else if(Y(p,Vn))if(i)m.push(A.identifier(this.casing.getColumnCasing(p)));else m.push(p);if(a<o-1)m.push(A`, `);return m});return A.join(c)}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:a,joins:m,orderBy:x,groupBy:l,limit:f,offset:$,lockingClause:v,distinct:w,setOperators:F}){let M=o??di(i);for(let cn of M)if(Y(cn.field,Vn)&&gi(cn.field.table)!==(Y(a,li)?a._.alias:Y(a,ga)?a[Dn].name:Y(a,C)?void 0:gi(a))&&!((xn)=>m?.some(({alias:sn})=>sn===(xn[t.Symbol.IsAlias]?gi(xn):xn[t.Symbol.BaseName])))(cn.field.table)){let xn=gi(cn.field.table);throw new Error(`Your "${cn.path.join("->")}" field references a column "${xn}"."${cn.field.name}", but the table "${xn}" is not part of the query! Did you forget to join it?`)}let J=!m||m.length===0,X=this.buildWithCTE(n),G;if(w)G=w===!0?A` distinct`:A` distinct on (${A.join(w.on,A`, `)})`;let u=this.buildSelection(M,{isSingleTable:J}),Q=(()=>{if(Y(a,t)&&a[t.Symbol.OriginalName]!==a[t.Symbol.Name]){let cn=A`${A.identifier(a[t.Symbol.OriginalName])}`;if(a[t.Symbol.Schema])cn=A`${A.identifier(a[t.Symbol.Schema])}.${cn}`;return A`${cn} ${A.identifier(a[t.Symbol.Name])}`}return a})(),V=[];if(m)for(let[cn,xn]of m.entries()){if(cn===0)V.push(A` `);let sn=xn.table,_i=xn.lateral?A` lateral`:void 0;if(Y(sn,wo)){let E=sn[wo.Symbol.Name],k=sn[wo.Symbol.Schema],wn=sn[wo.Symbol.OriginalName],zn=E===wn?void 0:xn.alias;V.push(A`${A.raw(xn.joinType)} join${_i} ${k?A`${A.identifier(k)}.`:void 0}${A.identifier(wn)}${zn&&A` ${A.identifier(zn)}`} on ${xn.on}`)}else if(Y(sn,si)){let E=sn[Dn].name,k=sn[Dn].schema,wn=sn[Dn].originalName,zn=E===wn?void 0:xn.alias;V.push(A`${A.raw(xn.joinType)} join${_i} ${k?A`${A.identifier(k)}.`:void 0}${A.identifier(wn)}${zn&&A` ${A.identifier(zn)}`} on ${xn.on}`)}else V.push(A`${A.raw(xn.joinType)} join${_i} ${sn} on ${xn.on}`);if(cn<m.length-1)V.push(A` `)}let z=A.join(V),R=c?A` where ${c}`:void 0,O=p?A` having ${p}`:void 0,b;if(x&&x.length>0)b=A` order by ${A.join(x,A`, `)}`;let H;if(l&&l.length>0)H=A` group by ${A.join(l,A`, `)}`;let K=typeof f==="object"||typeof f==="number"&&f>=0?A` limit ${f}`:void 0,L=$?A` offset ${$}`:void 0,_=A.empty();if(v){let cn=A` for ${A.raw(v.strength)}`;if(v.config.of)cn.append(A` of ${A.join(Array.isArray(v.config.of)?v.config.of:[v.config.of],A`, `)}`);if(v.config.noWait)cn.append(A` no wait`);else if(v.config.skipLocked)cn.append(A` skip locked`);_.append(cn)}let q=A`${X}select${G} ${u} from ${Q}${z}${R}${H}${O}${b}${K}${L}${_}`;if(F.length>0)return this.buildSetOperations(q,F);return q}buildSetOperations(n,i){let[o,...c]=i;if(!o)throw new Error("Cannot pass undefined values to any set operator");if(c.length===0)return this.buildSetOperationQuery({leftSelect:n,setOperator:o});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:n,setOperator:o}),c)}buildSetOperationQuery({leftSelect:n,setOperator:{type:i,isAll:o,rightSelect:c,limit:p,orderBy:a,offset:m}}){let x=A`(${n.getSQL()}) `,l=A`(${c.getSQL()})`,f;if(a&&a.length>0){let F=[];for(let M of a)if(Y(M,y))F.push(A.identifier(M.name));else if(Y(M,C)){for(let J=0;J<M.queryChunks.length;J++){let X=M.queryChunks[J];if(Y(X,y))M.queryChunks[J]=A.identifier(X.name)}F.push(A`${M}`)}else F.push(A`${M}`);f=A` order by ${A.join(F,A`, `)} `}let $=typeof p==="object"||typeof p==="number"&&p>=0?A` limit ${p}`:void 0,v=A.raw(`${i} ${o?"all ":""}`),w=m?A` offset ${m}`:void 0;return A`${x}${v}${l}${f}${$}${w}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p}){let a=[],m=n[t.Symbol.Columns],x=Object.entries(m).filter(([F,M])=>!M.shouldDisableInsert()),l=x.map(([,F])=>A.identifier(this.casing.getColumnCasing(F)));for(let[F,M]of i.entries()){let J=[];for(let[X,G]of x){let u=M[X];if(u===void 0||Y(u,Bi)&&u.value===void 0)if(G.defaultFn!==void 0){let Q=G.defaultFn(),V=Y(Q,C)?Q:A.param(Q,G);J.push(V)}else if(!G.default&&G.onUpdateFn!==void 0){let Q=G.onUpdateFn(),V=Y(Q,C)?Q:A.param(Q,G);J.push(V)}else J.push(A`default`);else J.push(u)}if(a.push(J),F<i.length-1)a.push(A`, `)}let f=this.buildWithCTE(p),$=A.join(a),v=c?A` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,w=o?A` on conflict ${o}`:void 0;return A`${f}insert into ${n} ${l} values ${$}${w}${v}`}buildRefreshMaterializedViewQuery({view:n,concurrently:i,withNoData:o}){let c=i?A` concurrently`:void 0,p=o?A` with no data`:void 0;return A`refresh materialized view${c} ${n}${p}`}prepareTyping(n){if(Y(n,Pm)||Y(n,em))return"json";else if(Y(n,gm))return"decimal";else if(Y(n,dm))return"time";else if(Y(n,nx)||Y(n,ix))return"timestamp";else if(Y(n,rm)||Y(n,Zm))return"date";else if(Y(n,ox))return"uuid";else return"none"}sqlToQuery(n,i){return n.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:i})}buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:c,tableConfig:p,queryConfig:a,tableAlias:m,nestedQueryRelation:x,joinOn:l}){let f=[],$,v,w=[],F,M=[];if(a===!0)f=Object.entries(p.columns).map(([G,u])=>({dbKey:u.name,tsKey:G,field:Oo(u,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let X=Object.fromEntries(Object.entries(p.columns).map(([R,O])=>[R,Oo(O,m)]));if(a.where){let R=typeof a.where==="function"?a.where(X,Z1()):a.where;F=R&&ua(R,m)}let G=[],u=[];if(a.columns){let R=!1;for(let[O,b]of Object.entries(a.columns)){if(b===void 0)continue;if(O in p.columns){if(!R&&b===!0)R=!0;u.push(O)}}if(u.length>0)u=R?u.filter((O)=>a.columns?.[O]===!0):Object.keys(p.columns).filter((O)=>!u.includes(O))}else u=Object.keys(p.columns);for(let R of u){let O=p.columns[R];G.push({tsKey:R,value:O})}let Q=[];if(a.with)Q=Object.entries(a.with).filter((R)=>!!R[1]).map(([R,O])=>({tsKey:R,queryConfig:O,relation:p.relations[R]}));let V;if(a.extras){V=typeof a.extras==="function"?a.extras(X,{sql:A}):a.extras;for(let[R,O]of Object.entries(V))G.push({tsKey:R,value:Ff(O,m)})}for(let{tsKey:R,value:O}of G)f.push({dbKey:Y(O,C.Aliased)?O.fieldAlias:p.columns[R].name,tsKey:R,field:Y(O,Vn)?Oo(O,m):O,relationTableTsKey:void 0,isJson:!1,selection:[]});let z=typeof a.orderBy==="function"?a.orderBy(X,q1()):a.orderBy??[];if(!Array.isArray(z))z=[z];w=z.map((R)=>{if(Y(R,Vn))return Oo(R,m);return ua(R,m)}),$=a.limit,v=a.offset;for(let{tsKey:R,queryConfig:O,relation:b}of Q){let H=P1(i,o,b),K=Hc(b.referencedTable),L=o[K],_=`${m}_${R}`,q=Ec(...H.fields.map((sn,_i)=>Ho(Oo(H.references[_i],_),Oo(sn,m)))),cn=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[L],tableConfig:i[L],queryConfig:Y(b,mc)?O===!0?{limit:1}:{...O,limit:1}:O,tableAlias:_,joinOn:q,nestedQueryRelation:b}),xn=A`${A.identifier(_)}.${A.identifier("data")}`.as(R);M.push({on:A`true`,table:new li(cn.sql,{},_),alias:_,joinType:"left",lateral:!0}),f.push({dbKey:R,tsKey:R,field:xn,relationTableTsKey:L,isJson:!0,selection:cn.selection})}}if(f.length===0)throw new Im({message:`No fields selected for table "${p.tsName}" ("${m}")`});let J;if(F=Ec(l,F),x){let X=A`json_build_array(${A.join(f.map(({field:Q,tsKey:V,isJson:z})=>z?A`${A.identifier(`${m}_${V}`)}.${A.identifier("data")}`:Y(Q,C.Aliased)?Q.sql:Q),A`, `)})`;if(Y(x,Ha))X=A`coalesce(json_agg(${X}${w.length>0?A` order by ${A.join(w,A`, `)}`:void 0}), '[]'::json)`;let G=[{dbKey:"data",tsKey:"data",field:X.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:f}];if($!==void 0||v!==void 0||w.length>0)J=this.buildSelectQuery({table:hm(c,m),fields:{},fieldsFlat:[{path:[],field:A.raw("*")}],where:F,limit:$,offset:v,orderBy:w,setOperators:[]}),F=void 0,$=void 0,v=void 0,w=[];else J=hm(c,m);J=this.buildSelectQuery({table:Y(J,wo)?J:new li(J,{},m),fields:{},fieldsFlat:G.map(({field:Q})=>({path:[],field:Y(Q,Vn)?Oo(Q,m):Q})),joins:M,where:F,limit:$,offset:v,orderBy:w,setOperators:[]})}else J=this.buildSelectQuery({table:hm(c,m),fields:{},fieldsFlat:f.map(({field:X})=>({path:[],field:Y(X,Vn)?Oo(X,m):X})),joins:M,where:F,limit:$,offset:v,orderBy:w,setOperators:[]});return{tableTsKey:p.tsName,sql:J,selection:f}}}class Vi{static[S]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===Dn)return{...n[Dn],selectedFields:new Proxy(n[Dn].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(Y(n,li)?n._.selectedFields:Y(n,si)?n[Dn].selectedFields:n)[i];if(Y(c,C.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(Y(c,C)){if(this.config.sqlBehavior==="sql")return c;throw new Error(`You tried to reference "${i}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(Y(c,Vn)){if(this.config.alias)return new Proxy(c,new wp(new Proxy(c.table,new za(this.config.alias,this.config.replaceOriginalName??!1))));return c}if(typeof c!=="object"||c===null)return c;return new Proxy(c,new Vi(this.config))}}class r${static[S]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Ei{static[S]="PgSelectBuilder";fields;session;dialect;withList=[];distinct;constructor(n){if(this.fields=n.fields,this.session=n.session,this.dialect=n.dialect,n.withList)this.withList=n.withList;this.distinct=n.distinct}from(n){let i=!!this.fields,o;if(this.fields)o=this.fields;else if(Y(n,li))o=Object.fromEntries(Object.keys(n._.selectedFields).map((c)=>[c,n[c]]));else if(Y(n,ga))o=n[Dn].selectedFields;else if(Y(n,C))o={};else o=dw(n);return new Z$({table:n,fields:o,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class XM extends r${static[S]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:a,distinct:m}){super();this.config={withList:a,table:n,fields:{...i},distinct:m,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=Xf(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=Xf(i);if(typeof p==="string"&&this.config.joins?.some((a)=>a.alias===p))throw new Error(`Alias "${p}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof c==="string")this.config.fields={[c]:this.config.fields};if(typeof p==="string"&&!Y(i,C)){let a=Y(i,li)?i._.selectedFields:Y(i,si)?i[Dn].selectedFields:i[t.Symbol.Columns];this.config.fields[p]=a}}if(typeof o==="function")o=o(new Proxy(this.config.fields,new Vi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:o,table:i,joinType:n,alias:p}),typeof p==="string")switch(n){case"left":{this.joinsNotNullableMap[p]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([a])=>[a,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([a])=>[a,!1])),this.joinsNotNullableMap[p]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");createSetOperator(n,i){return(o)=>{let c=typeof o==="function"?o(dG()):o;if(!Wf(this.getSelectedFields(),c.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:n,isAll:i,rightSelect:c}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);intersectAll=this.createSetOperator("intersect",!0);except=this.createSetOperator("except",!1);exceptAll=this.createSetOperator("except",!0);addSetOperators(n){return this.config.setOperators.push(...n),this}where(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new Vi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=n,this}having(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new Vi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=n,this}groupBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new Vi({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=n;return this}orderBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new Vi({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),o=Array.isArray(i)?i:[i];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=o;else this.config.orderBy=o}else{let i=n;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=i;else this.config.orderBy=i}return this}limit(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=n;else this.config.limit=n;return this}offset(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=n;else this.config.offset=n;return this}for(n,i={}){return this.config.lockingClause={strength:n,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(n){return new Proxy(new li(this.getSQL(),this.config.fields,n),new Vi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Vi({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class Z$ extends XM{static[S]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Qn.startActiveSpan("drizzle.prepareQuery",()=>{let a=di(o.fields),m=i.prepareQuery(c.sqlToQuery(this.getSQL()),a,n,!0);return m.joinsNotNullableMap=p,m})}prepare(n){return this._prepare(n)}execute=(n)=>{return Qn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})}}gw(Z$,[Yi]);function Zp(n,i){return(o,c,...p)=>{let a=[c,...p].map((m)=>({type:n,isAll:i,rightSelect:m}));for(let m of a)if(!Wf(o.getSelectedFields(),m.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return o.addSetOperators(a)}}var dG=()=>({union:n9,unionAll:i9,intersect:o9,intersectAll:c9,except:p9,exceptAll:a9}),n9=Zp("union",!1),i9=Zp("union",!0),o9=Zp("intersect",!1),c9=Zp("intersect",!0),p9=Zp("except",!1),a9=Zp("except",!0);class q${static[S]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=Y(n,rc)?n:void 0,this.dialectConfig=Y(n,rc)?void 0:n}$with(n){let i=this;return{as(o){if(typeof o==="function")o=o(i);return new Proxy(new Ga(o.getSQL(),o.getSelectedFields(),n,!0),new Vi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}with(...n){let i=this;function o(a){return new Ei({fields:a??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(a){return new Ei({fields:a??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(a,m){return new Ei({fields:m??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:a}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Ei({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Ei({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Ei({fields:i??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:n}})}getDialect(){if(!this.dialect)this.dialect=new rc(this.dialectConfig);return this.dialect}}class e$ extends Yi{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[S]="PgRefreshMaterializedView";config;concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Qn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}execute=(n)=>{return Qn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})}}class qx{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[S]="PgUpdateBuilder";set(n){return new GM(this.table,km(this.table,n),this.session,this.dialect,this.withList)}}class GM extends Yi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p}}static[S]="PgUpdate";config;where(n){return this.config.where=n,this}returning(n=this.config.table[t.Symbol.Columns]){return this.config.returning=di(n),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)}prepare(n){return this._prepare(n)}execute=(n)=>{return this._prepare().execute(n)};$dynamic(){return this}}class da extends C{constructor(n){super(da.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=da.buildCount(n.source,n.filters)}sql;static[S]="PgCountBuilder";[Symbol.toStringTag]="PgCountBuilder";session;static buildEmbeddedCount(n,i){return A`(select count(*) from ${n}${A.raw(" where ").if(i)}${i})`}static buildCount(n,i){return A`select count(*) as count from ${n}${A.raw(" where ").if(i)}${i};`}then(n,i){return Promise.resolve(this.session.count(this.sql)).then(n,i)}catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}}class g${constructor(n,i,o,c,p,a,m){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=a,this.session=m}static[S]="PgRelationalQueryBuilder";findMany(n){return new P$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new P$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class P$ extends Yi{constructor(n,i,o,c,p,a,m,x,l){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=a,this.session=m,this.config=x,this.mode=l}static[S]="PgRelationalQuery";_prepare(n){return Qn.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let a=c.map((m)=>cx(this.schema,this.tableConfig,m,i.selection,p));if(this.mode==="first")return a[0];return a})})}prepare(n){return this._prepare(n)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let n=this._getQuery(),i=this.dialect.sqlToQuery(n.sql);return{query:n,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}execute(){return Qn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute()})}}class d$ extends Yi{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[S]="PgRaw";getSQL(){return this.sql}getQuery(){return this.query}mapResult(n,i){return i?this.mapBatchResult(n):n}_prepare(){return this}isResponseInArrayMode(){return!1}}class nm{constructor(n,i,o){if(this.dialect=n,this.session=i,this._=o?{schema:o.schema,fullSchema:o.fullSchema,tableNamesMap:o.tableNamesMap,session:i}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:i},this.query={},this._.schema)for(let[c,p]of Object.entries(this._.schema))this.query[c]=new g$(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[S]="PgDatabase";query;$with(n){let i=this;return{as(o){if(typeof o==="function")o=o(new q$(i.dialect));return new Proxy(new Ga(o.getSQL(),o.getSelectedFields(),n,!0),new Vi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}$count(n,i){return new da({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(l){return new Ei({fields:l??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(l){return new Ei({fields:l??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(l,f){return new Ei({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:l}})}function a(l){return new qx(l,i.session,i.dialect,n)}function m(l){return new Zx(l,i.session,i.dialect,n)}function x(l){return new rx(l,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:a,insert:m,delete:x}}select(n){return new Ei({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Ei({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Ei({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new qx(n,this.session,this.dialect)}insert(n){return new Zx(n,this.session,this.dialect)}delete(n){return new rx(n,this.session,this.dialect)}refreshMaterializedView(n){return new e$(n,this.session,this.dialect)}execute(n){let i=typeof n==="string"?A.raw(n):n.getSQL(),o=this.dialect.sqlToQuery(i),c=this.session.prepareQuery(o,void 0,void 0,!1);return new d$(()=>c.execute(),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class zM{constructor(n,i){this.unique=n,this.name=i}static[S]="PgIndexBuilderOn";on(...n){return new ex(n.map((i)=>{if(Y(i,C))return i;i=i;let o=new Xa(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=JSON.parse(JSON.stringify(i.defaultConfig)),o}),this.unique,!1,this.name)}onOnly(...n){return new ex(n.map((i)=>{if(Y(i,C))return i;i=i;let o=new Xa(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new ex(i.map((o)=>{if(Y(o,C))return o;o=o;let c=new Xa(o.name,!!o.keyAsName,o.columnType,o.indexConfig);return o.indexConfig=JSON.parse(JSON.stringify(o.defaultConfig)),c}),this.unique,!0,this.name,n)}}class ex{static[S]="PgIndexBuilder";config;constructor(n,i,o,c,p="btree"){this.config={name:c,columns:n,unique:i,only:o,method:p}}concurrently(){return this.config.concurrently=!0,this}with(n){return this.config.with=n,this}where(n){return this.config.where=n,this}build(n){return new uM(this.config,n)}}class uM{static[S]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function nv(n){return new zM(!0,n)}class iv{constructor(n){this.query=n}getQuery(){return this.query}mapResult(n,i){return n}static[S]="PgPreparedQuery";joinsNotNullableMap}class ov{constructor(n){this.dialect=n}static[S]="PgSession";execute(n){return Qn.startActiveSpan("drizzle.operation",()=>{return Qn.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).execute()})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n){let i=await this.execute(n);return Number(i[0].count)}}class cv extends nm{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[S]="PgTransaction";rollback(){throw new Rf}getTransactionConfigSQL(n){let i=[];if(n.isolationLevel)i.push(`isolation level ${n.isolationLevel}`);if(n.accessMode)i.push(n.accessMode);if(typeof n.deferrable==="boolean")i.push(n.deferrable?"deferrable":"not deferrable");return A.raw(i.join(" "))}setTransaction(n){return this.session.execute(A`set transaction ${this.getTransactionConfigSQL(n)}`)}}class YM extends iv{constructor(n,i,o,c,p,a,m){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=a,this.customResultMapper=m}static[S]="PostgresJsPreparedQuery";async execute(n={}){return Qn.startActiveSpan("drizzle.execute",async(i)=>{let o=Jf(this.params,n);i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o);let{fields:c,queryString:p,client:a,joinsNotNullableMap:m,customResultMapper:x}=this;if(!c&&!x)return Qn.startActiveSpan("drizzle.driver.execute",()=>{return a.unsafe(p,o)});let l=await Qn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),a.unsafe(p,o).values()});return Qn.startActiveSpan("drizzle.mapResponse",()=>{return x?x(l):l.map((f)=>Pw(c,f,m))})})}all(n={}){return Qn.startActiveSpan("drizzle.execute",async(i)=>{let o=Jf(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),Qn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.client.unsafe(this.queryString,o)})})}isResponseInArrayMode(){return this._isResponseInArrayMode}}class im extends ov{constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new Kf}static[S]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new YM(this.client,n.sql,n.params,this.logger,i,c,p)}query(n,i){return this.logger.logQuery(n,i),this.client.unsafe(n,i).values()}queryObjects(n,i){return this.client.unsafe(n,i)}transaction(n,i){return this.client.begin(async(o)=>{let c=new im(o,this.dialect,this.schema,this.options),p=new pv(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class pv extends cv{constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[S]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new im(i,this.dialect,this.schema,this.session.options),c=new pv(this.dialect,o,this.schema);return n(c)})}}class OM extends nm{static[S]="PostgresJsDatabase"}function qp(n,i={}){let o=(l)=>l;for(let l of["1184","1082","1083","1114"])n.options.parsers[l]=o,n.options.serializers[l]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new rc({casing:i.casing}),p;if(i.logger===!0)p=new Mf;else if(i.logger!==!1)p=i.logger;let a;if(i.schema){let l=e1(i.schema,g1);a={fullSchema:i.schema,schema:l.tables,tableNamesMap:l.tableNamesMap}}let m=new im(n,c,a,{logger:p}),x=new OM(c,m,a);return x.$client=n,x}function Px(...n){if(typeof n[0]==="string"){let i=rp(n[0]);return qp(i,n[1])}if(nS(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return qp(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:a,...m}=i,x=rp(a,m);return qp(x,c)}let p=rp(i);return qp(p,c)}return qp(n[0],n[1])}((n)=>{function i(o){return qp({},o)}n.mock=i})(Px||(Px={}));var mv={};D4(mv,{users:()=>Xo,userChanges:()=>x9,untrackedUserColumnNames:()=>m9,twoFactorMethod:()=>sM,trackedUserColumnName:()=>QM,trackableUserColumnNames:()=>EM,role:()=>HM,players:()=>av,passwordResetAttempts:()=>l9,loginHistory:()=>ep,games:()=>gx,banishedIps:()=>dx});var HM=Lm("role",["admin","user"]),Xo=ac("users",{id:Ni().primaryKey().defaultRandom(),username:fi({length:16}).notNull(),email:fi({length:254}).notNull(),hash:fi({length:64}).notNull(),salt:fi({length:36}).notNull(),createdAt:To({withTimezone:!0}).notNull().defaultNow(),createdIp:fi({length:45}).notNull(),isActive:Ya().notNull().default(!1),verifiedAt:To({withTimezone:!0}),userRole:HM().default("user")},(n)=>({usersUsernameUnique:nv().on(n.username),usersEmailUnique:nv().on(n.email)})),m9=["id","createdAt","createdIp","isActive","salt","verifiedAt"],EM=["username","email","hash","userRole"],QM=Lm("trackedUserColumnName",EM),x9=ac("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Xo.id),changedAt:To({withTimezone:!0}).notNull().defaultNow(),changedIp:fi({length:45}).notNull(),changedColumn:QM().notNull(),oldValue:fi({length:255}),newValue:fi({length:255})}),gx=ac("games",{id:Ni("id").primaryKey().defaultRandom()}),av=ac("players",{userId:Ni().notNull().references(()=>Xo.id),gameId:Ni().notNull().references(()=>gx.id),score:qm().notNull()},(n)=>({pk:C1({columns:[n.userId,n.gameId]})})),ep=ac("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>Xo.id),loginTime:To({withTimezone:!0}).notNull().defaultNow(),ipAddress:fi({length:45}).notNull(),userAgent:fi({length:1024}),successful:Ya().notNull().default(!1)}),sM=Lm("twoFactorMethod",["email","phone"]),l9=ac("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Xo.id),requestedIp:fi({length:45}).notNull(),requestedAt:To({withTimezone:!0}).notNull().defaultNow(),succeededIp:fi({length:45}),succeededAt:To({withTimezone:!0}),verificationMethod:sM().notNull()}),dx=ac("banishedIps",{ip:fi({length:45}).primaryKey(),reason:fi({length:2048}).notNull(),banishedAt:To({withTimezone:!0}).notNull().defaultNow(),banishedUntil:To({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class xv{options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(f9.resolve(__dirname,"notify_update.sql"));let n=[gi(Xo),gi(gx),gi(av)];await this.sql`SELECT create_notify_triggers(${this.sql.array(n)})`,await this.sql.listen("table_update",(i)=>{let o=i.split(","),c=o[0],p=o[1],a=`${c}("${p}")`;if(this.observers.has(a))this.observers.get(a).next(a)})}constructor(n={host:qn.POSTGRES_HOST,port:qn.POSTGRES_PORT,user:qn.POSTGRES_USER,password:qn.POSTGRES_PASSWORD,database:qn.POSTGRES_DATABASE}){this.options=n,this.sql=rp(n),this.drizzle=Px(this.sql,{schema:mv,logger:!0})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new mn);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as $9}from"crypto";function lv(n){let i=$9("sha256").update(n).digest("hex");return`${i.substring(0,8)}-${i.substring(8,12)}-${i.substring(12,16)}-${i.substring(16,20)}-${i.substring(20,32)}`}var UM=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"];var v9=3,T9=15,w9=/^[a-zA-Z0-9_-]+$/,_M=Gn.string().min(v9).max(T9).regex(w9),bM=20,VM={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function S9(n){let i="";for(let o of n)if(o in VM)i+=VM[o];else i+=o;return i}function A9(n){let i=n.toLocaleLowerCase(),o=S9(i);for(let c of UM){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function J9(n){let i=new Set(n).size;return n.length*Math.log2(i)}function F9(n){let i=0,o=100;if(A9(n))i-=o;return i+=J9(n)*0.5,Math.max(i,0)}var yM=Gn.string().refine((n)=>{return F9(n)>=bM},{message:`Password does not meet the minimum complexity of ${bM}.`}).brand("password"),jM=Gn.object({username:_M,password:yM}).strict(),R9=Gn.string().email().brand("email"),BM=Gn.object({username:_M,password:yM,email:R9}).strict();var nl={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},fv=Xv(nl).map(([n])=>Gn.literal(Number(n))),M9=Gn.union([fv[0],fv[1],...fv]),NM=Gn.tuple([M9,Gn.string()]);var LM=Po({key:"count",default:0}),K9=Kc({key:"incrementTX",do:({set:n})=>{n(LM,(i)=>i+1)}}),tM=aT({key:"countContinuity",config:(n)=>n.add(LM).add(K9)});var hM=O$(Dc,"backend.worker.game.bun",Mn),Zc=new xv;on.STORE.loggers[0]=new Rc("info",void 0,Mn);var YD=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new IM.CronJob("00 15 * * * *",()=>{O$(Dc,"backend.worker.tribunal.bun",Mn)}),n.start(),process.on("exit",()=>{n.stop(),Mn.info("\u231B tribunal daily cronjob stopped")}),Mn.info("\u23F3 tribunal daily cronjob started");return n})();function G9(n){if(Y$)return X9(Y$,n);return W9({},n)}var CM=G9((n,i)=>{let o;n.on("data",(c)=>(o??=[]).push(c)).on("end",async()=>{let c=n.headers.authorization;try{if(typeof n.url==="undefined")throw[400,"No URL"];let p=n.socket.remoteAddress;if(!p)throw[400,"No IP address"];let a=new Date,m=new URL(n.url,qn.VITE_BACKEND_ORIGIN);Mn.info(a,p,n.method,m.pathname);let x=await Zc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Ho(dx.ip,p)}),l=x?.banishedUntil===null,f=x?.banishedUntil&&x.banishedUntil>a;if(l||f){Mn.info(`\uD83D\uDE45 request from banned ip ${p}`);return}switch(n.method){case"POST":if(!o)throw[400,"No data received"];switch(m.pathname){case`/sign-up-${lv("sign-up")}`:{let $=Buffer.concat(o).toString(),v=JSON.parse($),w=BM.safeParse(v);if(!w.success){Mn.warn("signup parsed",w.error.issues);return}let{username:F,password:M,email:J}=w.data;if(Mn.info(`\uD83D\uDD11 attempting to sign up: ${F}`),await Zc.drizzle.query.users.findFirst({columns:{id:!0},where:Ho(Xo.email,J)}))throw[400,"User already exists"];let G=crypto.randomUUID(),u=DM("sha256").update(M+G).digest("hex");await Zc.drizzle.insert(Xo).values({username:F,email:J,hash:u,salt:G,createdIp:p}),Mn.info(`\uD83D\uDD11 user created: ${F}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end(nl[201])}break;case`/login-${lv("login")}`:{let $=!1,v=null;try{let w=new Date(+a-600000);Mn.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:w,now:a});let F=await Zc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Ec(Ho(ep.ipAddress,p),Ho(ep.successful,!1),Cm(ep.loginTime,w)),limit:10});Mn.info(`\uD83D\uDD11 ${F.length}/10 recent failed logins from ${p}`);let M=10-F.length;if(M<1)throw Mn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await Zc.drizzle.insert(dx).values({ip:p,reason:"Too many recent login attempts.",banishedAt:a,banishedUntil:new Date(+a+86400000)}),[429,"Too many recent login attempts."];let J=Buffer.concat(o).toString(),X=JSON.parse(J),G=jM.safeParse(X);if(!G.success)throw Mn.warn("login parsed",G.error.issues),[400,`${M} attempts remaining.`];let{username:u,password:Q}=G.data,V=await Zc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Ho(Xo.username,u)});if(Mn.info("\uD83D\uDD11 login attempt as user",u),!V)throw Mn.info(`\uD83D\uDD11 user ${u} does not exist`),[400,`${M} attempts remaining.`];let{hash:z,salt:R}=V;if(v=V.id,DM("sha256").update(Q+R).digest("hex")===z){let b=crypto.randomUUID(),H=_x.get(u);if(!H)H=new Map,_x.set(u,H);H.set(b,Number(a)),$=!0,Mn.info("\uD83D\uDD11 login successful as",u),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end(`${u} ${b}`)}}finally{await Zc.drizzle.insert(ep).values({userId:v,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),Mn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}}}}catch(p){let a=NM.safeParse(p);if(a.success){let[m,x]=a.data,f=`${nl[m]}. ${x}`;Mn.info(`\u274C ${m}: ${f}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end(f)}else Mn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),$v=CM.listen(qn.BACKEND_PORT).address(),z9=typeof $v==="string"?null:$v===null?null:$v.port;if(z9===null)throw new Error("Could not determine port for test server");new BR(CM,{cors:{origin:qn.FRONTEND_ORIGINS,methods:["GET","POST"]}}).use((n,i)=>{let{username:o,sessionKey:c}=n.handshake.auth;if(!(o&&c)){i(new Error("No auth header provided"));return}let p=`user::${o}`,a=`socket::${n.id}`;if(_x.get(o)?.has(c)){let x=Jn(on.STORE,Mm,a);un(on.STORE,x,n),Fc(Wc,(l)=>{l.set(p,a)},on.STORE),un(on.STORE,Ql,(l)=>l.add(p)),un(on.STORE,El,(l)=>l.add(a)),Mn.info(`${o} connected on ${n.id}`),i()}else Mn.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=lT({socket:n,store:on.STORE})(tM);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=np(Wc,c,on.STORE).userKeyOfSocket,a=Wn(on.STORE,p);if(Fc(Wc,(m)=>{m.delete(c)},on.STORE),a)un(on.STORE,Ql,(m)=>(m.delete(a),m));un(on.STORE,El,(m)=>(m.delete(c),m)),Mn.info(`${n.id} disconnected`),o()})});Dc.emit("alive");Dc.on("updatesReady",()=>{Dc.emit("readyToUpdate")});async function vv(){Mn.info("\uD83E\uDDF9 dispatching SIGINT to workers"),hM.process.kill("SIGINT"),await new Promise((n)=>hM.process.once("exit",n)),Mn.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{Mn.info("\u2757 received SIGINT; exiting gracefully"),await vv()});process.on("SIGTERM",async()=>{Mn.info("\u2757 received SIGTERM; exiting gracefully"),await vv()});process.on("exit",async()=>{Mn.info("\u2757 received exit; exiting gracefully"),await vv()});Mn.info(`\uD83D\uDEEB backend server ready on port ${qn.BACKEND_PORT}`);export{YD as tribunalDaily};
63
+ `;await i.execute(S`CREATE SCHEMA IF NOT EXISTS ${S.identifier(p)}`),await i.execute(a);let m=(await i.all(S`select id, hash, created_at from ${S.identifier(p)}.${S.identifier(c)} order by created_at desc limit 1`))[0];await i.transaction(async(l)=>{for await(let f of n)if(!m||Number(m.created_at)<f.folderMillis){for(let v of f.sql)await l.execute(S.raw(v));await l.execute(S`insert into ${S.identifier(p)}.${S.identifier(c)} ("hash", "created_at") values(${f.hash}, ${f.folderMillis})`)}})}escapeName(n){return`"${n}"`}escapeParam(n){return`\$${n+1}`}escapeString(n){return`'${n.replace(/'/g,"''")}'`}buildWithCTE(n){if(!n?.length)return;let i=[S`with `];for(let[o,c]of n.entries())if(i.push(S`${S.identifier(c._.alias)} as (${c._.sql})`),o<n.length-1)i.push(S`, `);return i.push(S` `),S.join(i)}buildDeleteQuery({table:n,where:i,returning:o,withList:c}){let p=this.buildWithCTE(c),a=o?S` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,x=i?S` where ${i}`:void 0;return S`${p}delete from ${n}${x}${a}`}buildUpdateSet(n,i){let o=n[L.Symbol.Columns],c=Object.keys(o).filter((a)=>i[a]!==void 0||o[a]?.onUpdateFn!==void 0),p=c.length;return S.join(c.flatMap((a,x)=>{let m=o[a],l=i[a]??S.param(m.onUpdateFn(),m),f=S`${S.identifier(this.casing.getColumnCasing(m))} = ${l}`;if(x<p-1)return[f,S.raw(", ")];return[f]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p}){let a=this.buildWithCTE(p),x=this.buildUpdateSet(n,i),m=c?S` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,l=o?S` where ${o}`:void 0;return S`${a}update ${n} set ${x}${l}${m}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},a)=>{let x=[];if(z(p,k.Aliased)&&p.isSelectionField)x.push(S.identifier(p.fieldAlias));else if(z(p,k.Aliased)||z(p,k)){let m=z(p,k.Aliased)?p.sql:p;if(i)x.push(new k(m.queryChunks.map((l)=>{if(z(l,u))return S.identifier(this.casing.getColumnCasing(l));return l})));else x.push(m);if(z(p,k.Aliased))x.push(S` as ${S.identifier(p.fieldAlias)}`)}else if(z(p,bn))if(i)x.push(S.identifier(this.casing.getColumnCasing(p)));else x.push(p);if(a<o-1)x.push(S`, `);return x});return S.join(c)}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:a,joins:x,orderBy:m,groupBy:l,limit:f,offset:v,lockingClause:$,distinct:T,setOperators:F}){let M=o??ei(i);for(let mn of M)if(z(mn.field,bn)&&di(mn.field.table)!==(z(a,fi)?a._.alias:z(a,ix)?a[hn].name:z(a,k)?void 0:di(a))&&!((ln)=>x?.some(({alias:Vn})=>Vn===(ln[L.Symbol.IsAlias]?di(ln):ln[L.Symbol.BaseName])))(mn.field.table)){let ln=di(mn.field.table);throw new Error(`Your "${mn.path.join("->")}" field references a column "${ln}"."${mn.field.name}", but the table "${ln}" is not part of the query! Did you forget to join it?`)}let A=!x||x.length===0,R=this.buildWithCTE(n),G;if(T)G=T===!0?S` distinct`:S` distinct on (${S.join(T.on,S`, `)})`;let Q=this.buildSelection(M,{isSingleTable:A}),b=(()=>{if(z(a,L)&&a[L.Symbol.OriginalName]!==a[L.Symbol.Name]){let mn=S`${S.identifier(a[L.Symbol.OriginalName])}`;if(a[L.Symbol.Schema])mn=S`${S.identifier(a[L.Symbol.Schema])}.${mn}`;return S`${mn} ${S.identifier(a[L.Symbol.Name])}`}return a})(),D=[];if(x)for(let[mn,ln]of x.entries()){if(mn===0)D.push(S` `);let Vn=ln.table,ji=ln.lateral?S` lateral`:void 0;if(z(Vn,no)){let H=Vn[no.Symbol.Name],s=Vn[no.Symbol.Schema],wn=Vn[no.Symbol.OriginalName],Yn=H===wn?void 0:ln.alias;D.push(S`${S.raw(ln.joinType)} join${ji} ${s?S`${S.identifier(s)}.`:void 0}${S.identifier(wn)}${Yn&&S` ${S.identifier(Yn)}`} on ${ln.on}`)}else if(z(Vn,Vi)){let H=Vn[hn].name,s=Vn[hn].schema,wn=Vn[hn].originalName,Yn=H===wn?void 0:ln.alias;D.push(S`${S.raw(ln.joinType)} join${ji} ${s?S`${S.identifier(s)}.`:void 0}${S.identifier(wn)}${Yn&&S` ${S.identifier(Yn)}`} on ${ln.on}`)}else D.push(S`${S.raw(ln.joinType)} join${ji} ${Vn} on ${ln.on}`);if(mn<x.length-1)D.push(S` `)}let Y=S.join(D),K=c?S` where ${c}`:void 0,E=p?S` having ${p}`:void 0,y;if(m&&m.length>0)y=S` order by ${S.join(m,S`, `)}`;let V;if(l&&l.length>0)V=S` group by ${S.join(l,S`, `)}`;let X=typeof f==="object"||typeof f==="number"&&f>=0?S` limit ${f}`:void 0,Z=v?S` offset ${v}`:void 0,C=S.empty();if($){let mn=S` for ${S.raw($.strength)}`;if($.config.of)mn.append(S` of ${S.join(Array.isArray($.config.of)?$.config.of:[$.config.of],S`, `)}`);if($.config.noWait)mn.append(S` no wait`);else if($.config.skipLocked)mn.append(S` skip locked`);C.append(mn)}let on=S`${R}select${G} ${Q} from ${b}${Y}${K}${V}${E}${y}${X}${Z}${C}`;if(F.length>0)return this.buildSetOperations(on,F);return on}buildSetOperations(n,i){let[o,...c]=i;if(!o)throw new Error("Cannot pass undefined values to any set operator");if(c.length===0)return this.buildSetOperationQuery({leftSelect:n,setOperator:o});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:n,setOperator:o}),c)}buildSetOperationQuery({leftSelect:n,setOperator:{type:i,isAll:o,rightSelect:c,limit:p,orderBy:a,offset:x}}){let m=S`(${n.getSQL()}) `,l=S`(${c.getSQL()})`,f;if(a&&a.length>0){let F=[];for(let M of a)if(z(M,u))F.push(S.identifier(M.name));else if(z(M,k)){for(let A=0;A<M.queryChunks.length;A++){let R=M.queryChunks[A];if(z(R,u))M.queryChunks[A]=S.identifier(R.name)}F.push(S`${M}`)}else F.push(S`${M}`);f=S` order by ${S.join(F,S`, `)} `}let v=typeof p==="object"||typeof p==="number"&&p>=0?S` limit ${p}`:void 0,$=S.raw(`${i} ${o?"all ":""}`),T=x?S` offset ${x}`:void 0;return S`${m}${$}${l}${f}${v}${T}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p}){let a=[],x=n[L.Symbol.Columns],m=Object.entries(x).filter(([F,M])=>!M.shouldDisableInsert()),l=m.map(([,F])=>S.identifier(this.casing.getColumnCasing(F)));for(let[F,M]of i.entries()){let A=[];for(let[R,G]of m){let Q=M[R];if(Q===void 0||z(Q,Li)&&Q.value===void 0)if(G.defaultFn!==void 0){let b=G.defaultFn(),D=z(b,k)?b:S.param(b,G);A.push(D)}else if(!G.default&&G.onUpdateFn!==void 0){let b=G.onUpdateFn(),D=z(b,k)?b:S.param(b,G);A.push(D)}else A.push(S`default`);else A.push(Q)}if(a.push(A),F<i.length-1)a.push(S`, `)}let f=this.buildWithCTE(p),v=S.join(a),$=c?S` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,T=o?S` on conflict ${o}`:void 0;return S`${f}insert into ${n} ${l} values ${v}${T}${$}`}buildRefreshMaterializedViewQuery({view:n,concurrently:i,withNoData:o}){let c=i?S` concurrently`:void 0,p=o?S` with no data`:void 0;return S`refresh materialized view${c} ${n}${p}`}prepareTyping(n){if(z(n,im)||z(n,nm))return"json";else if(z(n,om))return"decimal";else if(z(n,cm))return"time";else if(z(n,pm)||z(n,am))return"timestamp";else if(z(n,gx)||z(n,dx))return"date";else if(z(n,xm))return"uuid";else return"none"}sqlToQuery(n,i){return n.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:i})}buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:c,tableConfig:p,queryConfig:a,tableAlias:x,nestedQueryRelation:m,joinOn:l}){let f=[],v,$,T=[],F,M=[];if(a===!0)f=Object.entries(p.columns).map(([G,Q])=>({dbKey:Q.name,tsKey:G,field:Ho(Q,x),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let R=Object.fromEntries(Object.entries(p.columns).map(([K,E])=>[K,Ho(E,x)]));if(a.where){let K=typeof a.where==="function"?a.where(R,pS()):a.where;F=K&&Ea(K,x)}let G=[],Q=[];if(a.columns){let K=!1;for(let[E,y]of Object.entries(a.columns)){if(y===void 0)continue;if(E in p.columns){if(!K&&y===!0)K=!0;Q.push(E)}}if(Q.length>0)Q=K?Q.filter((E)=>a.columns?.[E]===!0):Object.keys(p.columns).filter((E)=>!Q.includes(E))}else Q=Object.keys(p.columns);for(let K of Q){let E=p.columns[K];G.push({tsKey:K,value:E})}let b=[];if(a.with)b=Object.entries(a.with).filter((K)=>!!K[1]).map(([K,E])=>({tsKey:K,queryConfig:E,relation:p.relations[K]}));let D;if(a.extras){D=typeof a.extras==="function"?a.extras(R,{sql:S}):a.extras;for(let[K,E]of Object.entries(D))G.push({tsKey:K,value:Xf(E,x)})}for(let{tsKey:K,value:E}of G)f.push({dbKey:z(E,k.Aliased)?E.fieldAlias:p.columns[K].name,tsKey:K,field:z(E,bn)?Ho(E,x):E,relationTableTsKey:void 0,isJson:!1,selection:[]});let Y=typeof a.orderBy==="function"?a.orderBy(R,aS()):a.orderBy??[];if(!Array.isArray(Y))Y=[Y];T=Y.map((K)=>{if(z(K,bn))return Ho(K,x);return Ea(K,x)}),v=a.limit,$=a.offset;for(let{tsKey:K,queryConfig:E,relation:y}of b){let V=mS(i,o,y),X=Ec(y.referencedTable),Z=o[X],C=`${x}_${K}`,on=Oc(...V.fields.map((Vn,ji)=>Eo(Ho(V.references[ji],C),Ho(Vn,x)))),mn=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[Z],tableConfig:i[Z],queryConfig:z(y,mc)?E===!0?{limit:1}:{...E,limit:1}:E,tableAlias:C,joinOn:on,nestedQueryRelation:y}),ln=S`${S.identifier(C)}.${S.identifier("data")}`.as(K);M.push({on:S`true`,table:new fi(mn.sql,{},C),alias:C,joinType:"left",lateral:!0}),f.push({dbKey:K,tsKey:K,field:ln,relationTableTsKey:Z,isJson:!0,selection:mn.selection})}}if(f.length===0)throw new qx({message:`No fields selected for table "${p.tsName}" ("${x}")`});let A;if(F=Oc(l,F),m){let R=S`json_build_array(${S.join(f.map(({field:b,tsKey:D,isJson:Y})=>Y?S`${S.identifier(`${x}_${D}`)}.${S.identifier("data")}`:z(b,k.Aliased)?b.sql:b),S`, `)})`;if(z(m,Va))R=S`coalesce(json_agg(${R}${T.length>0?S` order by ${S.join(T,S`, `)}`:void 0}), '[]'::json)`;let G=[{dbKey:"data",tsKey:"data",field:R.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:f}];if(v!==void 0||$!==void 0||T.length>0)A=this.buildSelectQuery({table:tx(c,x),fields:{},fieldsFlat:[{path:[],field:S.raw("*")}],where:F,limit:v,offset:$,orderBy:T,setOperators:[]}),F=void 0,v=void 0,$=void 0,T=[];else A=tx(c,x);A=this.buildSelectQuery({table:z(A,no)?A:new fi(A,{},x),fields:{},fieldsFlat:G.map(({field:b})=>({path:[],field:z(b,bn)?Ho(b,x):b})),joins:M,where:F,limit:v,offset:$,orderBy:T,setOperators:[]})}else A=this.buildSelectQuery({table:tx(c,x),fields:{},fieldsFlat:f.map(({field:R})=>({path:[],field:z(R,bn)?Ho(R,x):R})),joins:M,where:F,limit:v,offset:$,orderBy:T,setOperators:[]});return{tableTsKey:p.tsName,sql:A,selection:f}}}class bi{static[J]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===hn)return{...n[hn],selectedFields:new Proxy(n[hn].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(z(n,fi)?n._.selectedFields:z(n,Vi)?n[hn].selectedFields:n)[i];if(z(c,k.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(z(c,k)){if(this.config.sqlBehavior==="sql")return c;throw new Error(`You tried to reference "${i}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(z(c,bn)){if(this.config.alias)return new Proxy(c,new Ap(new Proxy(c.table,new Ha(this.config.alias,this.config.replaceOriginalName??!1))));return c}if(typeof c!=="object"||c===null)return c;return new Proxy(c,new bi(this.config))}}class dv{static[J]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Oi{static[J]="PgSelectBuilder";fields;session;dialect;withList=[];distinct;constructor(n){if(this.fields=n.fields,this.session=n.session,this.dialect=n.dialect,n.withList)this.withList=n.withList;this.distinct=n.distinct}from(n){let i=!!this.fields,o;if(this.fields)o=this.fields;else if(z(n,fi))o=Object.fromEntries(Object.keys(n._.selectedFields).map((c)=>[c,n[c]]));else if(z(n,ix))o=n[hn].selectedFields;else if(z(n,k))o={};else o=lw(n);return new ev({table:n,fields:o,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class uR extends dv{static[J]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:a,distinct:x}){super();this.config={withList:a,table:n,fields:{...i},distinct:x,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=Hf(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=Hf(i);if(typeof p==="string"&&this.config.joins?.some((a)=>a.alias===p))throw new Error(`Alias "${p}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof c==="string")this.config.fields={[c]:this.config.fields};if(typeof p==="string"&&!z(i,k)){let a=z(i,fi)?i._.selectedFields:z(i,Vi)?i[hn].selectedFields:i[L.Symbol.Columns];this.config.fields[p]=a}}if(typeof o==="function")o=o(new Proxy(this.config.fields,new bi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:o,table:i,joinType:n,alias:p}),typeof p==="string")switch(n){case"left":{this.joinsNotNullableMap[p]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([a])=>[a,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([a])=>[a,!1])),this.joinsNotNullableMap[p]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");createSetOperator(n,i){return(o)=>{let c=typeof o==="function"?o($G()):o;if(!Qf(this.getSelectedFields(),c.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:n,isAll:i,rightSelect:c}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);intersectAll=this.createSetOperator("intersect",!0);except=this.createSetOperator("except",!1);exceptAll=this.createSetOperator("except",!0);addSetOperators(n){return this.config.setOperators.push(...n),this}where(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new bi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=n,this}having(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new bi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=n,this}groupBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new bi({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=n;return this}orderBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new bi({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),o=Array.isArray(i)?i:[i];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=o;else this.config.orderBy=o}else{let i=n;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=i;else this.config.orderBy=i}return this}limit(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=n;else this.config.limit=n;return this}offset(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=n;else this.config.offset=n;return this}for(n,i={}){return this.config.lockingClause={strength:n,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(n){return new Proxy(new fi(this.getSQL(),this.config.fields,n),new bi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new bi({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class ev extends uR{static[J]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Un.startActiveSpan("drizzle.prepareQuery",()=>{let a=ei(o.fields),x=i.prepareQuery(c.sqlToQuery(this.getSQL()),a,n,!0);return x.joinsNotNullableMap=p,x})}prepare(n){return this._prepare(n)}execute=(n)=>{return Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})}}mw(ev,[Qi]);function gp(n,i){return(o,c,...p)=>{let a=[c,...p].map((x)=>({type:n,isAll:i,rightSelect:x}));for(let x of a)if(!Qf(o.getSelectedFields(),x.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return o.addSetOperators(a)}}var $G=()=>({union:TG,unionAll:wG,intersect:JG,intersectAll:SG,except:AG,exceptAll:FG}),TG=gp("union",!1),wG=gp("union",!0),JG=gp("intersect",!1),SG=gp("intersect",!0),AG=gp("except",!1),FG=gp("except",!0);class n${static[J]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=z(n,tc)?n:void 0,this.dialectConfig=z(n,tc)?void 0:n}$with(n){let i=this;return{as(o){if(typeof o==="function")o=o(i);return new Proxy(new Qa(o.getSQL(),o.getSelectedFields(),n,!0),new bi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}with(...n){let i=this;function o(a){return new Oi({fields:a??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(a){return new Oi({fields:a??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(a,x){return new Oi({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:a}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Oi({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Oi({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Oi({fields:i??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:n}})}getDialect(){if(!this.dialect)this.dialect=new tc(this.dialectConfig);return this.dialect}}class i$ extends Qi{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[J]="PgRefreshMaterializedView";config;concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Un.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}execute=(n)=>{return Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n)})}}class em{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[J]="PgUpdateBuilder";set(n){return new _R(this.table,rx(this.table,n),this.session,this.dialect,this.withList)}}class _R extends Qi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p}}static[J]="PgUpdate";config;where(n){return this.config.where=n,this}returning(n=this.config.table[L.Symbol.Columns]){return this.config.returning=ei(n),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)}prepare(n){return this._prepare(n)}execute=(n)=>{return this._prepare().execute(n)};$dynamic(){return this}}class ox extends k{constructor(n){super(ox.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=ox.buildCount(n.source,n.filters)}sql;static[J]="PgCountBuilder";[Symbol.toStringTag]="PgCountBuilder";session;static buildEmbeddedCount(n,i){return S`(select count(*) from ${n}${S.raw(" where ").if(i)}${i})`}static buildCount(n,i){return S`select count(*) as count from ${n}${S.raw(" where ").if(i)}${i};`}then(n,i){return Promise.resolve(this.session.count(this.sql)).then(n,i)}catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}}class c${constructor(n,i,o,c,p,a,x){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=a,this.session=x}static[J]="PgRelationalQueryBuilder";findMany(n){return new o$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new o$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class o$ extends Qi{constructor(n,i,o,c,p,a,x,m,l){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=a,this.session=x,this.config=m,this.mode=l}static[J]="PgRelationalQuery";_prepare(n){return Un.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let a=c.map((x)=>mm(this.schema,this.tableConfig,x,i.selection,p));if(this.mode==="first")return a[0];return a})})}prepare(n){return this._prepare(n)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let n=this._getQuery(),i=this.dialect.sqlToQuery(n.sql);return{query:n,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}execute(){return Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute()})}}class p$ extends Qi{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[J]="PgRaw";getSQL(){return this.sql}getQuery(){return this.query}mapResult(n,i){return i?this.mapBatchResult(n):n}_prepare(){return this}isResponseInArrayMode(){return!1}}class cx{constructor(n,i,o){if(this.dialect=n,this.session=i,this._=o?{schema:o.schema,fullSchema:o.fullSchema,tableNamesMap:o.tableNamesMap,session:i}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:i},this.query={},this._.schema)for(let[c,p]of Object.entries(this._.schema))this.query[c]=new c$(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[J]="PgDatabase";query;$with(n){let i=this;return{as(o){if(typeof o==="function")o=o(new n$(i.dialect));return new Proxy(new Qa(o.getSQL(),o.getSelectedFields(),n,!0),new bi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}$count(n,i){return new ox({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(l){return new Oi({fields:l??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(l){return new Oi({fields:l??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(l,f){return new Oi({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:l}})}function a(l){return new em(l,i.session,i.dialect,n)}function x(l){return new dm(l,i.session,i.dialect,n)}function m(l){return new gm(l,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:a,insert:x,delete:m}}select(n){return new Oi({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Oi({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Oi({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new em(n,this.session,this.dialect)}insert(n){return new dm(n,this.session,this.dialect)}delete(n){return new gm(n,this.session,this.dialect)}refreshMaterializedView(n){return new i$(n,this.session,this.dialect)}execute(n){let i=typeof n==="string"?S.raw(n):n.getSQL(),o=this.dialect.sqlToQuery(i),c=this.session.prepareQuery(o,void 0,void 0,!1);return new p$(()=>c.execute(),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class bR{constructor(n,i){this.unique=n,this.name=i}static[J]="PgIndexBuilderOn";on(...n){return new nl(n.map((i)=>{if(z(i,k))return i;i=i;let o=new za(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=JSON.parse(JSON.stringify(i.defaultConfig)),o}),this.unique,!1,this.name)}onOnly(...n){return new nl(n.map((i)=>{if(z(i,k))return i;i=i;let o=new za(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new nl(i.map((o)=>{if(z(o,k))return o;o=o;let c=new za(o.name,!!o.keyAsName,o.columnType,o.indexConfig);return o.indexConfig=JSON.parse(JSON.stringify(o.defaultConfig)),c}),this.unique,!0,this.name,n)}}class nl{static[J]="PgIndexBuilder";config;constructor(n,i,o,c,p="btree"){this.config={name:c,columns:n,unique:i,only:o,method:p}}concurrently(){return this.config.concurrently=!0,this}with(n){return this.config.with=n,this}where(n){return this.config.where=n,this}build(n){return new jR(this.config,n)}}class jR{static[J]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function a$(n){return new bR(!0,n)}class x${constructor(n){this.query=n}getQuery(){return this.query}mapResult(n,i){return n}static[J]="PgPreparedQuery";joinsNotNullableMap}class m${constructor(n){this.dialect=n}static[J]="PgSession";execute(n){return Un.startActiveSpan("drizzle.operation",()=>{return Un.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).execute()})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n){let i=await this.execute(n);return Number(i[0].count)}}class l$ extends cx{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[J]="PgTransaction";rollback(){throw new Gf}getTransactionConfigSQL(n){let i=[];if(n.isolationLevel)i.push(`isolation level ${n.isolationLevel}`);if(n.accessMode)i.push(n.accessMode);if(typeof n.deferrable==="boolean")i.push(n.deferrable?"deferrable":"not deferrable");return S.raw(i.join(" "))}setTransaction(n){return this.session.execute(S`set transaction ${this.getTransactionConfigSQL(n)}`)}}class yR extends x${constructor(n,i,o,c,p,a,x){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=a,this.customResultMapper=x}static[J]="PostgresJsPreparedQuery";async execute(n={}){return Un.startActiveSpan("drizzle.execute",async(i)=>{let o=Kf(this.params,n);i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o);let{fields:c,queryString:p,client:a,joinsNotNullableMap:x,customResultMapper:m}=this;if(!c&&!m)return Un.startActiveSpan("drizzle.driver.execute",()=>{return a.unsafe(p,o)});let l=await Un.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),a.unsafe(p,o).values()});return Un.startActiveSpan("drizzle.mapResponse",()=>{return m?m(l):l.map((f)=>xw(c,f,x))})})}all(n={}){return Un.startActiveSpan("drizzle.execute",async(i)=>{let o=Kf(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),Un.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.client.unsafe(this.queryString,o)})})}isResponseInArrayMode(){return this._isResponseInArrayMode}}class px extends m${constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new zf}static[J]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new yR(this.client,n.sql,n.params,this.logger,i,c,p)}query(n,i){return this.logger.logQuery(n,i),this.client.unsafe(n,i).values()}queryObjects(n,i){return this.client.unsafe(n,i)}transaction(n,i){return this.client.begin(async(o)=>{let c=new px(o,this.dialect,this.schema,this.options),p=new f$(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class f$ extends l${constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[J]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new px(i,this.dialect,this.schema,this.session.options),c=new f$(this.dialect,o,this.schema);return n(c)})}}class BR extends cx{static[J]="PostgresJsDatabase"}function dp(n,i={}){let o=(l)=>l;for(let l of["1184","1082","1083","1114"])n.options.parsers[l]=o,n.options.serializers[l]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new tc({casing:i.casing}),p;if(i.logger===!0)p=new Yf;else if(i.logger!==!1)p=i.logger;let a;if(i.schema){let l=xS(i.schema,lS);a={fullSchema:i.schema,schema:l.tables,tableNamesMap:l.tableNamesMap}}let x=new px(n,c,a,{logger:p}),m=new BR(c,x,a);return m.$client=n,m}function il(...n){if(typeof n[0]==="string"){let i=rp(n[0]);return dp(i,n[1])}if(fw(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return dp(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:a,...x}=i,m=rp(a,x);return dp(m,c)}let p=rp(i);return dp(p,c)}return dp(n[0],n[1])}((n)=>{function i(o){return dp({},o)}n.mock=i})(il||(il={}));var $$={};d4($$,{users:()=>Xo,userChanges:()=>RG,untrackedUserColumnNames:()=>MG,twoFactorMethod:()=>CR,trackedUserColumnName:()=>DR,trackableUserColumnNames:()=>NR,role:()=>LR,players:()=>v$,passwordResetAttempts:()=>WG,loginHistory:()=>ep,games:()=>ol,banishedIps:()=>cl});var LR=kx("role",["admin","user"]),Xo=xc("users",{id:Ni().primaryKey().defaultRandom(),username:vi({length:16}).notNull(),email:vi({length:254}).notNull(),hash:vi({length:64}).notNull(),salt:vi({length:36}).notNull(),createdAt:wo({withTimezone:!0}).notNull().defaultNow(),createdIp:vi({length:45}).notNull(),isActive:Oa().notNull().default(!1),verifiedAt:wo({withTimezone:!0}),userRole:LR().default("user")},(n)=>({usersUsernameUnique:a$().on(n.username),usersEmailUnique:a$().on(n.email)})),MG=["id","createdAt","createdIp","isActive","salt","verifiedAt"],NR=["username","email","hash","userRole"],DR=kx("trackedUserColumnName",NR),RG=xc("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Xo.id),changedAt:wo({withTimezone:!0}).notNull().defaultNow(),changedIp:vi({length:45}).notNull(),changedColumn:DR().notNull(),oldValue:vi({length:255}),newValue:vi({length:255})}),ol=xc("games",{id:Ni("id").primaryKey().defaultRandom()}),v$=xc("players",{userId:Ni().notNull().references(()=>Xo.id),gameId:Ni().notNull().references(()=>ol.id),score:ex().notNull()},(n)=>({pk:iS({columns:[n.userId,n.gameId]})})),ep=xc("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>Xo.id),loginTime:wo({withTimezone:!0}).notNull().defaultNow(),ipAddress:vi({length:45}).notNull(),userAgent:vi({length:1024}),successful:Oa().notNull().default(!1)}),CR=kx("twoFactorMethod",["email","phone"]),WG=xc("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Xo.id),requestedIp:vi({length:45}).notNull(),requestedAt:wo({withTimezone:!0}).notNull().defaultNow(),succeededIp:vi({length:45}),succeededAt:wo({withTimezone:!0}),verificationMethod:CR().notNull()}),cl=xc("banishedIps",{ip:vi({length:45}).primaryKey(),reason:vi({length:2048}).notNull(),banishedAt:wo({withTimezone:!0}).notNull().defaultNow(),banishedUntil:wo({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class T${options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(KG.resolve(__dirname,"notify_update.sql"));let n=[di(Xo),di(ol),di(v$)];await this.sql`SELECT create_notify_triggers(${this.sql.array(n)})`,await this.sql.listen("table_update",(i)=>{let o=i.split(","),c=o[0],p=o[1],a=`${c}("${p}")`;if(this.observers.has(a))this.observers.get(a).next(a)})}constructor(n=!1,i={host:rn.POSTGRES_HOST,port:rn.POSTGRES_PORT,user:rn.POSTGRES_USER,password:rn.POSTGRES_PASSWORD,database:rn.POSTGRES_DATABASE}){this.options=i,this.sql=rp(i),this.drizzle=il(this.sql,{schema:$$,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new xn);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as XG}from"crypto";function w$(n){let i=XG("sha256").update(n).digest("hex");return`${i.substring(0,8)}-${i.substring(8,12)}-${i.substring(12,16)}-${i.substring(16,20)}-${i.substring(20,32)}`}var hR=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"];var GG=3,YG=15,zG=/^[a-zA-Z0-9_-]+$/,sR=Gn.string().min(GG).max(YG).regex(zG),IR=20,kR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function QG(n){let i="";for(let o of n)if(o in kR)i+=kR[o];else i+=o;return i}function HG(n){let i=n.toLocaleLowerCase(),o=QG(i);for(let c of hR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function EG(n){let i=new Set(n).size;return n.length*Math.log2(i)}function OG(n){let i=0,o=100;if(HG(n))i-=o;return i+=EG(n)*0.5,Math.max(i,0)}var ZR=Gn.string().refine((n)=>{return OG(n)>=IR},{message:`Password does not meet the minimum complexity of ${IR}.`}).brand("password"),tR=Gn.object({username:sR,password:ZR}).strict(),UG=Gn.string().email().brand("email"),qR=Gn.object({username:sR,password:ZR,email:UG}).strict();var pl={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},J$=H$(pl).map(([n])=>Gn.literal(Number(n))),VG=Gn.union([J$[0],J$[1],...J$]),PR=Gn.tuple([VG,Gn.string()]);var rR=go({key:"count",default:0}),uG=Kc({key:"incrementTX",do:({set:n})=>{n(rR,(i)=>i+1)}}),gR=f0({key:"countContinuity",config:(n)=>n.add(rR).add(uG)});var eR=uv(hc,"backend.worker.game.bun",Wn),qc=new T$({logQuery(n,i){Wn.info("\uD83D\uDCDD query",n,i)}});nn.STORE.loggers[0]=new Rc("info",void 0,Wn);var cI=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new n4.CronJob("00 15 * * * *",()=>{uv(hc,"backend.worker.tribunal.bun",Wn)}),n.start(),process.on("exit",()=>{n.stop(),Wn.info("\u231B tribunal daily cronjob stopped")}),Wn.info("\u23F3 tribunal daily cronjob started");return n})();function jG(n){if(Vv)return bG(Vv,n);return _G({},n)}var i4=jG((n,i)=>{let o;n.on("data",(c)=>(o??=[]).push(c)).on("end",async()=>{let c=n.headers.authorization;try{if(typeof n.url==="undefined")throw[400,"No URL"];let p=n.socket.remoteAddress;if(!p)throw[400,"No IP address"];let a=new Date,x=new URL(n.url,rn.VITE_BACKEND_ORIGIN);Wn.info(a,p,n.method,x.pathname);let m=await qc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Eo(cl.ip,p)}),l=m?.banishedUntil===null,f=m?.banishedUntil&&m.banishedUntil>a;if(l||f){Wn.info(`\uD83D\uDE45 request from banned ip ${p}`);return}switch(n.method){case"POST":if(!o)throw[400,"No data received"];switch(x.pathname){case`/sign-up-${w$("sign-up")}`:{let v=Buffer.concat(o).toString(),$=JSON.parse(v),T=qR.safeParse($);if(!T.success){Wn.warn("signup parsed",T.error.issues);return}let{username:F,password:M,email:A}=T.data;if(Wn.info(`\uD83D\uDD11 attempting to sign up: ${F}`),await qc.drizzle.query.users.findFirst({columns:{id:!0},where:Eo(Xo.email,A)}))throw[400,"User already exists"];let G=crypto.randomUUID(),Q=dR("sha256").update(M+G).digest("hex");await qc.drizzle.insert(Xo).values({username:F,email:A,hash:Q,salt:G,createdIp:p}),Wn.info(`\uD83D\uDD11 user created: ${F}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${rn.FRONTEND_ORIGINS[0]}`}),i.end(pl[201])}break;case`/login-${w$("login")}`:{let v=!1,$=null;try{let T=new Date(+a-600000);Wn.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:T,now:a});let F=await qc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Oc(Eo(ep.ipAddress,p),Eo(ep.successful,!1),Px(ep.loginTime,T)),limit:10});Wn.info(`\uD83D\uDD11 ${F.length}/10 recent failed logins from ${p}`);let M=10-F.length;if(M<1)throw Wn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await qc.drizzle.insert(cl).values({ip:p,reason:"Too many recent login attempts.",banishedAt:a,banishedUntil:new Date(+a+86400000)}),[429,"Too many recent login attempts."];let A=Buffer.concat(o).toString(),R=JSON.parse(A),G=tR.safeParse(R);if(!G.success)throw Wn.warn("login parsed",G.error.issues),[400,`${M} attempts remaining.`];let{username:Q,password:b}=G.data,D=await qc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Eo(Xo.username,Q)});if(Wn.info("\uD83D\uDD11 login attempt as user",Q),!D)throw Wn.info(`\uD83D\uDD11 user ${Q} does not exist`),[400,`${M} attempts remaining.`];let{hash:Y,salt:K}=D;if($=D.id,dR("sha256").update(b+K).digest("hex")===Y){let y=crypto.randomUUID(),V=Nm.get(Q);if(!V)V=new Map,Nm.set(Q,V);V.set(y,Number(a)),v=!0,Wn.info("\uD83D\uDD11 login successful as",Q),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${rn.FRONTEND_ORIGINS[0]}`}),i.end(`${Q} ${y}`)}}finally{await qc.drizzle.insert(ep).values({userId:$,successful:v,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),Wn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}}}}catch(p){let a=PR.safeParse(p);if(a.success){let[x,m]=a.data,f=`${pl[x]}. ${m}`;Wn.info(`\u274C ${x}: ${f}`),i.writeHead(x,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${rn.FRONTEND_ORIGINS[0]}`}),i.end(f)}else Wn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${rn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),S$=i4.listen(rn.BACKEND_PORT).address(),yG=typeof S$==="string"?null:S$===null?null:S$.port;if(yG===null)throw new Error("Could not determine port for test server");new qM(i4,{cors:{origin:rn.FRONTEND_ORIGINS,methods:["GET","POST"]}}).use((n,i)=>{let{username:o,sessionKey:c}=n.handshake.auth;if(!(o&&c)){i(new Error("No auth header provided"));return}let p=`user::${o}`,a=`socket::${n.id}`;if(Nm.get(o)?.has(c)){let m=Jn(nn.STORE,Xx,a);Qn(nn.STORE,m,n),Mc(Xc,(l)=>{l.set(p,a)},nn.STORE),Qn(nn.STORE,bl,(l)=>l.add(p)),Qn(nn.STORE,_l,(l)=>l.add(a)),Wn.info(`${o} connected on ${n.id}`),i()}else Wn.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=F0({socket:n,store:nn.STORE})(gR);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=np(Xc,c,nn.STORE).userKeyOfSocket,a=Fn(nn.STORE,p);if(Mc(Xc,(x)=>{x.delete(c)},nn.STORE),a)Qn(nn.STORE,bl,(x)=>(x.delete(a),x));Qn(nn.STORE,_l,(x)=>(x.delete(c),x)),Wn.info(`${n.id} disconnected`),o()})});hc.emit("alive");hc.on("updatesReady",()=>{hc.emit("readyToUpdate")});async function A$(){Wn.info("\uD83E\uDDF9 dispatching SIGINT to workers"),eR.process.kill("SIGINT"),await new Promise((n)=>eR.process.once("exit",n)),Wn.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{Wn.info("\u2757 received SIGINT; exiting gracefully"),await A$()});process.on("SIGTERM",async()=>{Wn.info("\u2757 received SIGTERM; exiting gracefully"),await A$()});process.on("exit",async()=>{Wn.info("\u2757 received exit; exiting gracefully"),await A$()});Wn.info(`\uD83D\uDEEB backend server ready on port ${rn.BACKEND_PORT}`);export{cI as tribunalDaily};