tempest.games 0.1.21 → 0.1.23

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,69 +1,69 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var r4=Object.create;var{getPrototypeOf:g4,defineProperty:wf,getOwnPropertyNames:d4}=Object;var e4=Object.prototype.hasOwnProperty;var Af=(n,i,o)=>{o=n!=null?r4(g4(n)):{};let c=i||!n||!n.__esModule?wf(o,"default",{value:n,enumerable:!0}):o;for(let p of d4(n))if(!e4.call(c,p))wf(c,p,{get:()=>n[p],enumerable:!0});return c};var h=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var n8=(n,i)=>{for(var o in i)wf(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var i1=h((n1)=>{Object.defineProperty(n1,"__esModule",{value:!0});class pc extends Error{}class rv extends pc{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class gv extends pc{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class dv extends pc{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class Qc extends pc{}class il extends pc{constructor(n){super(`Invalid unit ${n}`)}}class fi extends pc{}class Bo extends pc{constructor(){super("Zone is an abstract class")}}var j="numeric",$o="short",yi="long",ja={year:j,month:j,day:j},ev={year:j,month:$o,day:j},v8={year:j,month:$o,day:j,weekday:$o},nT={year:j,month:yi,day:j},iT={year:j,month:yi,day:j,weekday:yi},oT={hour:j,minute:j},cT={hour:j,minute:j,second:j},pT={hour:j,minute:j,second:j,timeZoneName:$o},xT={hour:j,minute:j,second:j,timeZoneName:yi},aT={hour:j,minute:j,hourCycle:"h23"},mT={hour:j,minute:j,second:j,hourCycle:"h23"},fT={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:$o},lT={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:yi},$T={year:j,month:j,day:j,hour:j,minute:j},vT={year:j,month:j,day:j,hour:j,minute:j,second:j},TT={year:j,month:$o,day:j,hour:j,minute:j},JT={year:j,month:$o,day:j,hour:j,minute:j,second:j},T8={year:j,month:$o,day:j,weekday:$o,hour:j,minute:j},wT={year:j,month:yi,day:j,hour:j,minute:j,timeZoneName:$o},AT={year:j,month:yi,day:j,hour:j,minute:j,second:j,timeZoneName:$o},ST={year:j,month:yi,day:j,weekday:yi,hour:j,minute:j,timeZoneName:yi},FT={year:j,month:yi,day:j,weekday:yi,hour:j,minute:j,second:j,timeZoneName:yi};class Ec{get type(){throw new Bo}get name(){throw new Bo}get ianaName(){return this.name}get isUniversal(){throw new Bo}offsetName(n,i){throw new Bo}formatOffset(n,i){throw new Bo}offset(n){throw new Bo}equals(n){throw new Bo}get isValid(){throw new Bo}}var Cf=null;class Kx extends Ec{static get instance(){if(Cf===null)Cf=new Kx;return Cf}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return ET(n,i,o)}formatOffset(n,i){return Rx(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var Va={};function J8(n){if(!Va[n])Va[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 Va[n]}var w8={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function A8(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,a,m,f,l,$]=c;return[a,p,x,m,f,l,$]}function S8(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:a}=o[p],m=w8[x];if(x==="era")c[m]=a;else if(!pn(m))c[m]=parseInt(a,10)}return c}var Ha={};class Yo extends Ec{static create(n){if(!Ha[n])Ha[n]=new Yo(n);return Ha[n]}static resetCache(){Ha={},Va={}}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=Yo.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return ET(n,i,o,this.name)}formatOffset(n,i){return Rx(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=J8(this.name),[c,p,x,a,m,f,l]=o.formatToParts?S8(o,i):A8(o,i);if(a==="BC")c=-Math.abs(c)+1;let v=Da({year:c,month:p,day:x,hour:m===24?0:m,minute:f,second:l,millisecond:0}),T=+i,F=T%1000;return T-=F>=0?F:1000+F,(v-T)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var Wv={};function F8(n,i={}){let o=JSON.stringify([n,i]),c=Wv[o];if(!c)c=new Intl.ListFormat(n,i),Wv[o]=c;return c}var tf={};function rf(n,i={}){let o=JSON.stringify([n,i]),c=tf[o];if(!c)c=new Intl.DateTimeFormat(n,i),tf[o]=c;return c}var gf={};function M8(n,i={}){let o=JSON.stringify([n,i]),c=gf[o];if(!c)c=new Intl.NumberFormat(n,i),gf[o]=c;return c}var df={};function R8(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=df[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),df[p]=x;return x}var Fx=null;function W8(){if(Fx)return Fx;else return Fx=new Intl.DateTimeFormat().resolvedOptions().locale,Fx}var Kv={};function K8(n){let i=Kv[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,Kv[n]=i}return i}function X8(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=rf(n).resolvedOptions(),p=n}catch(m){let f=n.substring(0,o);c=rf(f).resolvedOptions(),p=f}let{numberingSystem:x,calendar:a}=c;return[p,x,a]}}function G8(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 Y8(n){let i=[];for(let o=1;o<=12;o++){let c=cn.utc(2009,o,1);i.push(n(c))}return i}function z8(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 Qa(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 H8(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 MT{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...x}=o;if(!i||Object.keys(x).length>0){let a={useGrouping:!1,...o};if(o.padTo>0)a.minimumIntegerDigits=o.padTo;this.inf=M8(n,a)}}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):ml(n,3);return gn(i,this.padTo)}}}class RT{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 x=-1*(n.offset/60),a=x>=0?`Etc/GMT+${x}`:`Etc/GMT${x}`;if(n.offset!==0&&Yo.create(a).valid)c=a,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=rf(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 WT{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&QT())this.rtf=R8(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return P8(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var Q8={firstDay:1,minimalDays:4,weekend:[6,7]};class Gn{static fromOpts(n){return Gn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||Nn.defaultLocale,a=x||(p?"en-US":W8()),m=i||Nn.defaultNumberingSystem,f=o||Nn.defaultOutputCalendar,l=ef(c)||Nn.defaultWeekSettings;return new Gn(a,m,f,l,x)}static resetCache(){Fx=null,tf={},gf={},df={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return Gn.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,a,m]=X8(n);this.locale=x,this.numberingSystem=i||a||null,this.outputCalendar=o||m||null,this.weekSettings=c,this.intl=G8(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=H8(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 Gn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,ef(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 Qa(this,n,_T,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=Y8((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Qa(this,n,jT,()=>{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]=z8((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Qa(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 Qa(this,n,yT,()=>{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(),x=p.find((a)=>a.type.toLowerCase()===o);return x?x.value:null}numberFormatter(n={}){return new MT(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new RT(n,this.intl,i)}relFormatter(n={}){return new WT(this.intl,this.isEnglish(),n)}listFormatter(n={}){return F8(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(!OT())return Q8;else return K8(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 hf=null;class Mi extends Ec{static get utcInstance(){if(hf===null)hf=new Mi(0);return hf}static instance(n){return n===0?Mi.utcInstance:new Mi(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Mi(Ca(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Rx(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Rx(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Rx(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 ol extends Ec{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 oc(n,i){if(pn(n)||n===null)return i;else if(n instanceof Ec)return n;else if(u8(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Kx.instance;else if(o==="utc"||o==="gmt")return Mi.utcInstance;else return Mi.parseSpecifier(o)||Yo.create(n)}else if(cc(n))return Mi.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new ol(n)}var cl={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"},Xv={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]},O8=cl.hanidec.replace(/[\[|\]]/g,"").split("");function E8(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(cl.hanidec)!==-1)i+=O8.indexOf(n[o]);else for(let p in Xv){let[x,a]=Xv[p];if(c>=x&&c<=a)i+=c-x}}return parseInt(i,10)}else return i}var fp={};function U8(){fp={}}function fo({numberingSystem:n},i=""){let o=n||"latn";if(!fp[o])fp[o]={};if(!fp[o][i])fp[o][i]=new RegExp(`${cl[o]}${i}`);return fp[o][i]}var Gv=()=>Date.now(),Yv="system",zv=null,Hv=null,Qv=null,Ov=60,Ev,Uv=null;class Nn{static get now(){return Gv}static set now(n){Gv=n}static set defaultZone(n){Yv=n}static get defaultZone(){return oc(Yv,Kx.instance)}static get defaultLocale(){return zv}static set defaultLocale(n){zv=n}static get defaultNumberingSystem(){return Hv}static set defaultNumberingSystem(n){Hv=n}static get defaultOutputCalendar(){return Qv}static set defaultOutputCalendar(n){Qv=n}static get defaultWeekSettings(){return Uv}static set defaultWeekSettings(n){Uv=ef(n)}static get twoDigitCutoffYear(){return Ov}static set twoDigitCutoffYear(n){Ov=n%100}static get throwOnInvalid(){return Ev}static set throwOnInvalid(n){Ev=n}static resetCaches(){Gn.resetCache(),Yo.resetCache(),cn.resetCache(),U8()}}class ti{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var KT=[0,31,59,90,120,151,181,212,243,273,304,334],XT=[0,31,60,91,121,152,182,213,244,274,305,335];function ri(n,i){return new ti("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function pl(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 GT(n,i,o){return o+(Xx(n)?XT:KT)[i-1]}function YT(n,i){let o=Xx(n)?XT:KT,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function xl(n,i){return(n-i+7)%7+1}function Ba(n,i=4,o=1){let{year:c,month:p,day:x}=n,a=GT(c,p,x),m=xl(pl(c,p,x),o),f=Math.floor((a-m+14-i)/7),l;if(f<1)l=c-1,f=Wx(l,i,o);else if(f>Wx(c,i,o))l=c+1,f=1;else l=c;return{weekYear:l,weekNumber:f,weekday:m,...ha(n)}}function Vv(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,a=xl(pl(c,1,i),o),m=$p(c),f=p*7+x-a-7+i,l;if(f<1)l=c-1,f+=$p(l);else if(f>m)l=c+1,f-=$p(c);else l=c;let{month:$,day:v}=YT(l,f);return{year:l,month:$,day:v,...ha(n)}}function If(n){let{year:i,month:o,day:c}=n,p=GT(i,o,c);return{year:i,ordinal:p,...ha(n)}}function _v(n){let{year:i,ordinal:o}=n,{month:c,day:p}=YT(i,o);return{year:i,month:c,day:p,...ha(n)}}function uv(n,i){if(!pn(n.localWeekday)||!pn(n.localWeekNumber)||!pn(n.localWeekYear)){if(!pn(n.weekday)||!pn(n.weekNumber)||!pn(n.weekYear))throw new Qc("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 V8(n,i=4,o=1){let c=Na(n.weekYear),p=gi(n.weekNumber,1,Wx(n.weekYear,i,o)),x=gi(n.weekday,1,7);if(!c)return ri("weekYear",n.weekYear);else if(!p)return ri("week",n.weekNumber);else if(!x)return ri("weekday",n.weekday);else return!1}function _8(n){let i=Na(n.year),o=gi(n.ordinal,1,$p(n.year));if(!i)return ri("year",n.year);else if(!o)return ri("ordinal",n.ordinal);else return!1}function zT(n){let i=Na(n.year),o=gi(n.month,1,12),c=gi(n.day,1,ya(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 HT(n){let{hour:i,minute:o,second:c,millisecond:p}=n,x=gi(i,0,23)||i===24&&o===0&&c===0&&p===0,a=gi(o,0,59),m=gi(c,0,59),f=gi(p,0,999);if(!x)return ri("hour",i);else if(!a)return ri("minute",o);else if(!m)return ri("second",c);else if(!f)return ri("millisecond",p);else return!1}function pn(n){return typeof n==="undefined"}function cc(n){return typeof n==="number"}function Na(n){return typeof n==="number"&&n%1===0}function u8(n){return typeof n==="string"}function b8(n){return Object.prototype.toString.call(n)==="[object Date]"}function QT(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function OT(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function j8(n){return Array.isArray(n)?n:[n]}function bv(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let x=[i(p),p];if(!c)return x;else if(o(c[0],x[0])===c[0])return c;else return x},null)[1]}function B8(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function Tp(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function ef(n){if(n==null)return null;else if(typeof n!=="object")throw new fi("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 fi("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}}function gi(n,i,o){return Na(n)&&n>=i&&n<=o}function y8(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 ic(n){if(pn(n)||n===null||n==="")return;else return parseInt(n,10)}function zc(n){if(pn(n)||n===null||n==="")return;else return parseFloat(n)}function al(n){if(pn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function ml(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Xx(n){return n%4===0&&(n%100!==0||n%400===0)}function $p(n){return Xx(n)?366:365}function ya(n,i){let o=y8(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Xx(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function Da(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 jv(n,i,o){return-xl(pl(n,1,i),o)+i-1}function Wx(n,i=4,o=1){let c=jv(n,i,o),p=jv(n+1,i,o);return($p(n)-c+p)/7}function nl(n){if(n>99)return n;else return n>Nn.twoDigitCutoffYear?1900+n:2000+n}function ET(n,i,o,c=null){let p=new Date(n),x={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)x.timeZone=c;let a={timeZoneName:i,...x},m=new Intl.DateTimeFormat(o,a).formatToParts(p).find((f)=>f.type.toLowerCase()==="timezonename");return m?m.value:null}function Ca(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 UT(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new fi(`Invalid unit value ${n}`);return i}function La(n,i){let o={};for(let c in n)if(Tp(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=UT(p)}return o}function Rx(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 ha(n){return B8(n,["hour","minute","second","millisecond"])}var L8=["January","February","March","April","May","June","July","August","September","October","November","December"],VT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],N8=["J","F","M","A","M","J","J","A","S","O","N","D"];function _T(n){switch(n){case"narrow":return[...N8];case"short":return[...VT];case"long":return[...L8];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 uT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],D8=["M","T","W","T","F","S","S"];function jT(n){switch(n){case"narrow":return[...D8];case"short":return[...bT];case"long":return[...uT];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var BT=["AM","PM"],C8=["Before Christ","Anno Domini"],h8=["BC","AD"],I8=["B","A"];function yT(n){switch(n){case"narrow":return[...I8];case"short":return[...h8];case"long":return[...C8];default:return null}}function k8(n){return BT[n.hour<12?0:1]}function s8(n,i){return jT(i)[n.weekday-1]}function Z8(n,i){return _T(i)[n.month-1]}function q8(n,i){return yT(i)[n.year<0?0:1]}function P8(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."]},x=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&x){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 a=Object.is(i,-0)||i<0,m=Math.abs(i),f=m===1,l=p[n],$=c?f?l[1]:l[2]||l[1]:f?p[n][0]:n;return a?`${m} ${$} ago`:`in ${m} ${$}`}function Bv(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:ja,DD:ev,DDD:nT,DDDD:iT,t:oT,tt:cT,ttt:pT,tttt:xT,T:aT,TT:mT,TTT:fT,TTTT:lT,f:$T,ff:TT,fff:wT,ffff:ST,F:vT,FF:JT,FFF:AT,FFFF:FT};class Fi{static create(n,i={}){return new Fi(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let x=0;x<n.length;x++){let a=n.charAt(x);if(a==="'"){if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});i=null,o="",c=!c}else if(c)o+=a;else if(a===i)o+=a;else{if(o.length>0)p.push({literal:/^\s+$/.test(o),val:o});o=a,i=a}}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 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=(T,F)=>this.loc.extract(n,T,F),x=(T)=>{if(n.isOffsetFixed&&n.offset===0&&T.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,T.format):""},a=()=>o?k8(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),m=(T,F)=>o?Z8(n,T):p(F?{month:T}:{month:T,day:"numeric"},"month"),f=(T,F)=>o?s8(n,T):p(F?{weekday:T}:{weekday:T,month:"long",day:"numeric"},"weekday"),l=(T)=>{let F=Fi.macroTokenToFormatOpts(T);if(F)return this.formatWithSystemDefault(n,F);else return T},$=(T)=>o?q8(n,T):p({era:T},"era"),v=(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 x({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return x({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return x({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 a();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 f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("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 $("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 l(T)}};return Bv(Fi.parseFormat(i),v)}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)=>(f)=>{let l=o(f);if(l)return this.num(m.get(l),f.length);else return f},p=Fi.parseFormat(i),x=p.reduce((m,{literal:f,val:l})=>f?m:m.concat(l),[]),a=n.shiftTo(...x.map(o).filter((m)=>m));return Bv(p,c(a))}}var LT=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Jp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}$`)}function wp(...n){return(i)=>n.reduce(([o,c,p],x)=>{let[a,m,f]=x(i,p);return[{...o,...a},m||c,f]},[{},null,1]).slice(0,2)}function Ap(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 NT(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=ic(i[o+p]);return[c,null,o+p]}}var DT=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,r8=`(?:${DT.source}?(?:\\[(${LT.source})\\])?)?`,fl=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,CT=RegExp(`${fl.source}${r8}`),ll=RegExp(`(?:T${CT.source})?`),g8=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,d8=/(\d{4})-?W(\d\d)(?:-?(\d))?/,e8=/(\d{4})-?(\d{3})/,n6=NT("weekYear","weekNumber","weekDay"),i6=NT("year","ordinal"),o6=/(\d{4})-(\d\d)-(\d\d)/,hT=RegExp(`${fl.source} ?(?:${DT.source}|(${LT.source}))?`),c6=RegExp(`(?: ${hT.source})?`);function vp(n,i,o){let c=n[i];return pn(c)?o:ic(c)}function p6(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:al(n[i+3])},null,i+4]}function Gx(n,i){let o=!n[i]&&!n[i+1],c=Ca(n[i+1],n[i+2]),p=o?null:Mi.instance(c);return[{},p,i+3]}function Yx(n,i){let o=n[i]?Yo.create(n[i]):null;return[{},o,i+1]}var x6=RegExp(`^T?${fl.source}$`),a6=/^-?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 m6(n){let[i,o,c,p,x,a,m,f,l]=n,$=i[0]==="-",v=f&&f[0]==="-",T=(F,R=!1)=>F!==void 0&&(R||F&&$)?-F:F;return[{years:T(zc(o)),months:T(zc(c)),weeks:T(zc(p)),days:T(zc(x)),hours:T(zc(a)),minutes:T(zc(m)),seconds:T(zc(f),f==="-0"),milliseconds:T(al(l),v)}]}var f6={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function $l(n,i,o,c,p,x,a){let m={year:i.length===2?nl(ic(i)):ic(i),month:VT.indexOf(o)+1,day:ic(c),hour:ic(p),minute:ic(x)};if(a)m.second=ic(a);if(n)m.weekday=n.length>3?uT.indexOf(n)+1:bT.indexOf(n)+1;return m}var l6=/^(?:(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 $6(n){let[,i,o,c,p,x,a,m,f,l,$,v]=n,T=$l(i,p,c,o,x,a,m),F;if(f)F=f6[f];else if(l)F=0;else F=Ca($,v);return[T,new Mi(F)]}function v6(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var T6=/^(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$/,J6=/^(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$/,w6=/^(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 yv(n){let[,i,o,c,p,x,a,m]=n;return[$l(i,p,c,o,x,a,m),Mi.utcInstance]}function A6(n){let[,i,o,c,p,x,a,m]=n;return[$l(i,m,o,c,p,x,a),Mi.utcInstance]}var S6=Jp(g8,ll),F6=Jp(d8,ll),M6=Jp(e8,ll),R6=Jp(CT),IT=wp(p6,Sp,Gx,Yx),W6=wp(n6,Sp,Gx,Yx),K6=wp(i6,Sp,Gx,Yx),X6=wp(Sp,Gx,Yx);function G6(n){return Ap(n,[S6,IT],[F6,W6],[M6,K6],[R6,X6])}function Y6(n){return Ap(v6(n),[l6,$6])}function z6(n){return Ap(n,[T6,yv],[J6,yv],[w6,A6])}function H6(n){return Ap(n,[a6,m6])}var Q6=wp(Sp);function O6(n){return Ap(n,[x6,Q6])}var E6=Jp(o6,c6),U6=Jp(hT),V6=wp(Sp,Gx,Yx);function _6(n){return Ap(n,[E6,IT],[U6,V6])}var Lv="Invalid Duration",kT={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}},u6={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},...kT},Pi=365.2425,xp=30.436875,b6={years:{quarters:4,months:12,weeks:Pi/7,days:Pi,hours:Pi*24,minutes:Pi*24*60,seconds:Pi*24*60*60,milliseconds:Pi*24*60*60*1000},quarters:{months:3,weeks:Pi/28,days:Pi/4,hours:Pi*24/4,minutes:Pi*24*60/4,seconds:Pi*24*60*60/4,milliseconds:Pi*24*60*60*1000/4},months:{weeks:xp/7,days:xp,hours:xp*24,minutes:xp*24*60,seconds:xp*24*60*60,milliseconds:xp*24*60*60*1000},...kT},Oc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],j6=Oc.slice(0).reverse();function nc(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 Sn(c)}function sT(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of j6.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function Nv(n,i){let o=sT(n,i)<0?-1:1;Oc.reduceRight((c,p)=>{if(!pn(i[p])){if(c){let x=i[c]*o,a=n[p][c],m=Math.floor(x/a);i[p]+=m*o,i[c]-=m*a*o}return p}else return c},null),Oc.reduce((c,p)=>{if(!pn(i[p])){if(c){let x=i[c]%1;i[c]-=x,i[p]+=x*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 Sn{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?b6:u6;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||Gn.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return Sn.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new fi(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new Sn({values:La(n,Sn.normalizeUnit),loc:Gn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(cc(n))return Sn.fromMillis(n);else if(Sn.isDuration(n))return n;else if(typeof n==="object")return Sn.fromObject(n);else throw new fi(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=H6(n);if(o)return Sn.fromObject(o,i);else return Sn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=O6(n);if(o)return Sn.fromObject(o,i);else return Sn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new fi("need to specify a reason the Duration is invalid");let o=n instanceof ti?n:new ti(n,i);if(Nn.throwOnInvalid)throw new dv(o);else return new Sn({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 il(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?Fi.create(this.loc,o).formatDurationFromString(this,n):Lv}toHuman(n={}){if(!this.isValid)return Lv;let i=Oc.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+=ml(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 sT(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=Sn.fromDurationLike(n),o={};for(let c of Oc)if(Tp(i.values,c)||Tp(this.values,c))o[c]=i.get(c)+this.get(c);return nc(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=Sn.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]=UT(n(this.values[o],o));return nc(this,{values:i},!0)}get(n){return this[Sn.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,...La(n,Sn.normalizeUnit)};return nc(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let x={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return nc(this,x)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return Nv(this.matrix,n),nc(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=B6(this.normalize().shiftToAll().toObject());return nc(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((x)=>Sn.normalizeUnit(x));let i={},o={},c=this.toObject(),p;for(let x of Oc)if(n.indexOf(x)>=0){p=x;let a=0;for(let f in o)a+=this.matrix[f][x]*o[f],o[f]=0;if(cc(c[x]))a+=c[x];let m=Math.trunc(a);i[x]=m,o[x]=(a*1000-m*1000)/1000}else if(cc(c[x]))o[x]=c[x];for(let x in o)if(o[x]!==0)i[p]+=x===p?o[x]:o[x]/this.matrix[p][x];return Nv(this.matrix,i),nc(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 nc(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 Oc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var ap="Invalid Interval";function y6(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 fi("need to specify a reason the Interval is invalid");let o=n instanceof ti?n:new ti(n,i);if(Nn.throwOnInvalid)throw new gv(o);else return new Cn({invalid:o})}static fromDateTimes(n,i){let o=Sx(n),c=Sx(i),p=y6(o,c);if(p==null)return new Cn({start:o,end:c});else return p}static after(n,i){let o=Sn.fromDurationLike(i),c=Sx(n);return Cn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=Sn.fromDurationLike(i),c=Sx(n);return Cn.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,x;try{p=cn.fromISO(o,i),x=p.isValid}catch(f){x=!1}let a,m;try{a=cn.fromISO(c,i),m=a.isValid}catch(f){m=!1}if(x&&m)return Cn.fromDateTimes(p,a);if(x){let f=Sn.fromISO(c,i);if(f.isValid)return Cn.after(p,f)}else if(m){let f=Sn.fromISO(o,i);if(f.isValid)return Cn.before(a,f)}}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(Sx).filter((x)=>this.contains(x)).sort((x,a)=>x.toMillis()-a.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let x=i[p]||this.e,a=+x>+this.e?this.e:x;o.push(Cn.fromDateTimes(c,a)),c=a,p+=1}return o}splitBy(n){let i=Sn.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,x=[];while(o<this.e){let a=this.start.plus(i.mapUnits((m)=>m*c));p=+a>+this.e?this.e:a,x.push(Cn.fromDateTimes(o,p)),o=p,c+=1}return x}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],x)=>{if(!p)return[c,x];else if(p.overlaps(x)||p.abutsStart(x))return[c,p.union(x)];else return[c.concat([p]),x]},[[],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"}]),x=Array.prototype.concat(...p),a=x.sort((m,f)=>m.time-f.time);for(let m of a)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=ja,i={}){return this.isValid?Fi.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 Sn.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 Yo.isValidZone(n)}static normalizeZone(n){return oc(n,Nn.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||Gn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||Gn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||Gn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Gn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Gn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Gn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Gn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return Gn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return Gn.create(i,null,"gregory").eras(n)}static features(){return{relative:QT(),localeWeek:OT()}}}function Dv(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(Sn.fromMillis(c).as("days"))}function L6(n,i,o){let c=[["years",(f,l)=>l.year-f.year],["quarters",(f,l)=>l.quarter-f.quarter+(l.year-f.year)*4],["months",(f,l)=>l.month-f.month+(l.year-f.year)*12],["weeks",(f,l)=>{let $=Dv(f,l);return($-$%7)/7}],["days",Dv]],p={},x=n,a,m;for(let[f,l]of c)if(o.indexOf(f)>=0)if(a=f,p[f]=l(n,i),m=x.plus(p),m>i){if(p[f]--,n=x.plus(p),n>i)m=n,p[f]--,n=x.plus(p)}else n=m;return[n,p,m,a]}function N6(n,i,o,c){let[p,x,a,m]=L6(n,i,o),f=i-p,l=o.filter((v)=>["hours","minutes","seconds","milliseconds"].indexOf(v)>=0);if(l.length===0){if(a<i)a=p.plus({[m]:1});if(a!==p)x[m]=(x[m]||0)+f/(a-p)}let $=Sn.fromObject(x,c);if(l.length>0)return Sn.fromMillis(f,c).shiftTo(...l).plus($);else return $}var D6="missing Intl.DateTimeFormat.formatToParts support";function Wn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(E8(o))}}var C6=String.fromCharCode(160),ZT=`[ ${C6}]`,qT=new RegExp(ZT,"g");function h6(n){return n.replace(/\./g,"\\.?").replace(qT,ZT)}function Cv(n){return n.replace(/\./g,"").replace(qT," ").toLowerCase()}function lo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(h6).join("|")),deser:([o])=>n.findIndex((c)=>Cv(o)===Cv(c))+i}}function hv(n,i){return{regex:n,deser:([,o,c])=>Ca(o,c),groups:i}}function Oa(n){return{regex:n,deser:([i])=>i}}function I6(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function k6(n,i){let o=fo(i),c=fo(i,"{2}"),p=fo(i,"{3}"),x=fo(i,"{4}"),a=fo(i,"{6}"),m=fo(i,"{1,2}"),f=fo(i,"{1,3}"),l=fo(i,"{1,6}"),$=fo(i,"{1,9}"),v=fo(i,"{2,4}"),T=fo(i,"{4,6}"),F=(M)=>({regex:RegExp(I6(M.val)),deser:([G])=>G,literal:!0}),S=((M)=>{if(n.literal)return F(M);switch(M.val){case"G":return lo(i.eras("short"),0);case"GG":return lo(i.eras("long"),0);case"y":return Wn(l);case"yy":return Wn(v,nl);case"yyyy":return Wn(x);case"yyyyy":return Wn(T);case"yyyyyy":return Wn(a);case"M":return Wn(m);case"MM":return Wn(c);case"MMM":return lo(i.months("short",!0),1);case"MMMM":return lo(i.months("long",!0),1);case"L":return Wn(m);case"LL":return Wn(c);case"LLL":return lo(i.months("short",!1),1);case"LLLL":return lo(i.months("long",!1),1);case"d":return Wn(m);case"dd":return Wn(c);case"o":return Wn(f);case"ooo":return Wn(p);case"HH":return Wn(c);case"H":return Wn(m);case"hh":return Wn(c);case"h":return Wn(m);case"mm":return Wn(c);case"m":return Wn(m);case"q":return Wn(m);case"qq":return Wn(c);case"s":return Wn(m);case"ss":return Wn(c);case"S":return Wn(f);case"SSS":return Wn(p);case"u":return Oa($);case"uu":return Oa(m);case"uuu":return Wn(o);case"a":return lo(i.meridiems(),0);case"kkkk":return Wn(x);case"kk":return Wn(v,nl);case"W":return Wn(m);case"WW":return Wn(c);case"E":case"c":return Wn(o);case"EEE":return lo(i.weekdays("short",!1),1);case"EEEE":return lo(i.weekdays("long",!1),1);case"ccc":return lo(i.weekdays("short",!0),1);case"cccc":return lo(i.weekdays("long",!0),1);case"Z":case"ZZ":return hv(new RegExp(`([+-]${m.source})(?::(${c.source}))?`),2);case"ZZZ":return hv(new RegExp(`([+-]${m.source})(${c.source})?`),2);case"z":return Oa(/[a-z_+-/]{1,256}?/i);case" ":return Oa(/[^\S\n\r]/);default:return F(M)}})(n)||{invalidReason:D6};return S.token=n,S}var s6={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 Z6(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let f=/^\s+$/.test(p);return{literal:!f,val:f?" ":p}}let x=i[c],a=c;if(c==="hour")if(i.hour12!=null)a=i.hour12?"hour12":"hour24";else if(i.hourCycle!=null)if(i.hourCycle==="h11"||i.hourCycle==="h12")a="hour12";else a="hour24";else a=o.hour12?"hour12":"hour24";let m=s6[a];if(typeof m==="object")m=m[x];if(m)return{literal:!1,val:m};return}function q6(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}$`,n]}function P6(n,i,o){let c=n.match(i);if(c){let p={},x=1;for(let a in o)if(Tp(o,a)){let m=o[a],f=m.groups?m.groups+1:1;if(!m.literal&&m.token)p[m.token.val[0]]=m.deser(c.slice(x,x+f));x+=f}return[c,p]}else return[c,{}]}function t6(n){let i=(x)=>{switch(x){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=Yo.create(n.z);if(!pn(n.Z)){if(!o)o=new Mi(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=al(n.u);return[Object.keys(n).reduce((x,a)=>{let m=i(a);if(m)x[m]=n[a];return x},{}),o,c]}var kf=null;function r6(){if(!kf)kf=cn.fromMillis(1555555555555);return kf}function g6(n,i){if(n.literal)return n;let o=Fi.macroTokenToFormatOpts(n.val),c=rT(o,i);if(c==null||c.includes(void 0))return n;return c}function PT(n,i){return Array.prototype.concat(...n.map((o)=>g6(o,i)))}class vl{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=PT(Fi.parseFormat(i),n),this.units=this.tokens.map((o)=>k6(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=q6(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]=P6(n,this.regex,this.handlers),[c,p,x]=o?t6(o):[null,null,void 0];if(Tp(o,"a")&&Tp(o,"H"))throw new Qc("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:x}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function tT(n,i,o){return new vl(n,o).explainFromTokens(i)}function d6(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:a}=tT(n,i,o);return[c,p,x,a]}function rT(n,i){if(!n)return null;let c=Fi.create(i,n).dtFormatter(r6()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((a)=>Z6(a,n,x))}var sf="Invalid DateTime",Iv=8640000000000000;function Mx(n){return new ti("unsupported zone",`the zone "${n.name}" is not supported`)}function Zf(n){if(n.weekData===null)n.weekData=Ba(n.c);return n.weekData}function qf(n){if(n.localWeekData===null)n.localWeekData=Ba(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Hc(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 gT(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 x=o.offset(c);if(p===x)return[c,p];return[n-Math.min(p,x)*60*1000,Math.max(p,x)]}function Ea(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 _a(n,i,o){return gT(Da(n),i,o)}function kv(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,x={...n.c,year:c,month:p,day:Math.min(n.c.day,ya(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},a=Sn.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=Da(x),[f,l]=gT(m,o,n.zone);if(a!==0)f+=a,l=n.zone.offset(f);return{ts:f,o:l}}function mp(n,i,o,c,p,x){let{setZone:a,zone:m}=o;if(n&&Object.keys(n).length!==0||i){let f=i||m,l=cn.fromObject(n,{...o,zone:f,specificOffset:x});return a?l:l.setZone(m)}else return cn.invalid(new ti("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Ua(n,i,o=!0){return n.isValid?Fi.create(Gn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function Pf(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 sv(n,i,o,c,p,x){let a=gn(n.c.hour);if(i){if(a+=":",a+=gn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)a+=":"}else a+=gn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(a+=gn(n.c.second),n.c.millisecond!==0||!c)a+=".",a+=gn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!x)a+="Z";else if(n.o<0)a+="-",a+=gn(Math.trunc(-n.o/60)),a+=":",a+=gn(Math.trunc(-n.o%60));else a+="+",a+=gn(Math.trunc(n.o/60)),a+=":",a+=gn(Math.trunc(n.o%60));if(x)a+="["+n.zone.ianaName+"]";return a}var dT={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},e6={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},nW={ordinal:1,hour:0,minute:0,second:0,millisecond:0},eT=["year","month","day","hour","minute","second","millisecond"],iW=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],oW=["year","ordinal","hour","minute","second","millisecond"];function cW(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 il(n);return i}function Zv(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return cW(n)}}function pW(n){if(!ba[n]){if(ua===void 0)ua=Nn.now();ba[n]=n.offset(ua)}return ba[n]}function qv(n,i){let o=oc(i.zone,Nn.defaultZone);if(!o.isValid)return cn.invalid(Mx(o));let c=Gn.fromObject(i),p,x;if(!pn(n.year)){for(let f of eT)if(pn(n[f]))n[f]=dT[f];let a=zT(n)||HT(n);if(a)return cn.invalid(a);let m=pW(o);[p,x]=_a(n,m,o)}else p=Nn.now();return new cn({ts:p,zone:o,loc:c,o:x})}function Pv(n,i,o){let c=pn(o.round)?!0:o.round,p=(a,m)=>{return a=ml(a,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(a,m)},x=(a)=>{if(o.calendary)if(!i.hasSame(n,a))return i.startOf(a).diff(n.startOf(a),a).get(a);else return 0;else return i.diff(n,a).get(a)};if(o.unit)return p(x(o.unit),o.unit);for(let a of o.units){let m=x(a);if(Math.abs(m)>=1)return p(m,a)}return p(n>i?-0:0,o.units[o.units.length-1])}function tv(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 ua,ba={};class cn{constructor(n){let i=n.zone||Nn.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new ti("invalid input"):null)||(!i.isValid?Mx(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 a=cc(n.o)&&!n.old?n.o:i.offset(this.ts);c=Ea(this.ts,a),o=Number.isNaN(c.year)?new ti("invalid input"):null,c=o?null:c,p=o?null:a}this._zone=i,this.loc=n.loc||Gn.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]=tv(arguments),[o,c,p,x,a,m,f]=i;return qv({year:o,month:c,day:p,hour:x,minute:a,second:m,millisecond:f},n)}static utc(){let[n,i]=tv(arguments),[o,c,p,x,a,m,f]=i;return n.zone=Mi.utcInstance,qv({year:o,month:c,day:p,hour:x,minute:a,second:m,millisecond:f},n)}static fromJSDate(n,i={}){let o=b8(n)?n.valueOf():NaN;if(Number.isNaN(o))return cn.invalid("invalid input");let c=oc(i.zone,Nn.defaultZone);if(!c.isValid)return cn.invalid(Mx(c));return new cn({ts:o,zone:c,loc:Gn.fromObject(i)})}static fromMillis(n,i={}){if(!cc(n))throw new fi(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-Iv||n>Iv)return cn.invalid("Timestamp out of range");else return new cn({ts:n,zone:oc(i.zone,Nn.defaultZone),loc:Gn.fromObject(i)})}static fromSeconds(n,i={}){if(!cc(n))throw new fi("fromSeconds requires a numerical input");else return new cn({ts:n*1000,zone:oc(i.zone,Nn.defaultZone),loc:Gn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=oc(i.zone,Nn.defaultZone);if(!o.isValid)return cn.invalid(Mx(o));let c=Gn.fromObject(i),p=La(n,Zv),{minDaysInFirstWeek:x,startOfWeek:a}=uv(p,c),m=Nn.now(),f=!pn(i.specificOffset)?i.specificOffset:o.offset(m),l=!pn(p.ordinal),$=!pn(p.year),v=!pn(p.month)||!pn(p.day),T=$||v,F=p.weekYear||p.weekNumber;if((T||l)&&F)throw new Qc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(v&&l)throw new Qc("Can't mix ordinal dates with month/day");let R=F||p.weekday&&!T,S,M,G=Ea(m,f);if(R)S=iW,M=e6,G=Ba(G,x,a);else if(l)S=oW,M=nW,G=If(G);else S=eT,M=dT;let H=!1;for(let V of S){let X=p[V];if(!pn(X))H=!0;else if(H)p[V]=M[V];else p[V]=G[V]}let B=R?V8(p,x,a):l?_8(p):zT(p),k=B||HT(p);if(k)return cn.invalid(k);let Y=R?Vv(p,x,a):l?_v(p):p,[K,Q]=_a(Y,f,o),u=new cn({ts:K,zone:o,o:Q,loc:c});if(p.weekday&&T&&n.weekday!==u.weekday)return cn.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${u.toISO()}`);if(!u.isValid)return cn.invalid(u.invalid);return u}static fromISO(n,i={}){let[o,c]=G6(n);return mp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=Y6(n);return mp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=z6(n);return mp(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(pn(n)||pn(i))throw new fi("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,x=Gn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[a,m,f,l]=d6(x,n,i);if(l)return cn.invalid(l);else return mp(a,m,o,`format ${i}`,n,f)}static fromString(n,i,o={}){return cn.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=_6(n);return mp(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new fi("need to specify a reason the DateTime is invalid");let o=n instanceof ti?n:new ti(n,i);if(Nn.throwOnInvalid)throw new rv(o);else return new cn({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=rT(n,Gn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return PT(Fi.parseFormat(n),Gn.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){ua=void 0,ba={}}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?Zf(this).weekYear:NaN}get weekNumber(){return this.isValid?Zf(this).weekNumber:NaN}get weekday(){return this.isValid?Zf(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?qf(this).weekday:NaN}get localWeekNumber(){return this.isValid?qf(this).weekNumber:NaN}get localWeekYear(){return this.isValid?qf(this).weekYear:NaN}get ordinal(){return this.isValid?If(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=Da(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),x=this.zone.offset(o-c*i),a=this.zone.offset(o-p*i);if(x===a)return[this];let m=o-x*i,f=o-a*i,l=Ea(m,x),$=Ea(f,a);if(l.hour===$.hour&&l.minute===$.minute&&l.second===$.second&&l.millisecond===$.millisecond)return[Hc(this,{ts:m}),Hc(this,{ts:f})];return[this]}get isInLeapYear(){return Xx(this.year)}get daysInMonth(){return ya(this.year,this.month)}get daysInYear(){return this.isValid?$p(this.year):NaN}get weeksInWeekYear(){return this.isValid?Wx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Wx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Fi.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Mi.instance(n),i)}toLocal(){return this.setZone(Nn.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=oc(n,Nn.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return cn.invalid(Mx(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),x=this.toObject();[c]=_a(x,p,n)}return Hc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Hc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=La(n,Zv),{minDaysInFirstWeek:o,startOfWeek:c}=uv(i,this.loc),p=!pn(i.weekYear)||!pn(i.weekNumber)||!pn(i.weekday),x=!pn(i.ordinal),a=!pn(i.year),m=!pn(i.month)||!pn(i.day),f=a||m,l=i.weekYear||i.weekNumber;if((f||x)&&l)throw new Qc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&x)throw new Qc("Can't mix ordinal dates with month/day");let $;if(p)$=Vv({...Ba(this.c,o,c),...i},o,c);else if(!pn(i.ordinal))$=_v({...If(this.c),...i});else if($={...this.toObject(),...i},pn(i.day))$.day=Math.min(ya($.year,$.month),$.day);let[v,T]=_a($,this.o,this.zone);return Hc(this,{ts:v,o:T})}plus(n){if(!this.isValid)return this;let i=Sn.fromDurationLike(n);return Hc(this,kv(this,i))}minus(n){if(!this.isValid)return this;let i=Sn.fromDurationLike(n).negate();return Hc(this,kv(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=Sn.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:x}=this;if(x<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?Fi.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):sf}toLocaleString(n=ja,i={}){return this.isValid?Fi.create(this.loc.clone(i),n).formatDateTime(this):sf}toLocaleParts(n={}){return this.isValid?Fi.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 x=n==="extended",a=Pf(this,x);return a+="T",a+=sv(this,x,i,o,c,p),a}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return Pf(this,n==="extended")}toISOWeekDate(){return Ua(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:n=!1,suppressSeconds:i=!1,includeOffset:o=!0,includePrefix:c=!1,extendedZone:p=!1,format:x="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+sv(this,x==="extended",i,n,o,p)}toRFC2822(){return Ua(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ua(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){if(!this.isValid)return null;return Pf(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 Ua(this,c,!0)}toSQL(n={}){if(!this.isValid)return null;return`${this.toSQLDate()} ${this.toSQLTime(n)}`}toString(){return this.isValid?this.toISO():sf}[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 Sn.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=j8(i).map(Sn.normalizeUnit),x=n.valueOf()>this.valueOf(),a=x?this:n,m=x?n:this,f=N6(a,m,p,c);return x?f.negate():f}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 Pv(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return Pv(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 fi("min requires all arguments be DateTimes");return bv(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(cn.isDateTime))throw new fi("max requires all arguments be DateTimes");return bv(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=Gn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return tT(x,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=Gn.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new vl(p,n)}static fromFormatParser(n,i,o={}){if(pn(n)||pn(i))throw new fi("fromFormatParser requires an input string and a format parser");let{locale:c=null,numberingSystem:p=null}=o,x=Gn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!x.equals(i.locale))throw new fi(`fromFormatParser called with a locale of ${x}, but the format parser was created for ${i.locale}`);let{result:a,zone:m,specificOffset:f,invalidReason:l}=i.explainFromTokens(n);if(l)return cn.invalid(l);else return mp(a,m,o,`format ${i.format}`,n,f)}static get DATE_SHORT(){return ja}static get DATE_MED(){return ev}static get DATE_MED_WITH_WEEKDAY(){return v8}static get DATE_FULL(){return nT}static get DATE_HUGE(){return iT}static get TIME_SIMPLE(){return oT}static get TIME_WITH_SECONDS(){return cT}static get TIME_WITH_SHORT_OFFSET(){return pT}static get TIME_WITH_LONG_OFFSET(){return xT}static get TIME_24_SIMPLE(){return aT}static get TIME_24_WITH_SECONDS(){return mT}static get TIME_24_WITH_SHORT_OFFSET(){return fT}static get TIME_24_WITH_LONG_OFFSET(){return lT}static get DATETIME_SHORT(){return $T}static get DATETIME_SHORT_WITH_SECONDS(){return vT}static get DATETIME_MED(){return TT}static get DATETIME_MED_WITH_SECONDS(){return JT}static get DATETIME_MED_WITH_WEEKDAY(){return T8}static get DATETIME_FULL(){return wT}static get DATETIME_FULL_WITH_SECONDS(){return AT}static get DATETIME_HUGE(){return ST}static get DATETIME_HUGE_WITH_SECONDS(){return FT}}function Sx(n){if(cn.isDateTime(n))return n;else if(n&&n.valueOf&&cc(n.valueOf()))return cn.fromJSDate(n);else if(n&&typeof n==="object")return cn.fromObject(n);else throw new fi(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var xW="3.5.0";n1.DateTime=cn;n1.Duration=Sn;n1.FixedOffsetZone=Mi;n1.IANAZone=Yo;n1.Info=lp;n1.Interval=Cn;n1.InvalidZone=ol;n1.Settings=Nn;n1.SystemZone=Kx;n1.VERSION=xW;n1.Zone=Ec});var a1=h((o1)=>{Object.defineProperty(o1,"__esModule",{value:!0});o1.RE_RANGE=o1.RE_WILDCARDS=o1.PRESETS=o1.TIME_UNITS_LEN=o1.TIME_UNITS=o1.TIME_UNITS_MAP=o1.ALIASES=o1.PARSE_DEFAULTS=o1.MONTH_CONSTRAINTS=o1.CONSTRAINTS=void 0;o1.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});o1.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});o1.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});o1.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});o1.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});o1.TIME_UNITS=Object.freeze(Object.values(o1.TIME_UNITS_MAP));o1.TIME_UNITS_LEN=o1.TIME_UNITS.length;o1.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"});o1.RE_WILDCARDS=/\*/g;o1.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var Jl=h((f1)=>{Object.defineProperty(f1,"__esModule",{value:!0});f1.ExclusiveParametersError=f1.CronError=void 0;class Tl extends Error{}f1.CronError=Tl;class m1 extends Tl{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}f1.ExclusiveParametersError=m1});var T1=h(($1)=>{Object.defineProperty($1,"__esModule",{value:!0});$1.getRecordKeys=void 0;var zW=(n)=>{return Object.keys(n)};$1.getRecordKeys=zW});var Ia=h((A1)=>{Object.defineProperty(A1,"__esModule",{value:!0});A1.CronTime=void 0;var zo=i1(),xi=a1(),Ri=Jl(),J1=T1();class w1{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 Ri.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!zo.DateTime.fromObject({},{zone:i}).isValid)throw new Ri.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof zo.DateTime)this.source=n instanceof Date?zo.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=J1.getRecordKeys(this.month),i=J1.getRecordKeys(this.dayOfMonth),o=!1,c=null;for(let p of n){let x=xi.MONTH_CONSTRAINTS[p];for(let a of i)if(a<=x)o=!0;if(!o)c=p,console.warn(`Month '${p}' is limited to '${x}' days.`)}if(!o&&c!==null){let p=xi.MONTH_CONSTRAINTS[c];for(let x of i)if(x>p){delete this.dayOfMonth[x];let a=x%p;this.dayOfMonth[a]=!0}}}sendAt(n){let i=this.realDate&&this.source instanceof zo.DateTime?this.source:zo.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"),x=Math.abs(this.utcOffset-c*60),a=String(x).padStart(2,"0"),m=`UTC${o}${p}:${a}`;if(i=i.setZone(m),!i.isValid)throw new Ri.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(zo.DateTime.local()>i)throw new Ri.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()-zo.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return xi.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=zo.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 Ri.CronError("ERROR: You specified an invalid date.");let x=zo.DateTime.now().plus({years:8});while(!0){let a=c.toMillis()-n.toMillis();if(c>x)throw new Ri.CronError(`Something went wrong. No execution date was found in the next 8 years.
3
+ var g4=Object.create;var{getPrototypeOf:d4,defineProperty:Sf,getOwnPropertyNames:e4}=Object;var n8=Object.prototype.hasOwnProperty;var Ff=(n,i,o)=>{o=n!=null?g4(d4(n)):{};let c=i||!n||!n.__esModule?Sf(o,"default",{value:n,enumerable:!0}):o;for(let p of e4(n))if(!n8.call(c,p))Sf(c,p,{get:()=>n[p],enumerable:!0});return c};var h=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var i8=(n,i)=>{for(var o in i)Sf(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var cT=h((oT)=>{Object.defineProperty(oT,"__esModule",{value:!0});class xc extends Error{}class dv extends xc{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class ev extends xc{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class n1 extends xc{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class Qc extends xc{}class cl extends xc{constructor(n){super(`Invalid unit ${n}`)}}class li extends xc{}class Bo extends xc{constructor(){super("Zone is an abstract class")}}var j="numeric",vo="short",yi="long",jm={year:j,month:j,day:j},i1={year:j,month:vo,day:j},T8={year:j,month:vo,day:j,weekday:vo},o1={year:j,month:yi,day:j},c1={year:j,month:yi,day:j,weekday:yi},p1={hour:j,minute:j},x1={hour:j,minute:j,second:j},m1={hour:j,minute:j,second:j,timeZoneName:vo},a1={hour:j,minute:j,second:j,timeZoneName:yi},f1={hour:j,minute:j,hourCycle:"h23"},l1={hour:j,minute:j,second:j,hourCycle:"h23"},$1={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:vo},v1={hour:j,minute:j,second:j,hourCycle:"h23",timeZoneName:yi},T1={year:j,month:j,day:j,hour:j,minute:j},J1={year:j,month:j,day:j,hour:j,minute:j,second:j},w1={year:j,month:vo,day:j,hour:j,minute:j},A1={year:j,month:vo,day:j,hour:j,minute:j,second:j},J8={year:j,month:vo,day:j,weekday:vo,hour:j,minute:j},S1={year:j,month:yi,day:j,hour:j,minute:j,timeZoneName:vo},F1={year:j,month:yi,day:j,hour:j,minute:j,second:j,timeZoneName:vo},M1={year:j,month:yi,day:j,weekday:yi,hour:j,minute:j,timeZoneName:yi},R1={year:j,month:yi,day:j,weekday:yi,hour:j,minute:j,second:j,timeZoneName:yi};class Ec{get type(){throw new Bo}get name(){throw new Bo}get ianaName(){return this.name}get isUniversal(){throw new Bo}offsetName(n,i){throw new Bo}formatOffset(n,i){throw new Bo}offset(n){throw new Bo}equals(n){throw new Bo}get isValid(){throw new Bo}}var If=null;class Xx extends Ec{static get instance(){if(If===null)If=new Xx;return If}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return V1(n,i,o)}formatOffset(n,i){return Wx(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var Vm={};function w8(n){if(!Vm[n])Vm[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 Vm[n]}var A8={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function S8(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,m,a,f,l,$]=c;return[m,p,x,a,f,l,$]}function F8(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:m}=o[p],a=A8[x];if(x==="era")c[a]=m;else if(!pn(a))c[a]=parseInt(m,10)}return c}var Hm={};class Yo extends Ec{static create(n){if(!Hm[n])Hm[n]=new Yo(n);return Hm[n]}static resetCache(){Hm={},Vm={}}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=Yo.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return V1(n,i,o,this.name)}formatOffset(n,i){return Wx(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=w8(this.name),[c,p,x,m,a,f,l]=o.formatToParts?F8(o,i):S8(o,i);if(m==="BC")c=-Math.abs(c)+1;let v=Dm({year:c,month:p,day:x,hour:a===24?0:a,minute:f,second:l,millisecond:0}),T=+i,F=T%1000;return T-=F>=0?F:1000+F,(v-T)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var Xv={};function M8(n,i={}){let o=JSON.stringify([n,i]),c=Xv[o];if(!c)c=new Intl.ListFormat(n,i),Xv[o]=c;return c}var gf={};function df(n,i={}){let o=JSON.stringify([n,i]),c=gf[o];if(!c)c=new Intl.DateTimeFormat(n,i),gf[o]=c;return c}var ef={};function R8(n,i={}){let o=JSON.stringify([n,i]),c=ef[o];if(!c)c=new Intl.NumberFormat(n,i),ef[o]=c;return c}var nl={};function W8(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=nl[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),nl[p]=x;return x}var Mx=null;function K8(){if(Mx)return Mx;else return Mx=new Intl.DateTimeFormat().resolvedOptions().locale,Mx}var Gv={};function X8(n){let i=Gv[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,Gv[n]=i}return i}function G8(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=df(n).resolvedOptions(),p=n}catch(a){let f=n.substring(0,o);c=df(f).resolvedOptions(),p=f}let{numberingSystem:x,calendar:m}=c;return[p,x,m]}}function Y8(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 z8(n){let i=[];for(let o=1;o<=12;o++){let c=cn.utc(2009,o,1);i.push(n(c))}return i}function H8(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 Qm(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 Q8(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 W1{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...x}=o;if(!i||Object.keys(x).length>0){let m={useGrouping:!1,...o};if(o.padTo>0)m.minimumIntegerDigits=o.padTo;this.inf=R8(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):ll(n,3);return gn(i,this.padTo)}}}class K1{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 x=-1*(n.offset/60),m=x>=0?`Etc/GMT+${x}`:`Etc/GMT${x}`;if(n.offset!==0&&Yo.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=df(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 X1{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&E1())this.rtf=W8(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return t8(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var O8={firstDay:1,minimalDays:4,weekend:[6,7]};class Gn{static fromOpts(n){return Gn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||Nn.defaultLocale,m=x||(p?"en-US":K8()),a=i||Nn.defaultNumberingSystem,f=o||Nn.defaultOutputCalendar,l=il(c)||Nn.defaultWeekSettings;return new Gn(m,a,f,l,x)}static resetCache(){Mx=null,gf={},ef={},nl={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return Gn.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,m,a]=G8(n);this.locale=x,this.numberingSystem=i||m||null,this.outputCalendar=o||a||null,this.weekSettings=c,this.intl=Y8(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=Q8(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 Gn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,il(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 Qm(this,n,b1,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=z8((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Qm(this,n,y1,()=>{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]=H8((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Qm(this,void 0,()=>L1,()=>{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 Qm(this,n,N1,()=>{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(),x=p.find((m)=>m.type.toLowerCase()===o);return x?x.value:null}numberFormatter(n={}){return new W1(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new K1(n,this.intl,i)}relFormatter(n={}){return new X1(this.intl,this.isEnglish(),n)}listFormatter(n={}){return M8(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(!U1())return O8;else return X8(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 kf=null;class Ri extends Ec{static get utcInstance(){if(kf===null)kf=new Ri(0);return kf}static instance(n){return n===0?Ri.utcInstance:new Ri(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Ri(Cm(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Wx(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Wx(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Wx(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 pl extends Ec{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 cc(n,i){if(pn(n)||n===null)return i;else if(n instanceof Ec)return n;else if(b8(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Xx.instance;else if(o==="utc"||o==="gmt")return Ri.utcInstance;else return Ri.parseSpecifier(o)||Yo.create(n)}else if(pc(n))return Ri.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new pl(n)}var xl={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"},Yv={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]},E8=xl.hanidec.replace(/[\[|\]]/g,"").split("");function U8(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(xl.hanidec)!==-1)i+=E8.indexOf(n[o]);else for(let p in Yv){let[x,m]=Yv[p];if(c>=x&&c<=m)i+=c-x}}return parseInt(i,10)}else return i}var lp={};function V8(){lp={}}function lo({numberingSystem:n},i=""){let o=n||"latn";if(!lp[o])lp[o]={};if(!lp[o][i])lp[o][i]=new RegExp(`${xl[o]}${i}`);return lp[o][i]}var zv=()=>Date.now(),Hv="system",Qv=null,Ov=null,Ev=null,Uv=60,Vv,_v=null;class Nn{static get now(){return zv}static set now(n){zv=n}static set defaultZone(n){Hv=n}static get defaultZone(){return cc(Hv,Xx.instance)}static get defaultLocale(){return Qv}static set defaultLocale(n){Qv=n}static get defaultNumberingSystem(){return Ov}static set defaultNumberingSystem(n){Ov=n}static get defaultOutputCalendar(){return Ev}static set defaultOutputCalendar(n){Ev=n}static get defaultWeekSettings(){return _v}static set defaultWeekSettings(n){_v=il(n)}static get twoDigitCutoffYear(){return Uv}static set twoDigitCutoffYear(n){Uv=n%100}static get throwOnInvalid(){return Vv}static set throwOnInvalid(n){Vv=n}static resetCaches(){Gn.resetCache(),Yo.resetCache(),cn.resetCache(),V8()}}class ti{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var G1=[0,31,59,90,120,151,181,212,243,273,304,334],Y1=[0,31,60,91,121,152,182,213,244,274,305,335];function ri(n,i){return new ti("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function ml(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 z1(n,i,o){return o+(Gx(n)?Y1:G1)[i-1]}function H1(n,i){let o=Gx(n)?Y1:G1,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function al(n,i){return(n-i+7)%7+1}function Bm(n,i=4,o=1){let{year:c,month:p,day:x}=n,m=z1(c,p,x),a=al(ml(c,p,x),o),f=Math.floor((m-a+14-i)/7),l;if(f<1)l=c-1,f=Kx(l,i,o);else if(f>Kx(c,i,o))l=c+1,f=1;else l=c;return{weekYear:l,weekNumber:f,weekday:a,...hm(n)}}function uv(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,m=al(ml(c,1,i),o),a=vp(c),f=p*7+x-m-7+i,l;if(f<1)l=c-1,f+=vp(l);else if(f>a)l=c+1,f-=vp(c);else l=c;let{month:$,day:v}=H1(l,f);return{year:l,month:$,day:v,...hm(n)}}function sf(n){let{year:i,month:o,day:c}=n,p=z1(i,o,c);return{year:i,ordinal:p,...hm(n)}}function bv(n){let{year:i,ordinal:o}=n,{month:c,day:p}=H1(i,o);return{year:i,month:c,day:p,...hm(n)}}function jv(n,i){if(!pn(n.localWeekday)||!pn(n.localWeekNumber)||!pn(n.localWeekYear)){if(!pn(n.weekday)||!pn(n.weekNumber)||!pn(n.weekYear))throw new Qc("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 _8(n,i=4,o=1){let c=Nm(n.weekYear),p=gi(n.weekNumber,1,Kx(n.weekYear,i,o)),x=gi(n.weekday,1,7);if(!c)return ri("weekYear",n.weekYear);else if(!p)return ri("week",n.weekNumber);else if(!x)return ri("weekday",n.weekday);else return!1}function u8(n){let i=Nm(n.year),o=gi(n.ordinal,1,vp(n.year));if(!i)return ri("year",n.year);else if(!o)return ri("ordinal",n.ordinal);else return!1}function Q1(n){let i=Nm(n.year),o=gi(n.month,1,12),c=gi(n.day,1,ym(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 O1(n){let{hour:i,minute:o,second:c,millisecond:p}=n,x=gi(i,0,23)||i===24&&o===0&&c===0&&p===0,m=gi(o,0,59),a=gi(c,0,59),f=gi(p,0,999);if(!x)return ri("hour",i);else if(!m)return ri("minute",o);else if(!a)return ri("second",c);else if(!f)return ri("millisecond",p);else return!1}function pn(n){return typeof n==="undefined"}function pc(n){return typeof n==="number"}function Nm(n){return typeof n==="number"&&n%1===0}function b8(n){return typeof n==="string"}function j8(n){return Object.prototype.toString.call(n)==="[object Date]"}function E1(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function U1(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function B8(n){return Array.isArray(n)?n:[n]}function Bv(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let x=[i(p),p];if(!c)return x;else if(o(c[0],x[0])===c[0])return c;else return x},null)[1]}function y8(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function Jp(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function il(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 Nm(n)&&n>=i&&n<=o}function L8(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 oc(n){if(pn(n)||n===null||n==="")return;else return parseInt(n,10)}function zc(n){if(pn(n)||n===null||n==="")return;else return parseFloat(n)}function fl(n){if(pn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function ll(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Gx(n){return n%4===0&&(n%100!==0||n%400===0)}function vp(n){return Gx(n)?366:365}function ym(n,i){let o=L8(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Gx(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function Dm(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 yv(n,i,o){return-al(ml(n,1,i),o)+i-1}function Kx(n,i=4,o=1){let c=yv(n,i,o),p=yv(n+1,i,o);return(vp(n)-c+p)/7}function ol(n){if(n>99)return n;else return n>Nn.twoDigitCutoffYear?1900+n:2000+n}function V1(n,i,o,c=null){let p=new Date(n),x={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)x.timeZone=c;let m={timeZoneName:i,...x},a=new Intl.DateTimeFormat(o,m).formatToParts(p).find((f)=>f.type.toLowerCase()==="timezonename");return a?a.value:null}function Cm(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 _1(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new li(`Invalid unit value ${n}`);return i}function Lm(n,i){let o={};for(let c in n)if(Jp(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=_1(p)}return o}function Wx(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 hm(n){return y8(n,["hour","minute","second","millisecond"])}var N8=["January","February","March","April","May","June","July","August","September","October","November","December"],u1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],D8=["J","F","M","A","M","J","J","A","S","O","N","D"];function b1(n){switch(n){case"narrow":return[...D8];case"short":return[...u1];case"long":return[...N8];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 j1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],B1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],C8=["M","T","W","T","F","S","S"];function y1(n){switch(n){case"narrow":return[...C8];case"short":return[...B1];case"long":return[...j1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var L1=["AM","PM"],h8=["Before Christ","Anno Domini"],I8=["BC","AD"],k8=["B","A"];function N1(n){switch(n){case"narrow":return[...k8];case"short":return[...I8];case"long":return[...h8];default:return null}}function s8(n){return L1[n.hour<12?0:1]}function Z8(n,i){return y1(i)[n.weekday-1]}function q8(n,i){return b1(i)[n.month-1]}function P8(n,i){return N1(i)[n.year<0?0:1]}function t8(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."]},x=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&x){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,a=Math.abs(i),f=a===1,l=p[n],$=c?f?l[1]:l[2]||l[1]:f?p[n][0]:n;return m?`${a} ${$} ago`:`in ${a} ${$}`}function Lv(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var r8={D:jm,DD:i1,DDD:o1,DDDD:c1,t:p1,tt:x1,ttt:m1,tttt:a1,T:f1,TT:l1,TTT:$1,TTTT:v1,f:T1,ff:w1,fff:S1,ffff:M1,F:J1,FF:A1,FFF:F1,FFFF:R1};class Mi{static create(n,i={}){return new Mi(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let x=0;x<n.length;x++){let m=n.charAt(x);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 r8[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=(T,F)=>this.loc.extract(n,T,F),x=(T)=>{if(n.isOffsetFixed&&n.offset===0&&T.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,T.format):""},m=()=>o?s8(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(T,F)=>o?q8(n,T):p(F?{month:T}:{month:T,day:"numeric"},"month"),f=(T,F)=>o?Z8(n,T):p(F?{weekday:T}:{weekday:T,month:"long",day:"numeric"},"weekday"),l=(T)=>{let F=Mi.macroTokenToFormatOpts(T);if(F)return this.formatWithSystemDefault(n,F);else return T},$=(T)=>o?P8(n,T):p({era:T},"era"),v=(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 x({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return x({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return x({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 f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("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 a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("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 a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("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 l(T)}};return Lv(Mi.parseFormat(i),v)}formatDurationFromString(n,i){let o=(a)=>{switch(a[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=(a)=>(f)=>{let l=o(f);if(l)return this.num(a.get(l),f.length);else return f},p=Mi.parseFormat(i),x=p.reduce((a,{literal:f,val:l})=>f?a:a.concat(l),[]),m=n.shiftTo(...x.map(o).filter((a)=>a));return Lv(p,c(m))}}var D1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function wp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}$`)}function Ap(...n){return(i)=>n.reduce(([o,c,p],x)=>{let[m,a,f]=x(i,p);return[{...o,...m},a||c,f]},[{},null,1]).slice(0,2)}function Sp(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 C1(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=oc(i[o+p]);return[c,null,o+p]}}var h1=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,g8=`(?:${h1.source}?(?:\\[(${D1.source})\\])?)?`,$l=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,I1=RegExp(`${$l.source}${g8}`),vl=RegExp(`(?:T${I1.source})?`),d8=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,e8=/(\d{4})-?W(\d\d)(?:-?(\d))?/,n6=/(\d{4})-?(\d{3})/,i6=C1("weekYear","weekNumber","weekDay"),o6=C1("year","ordinal"),c6=/(\d{4})-(\d\d)-(\d\d)/,k1=RegExp(`${$l.source} ?(?:${h1.source}|(${D1.source}))?`),p6=RegExp(`(?: ${k1.source})?`);function Tp(n,i,o){let c=n[i];return pn(c)?o:oc(c)}function x6(n,i){return[{year:Tp(n,i),month:Tp(n,i+1,1),day:Tp(n,i+2,1)},null,i+3]}function Fp(n,i){return[{hours:Tp(n,i,0),minutes:Tp(n,i+1,0),seconds:Tp(n,i+2,0),milliseconds:fl(n[i+3])},null,i+4]}function Yx(n,i){let o=!n[i]&&!n[i+1],c=Cm(n[i+1],n[i+2]),p=o?null:Ri.instance(c);return[{},p,i+3]}function zx(n,i){let o=n[i]?Yo.create(n[i]):null;return[{},o,i+1]}var m6=RegExp(`^T?${$l.source}$`),a6=/^-?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 f6(n){let[i,o,c,p,x,m,a,f,l]=n,$=i[0]==="-",v=f&&f[0]==="-",T=(F,R=!1)=>F!==void 0&&(R||F&&$)?-F:F;return[{years:T(zc(o)),months:T(zc(c)),weeks:T(zc(p)),days:T(zc(x)),hours:T(zc(m)),minutes:T(zc(a)),seconds:T(zc(f),f==="-0"),milliseconds:T(fl(l),v)}]}var l6={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tl(n,i,o,c,p,x,m){let a={year:i.length===2?ol(oc(i)):oc(i),month:u1.indexOf(o)+1,day:oc(c),hour:oc(p),minute:oc(x)};if(m)a.second=oc(m);if(n)a.weekday=n.length>3?j1.indexOf(n)+1:B1.indexOf(n)+1;return a}var $6=/^(?:(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 v6(n){let[,i,o,c,p,x,m,a,f,l,$,v]=n,T=Tl(i,p,c,o,x,m,a),F;if(f)F=l6[f];else if(l)F=0;else F=Cm($,v);return[T,new Ri(F)]}function T6(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var J6=/^(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$/,w6=/^(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$/,A6=/^(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 Nv(n){let[,i,o,c,p,x,m,a]=n;return[Tl(i,p,c,o,x,m,a),Ri.utcInstance]}function S6(n){let[,i,o,c,p,x,m,a]=n;return[Tl(i,a,o,c,p,x,m),Ri.utcInstance]}var F6=wp(d8,vl),M6=wp(e8,vl),R6=wp(n6,vl),W6=wp(I1),s1=Ap(x6,Fp,Yx,zx),K6=Ap(i6,Fp,Yx,zx),X6=Ap(o6,Fp,Yx,zx),G6=Ap(Fp,Yx,zx);function Y6(n){return Sp(n,[F6,s1],[M6,K6],[R6,X6],[W6,G6])}function z6(n){return Sp(T6(n),[$6,v6])}function H6(n){return Sp(n,[J6,Nv],[w6,Nv],[A6,S6])}function Q6(n){return Sp(n,[a6,f6])}var O6=Ap(Fp);function E6(n){return Sp(n,[m6,O6])}var U6=wp(c6,p6),V6=wp(k1),_6=Ap(Fp,Yx,zx);function u6(n){return Sp(n,[U6,s1],[V6,_6])}var Dv="Invalid Duration",Z1={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}},b6={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},...Z1},Pi=365.2425,mp=30.436875,j6={years:{quarters:4,months:12,weeks:Pi/7,days:Pi,hours:Pi*24,minutes:Pi*24*60,seconds:Pi*24*60*60,milliseconds:Pi*24*60*60*1000},quarters:{months:3,weeks:Pi/28,days:Pi/4,hours:Pi*24/4,minutes:Pi*24*60/4,seconds:Pi*24*60*60/4,milliseconds:Pi*24*60*60*1000/4},months:{weeks:mp/7,days:mp,hours:mp*24,minutes:mp*24*60,seconds:mp*24*60*60,milliseconds:mp*24*60*60*1000},...Z1},Oc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],B6=Oc.slice(0).reverse();function ic(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 Sn(c)}function q1(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of B6.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function Cv(n,i){let o=q1(n,i)<0?-1:1;Oc.reduceRight((c,p)=>{if(!pn(i[p])){if(c){let x=i[c]*o,m=n[p][c],a=Math.floor(x/m);i[p]+=a*o,i[c]-=a*m*o}return p}else return c},null),Oc.reduce((c,p)=>{if(!pn(i[p])){if(c){let x=i[c]%1;i[c]-=x,i[p]+=x*n[c][p]}return p}else return c},null)}function y6(n){let i={};for(let[o,c]of Object.entries(n))if(c!==0)i[o]=c;return i}class Sn{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?j6:b6;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||Gn.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return Sn.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 Sn({values:Lm(n,Sn.normalizeUnit),loc:Gn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(pc(n))return Sn.fromMillis(n);else if(Sn.isDuration(n))return n;else if(typeof n==="object")return Sn.fromObject(n);else throw new li(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=Q6(n);if(o)return Sn.fromObject(o,i);else return Sn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=E6(n);if(o)return Sn.fromObject(o,i);else return Sn.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 ti?n:new ti(n,i);if(Nn.throwOnInvalid)throw new n1(o);else return new Sn({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?Mi.create(this.loc,o).formatDurationFromString(this,n):Dv}toHuman(n={}){if(!this.isValid)return Dv;let i=Oc.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+=ll(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 q1(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=Sn.fromDurationLike(n),o={};for(let c of Oc)if(Jp(i.values,c)||Jp(this.values,c))o[c]=i.get(c)+this.get(c);return ic(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=Sn.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]=_1(n(this.values[o],o));return ic(this,{values:i},!0)}get(n){return this[Sn.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,...Lm(n,Sn.normalizeUnit)};return ic(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let x={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return ic(this,x)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return Cv(this.matrix,n),ic(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=y6(this.normalize().shiftToAll().toObject());return ic(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((x)=>Sn.normalizeUnit(x));let i={},o={},c=this.toObject(),p;for(let x of Oc)if(n.indexOf(x)>=0){p=x;let m=0;for(let f in o)m+=this.matrix[f][x]*o[f],o[f]=0;if(pc(c[x]))m+=c[x];let a=Math.trunc(m);i[x]=a,o[x]=(m*1000-a*1000)/1000}else if(pc(c[x]))o[x]=c[x];for(let x in o)if(o[x]!==0)i[p]+=x===p?o[x]:o[x]/this.matrix[p][x];return Cv(this.matrix,i),ic(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 ic(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 Oc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var ap="Invalid Interval";function L6(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 ti?n:new ti(n,i);if(Nn.throwOnInvalid)throw new ev(o);else return new Cn({invalid:o})}static fromDateTimes(n,i){let o=Fx(n),c=Fx(i),p=L6(o,c);if(p==null)return new Cn({start:o,end:c});else return p}static after(n,i){let o=Sn.fromDurationLike(i),c=Fx(n);return Cn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=Sn.fromDurationLike(i),c=Fx(n);return Cn.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,x;try{p=cn.fromISO(o,i),x=p.isValid}catch(f){x=!1}let m,a;try{m=cn.fromISO(c,i),a=m.isValid}catch(f){a=!1}if(x&&a)return Cn.fromDateTimes(p,m);if(x){let f=Sn.fromISO(c,i);if(f.isValid)return Cn.after(p,f)}else if(a){let f=Sn.fromISO(o,i);if(f.isValid)return Cn.before(m,f)}}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(Fx).filter((x)=>this.contains(x)).sort((x,m)=>x.toMillis()-m.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let x=i[p]||this.e,m=+x>+this.e?this.e:x;o.push(Cn.fromDateTimes(c,m)),c=m,p+=1}return o}splitBy(n){let i=Sn.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,x=[];while(o<this.e){let m=this.start.plus(i.mapUnits((a)=>a*c));p=+m>+this.e?this.e:m,x.push(Cn.fromDateTimes(o,p)),o=p,c+=1}return x}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],x)=>{if(!p)return[c,x];else if(p.overlaps(x)||p.abutsStart(x))return[c,p.union(x)];else return[c.concat([p]),x]},[[],null]);if(o)i.push(o);return i}static xor(n){let i=null,o=0,c=[],p=n.map((a)=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),x=Array.prototype.concat(...p),m=x.sort((a,f)=>a.time-f.time);for(let a of m)if(o+=a.type==="s"?1:-1,o===1)i=a.time;else{if(i&&+i!==+a.time)c.push(Cn.fromDateTimes(i,a.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=jm,i={}){return this.isValid?Mi.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 Sn.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return Cn.fromDateTimes(n(this.s),n(this.e))}}class $p{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 Yo.isValidZone(n)}static normalizeZone(n){return cc(n,Nn.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||Gn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||Gn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||Gn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Gn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Gn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Gn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Gn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return Gn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return Gn.create(i,null,"gregory").eras(n)}static features(){return{relative:E1(),localeWeek:U1()}}}function hv(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(Sn.fromMillis(c).as("days"))}function N6(n,i,o){let c=[["years",(f,l)=>l.year-f.year],["quarters",(f,l)=>l.quarter-f.quarter+(l.year-f.year)*4],["months",(f,l)=>l.month-f.month+(l.year-f.year)*12],["weeks",(f,l)=>{let $=hv(f,l);return($-$%7)/7}],["days",hv]],p={},x=n,m,a;for(let[f,l]of c)if(o.indexOf(f)>=0)if(m=f,p[f]=l(n,i),a=x.plus(p),a>i){if(p[f]--,n=x.plus(p),n>i)a=n,p[f]--,n=x.plus(p)}else n=a;return[n,p,a,m]}function D6(n,i,o,c){let[p,x,m,a]=N6(n,i,o),f=i-p,l=o.filter((v)=>["hours","minutes","seconds","milliseconds"].indexOf(v)>=0);if(l.length===0){if(m<i)m=p.plus({[a]:1});if(m!==p)x[a]=(x[a]||0)+f/(m-p)}let $=Sn.fromObject(x,c);if(l.length>0)return Sn.fromMillis(f,c).shiftTo(...l).plus($);else return $}var C6="missing Intl.DateTimeFormat.formatToParts support";function Wn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(U8(o))}}var h6=String.fromCharCode(160),P1=`[ ${h6}]`,t1=new RegExp(P1,"g");function I6(n){return n.replace(/\./g,"\\.?").replace(t1,P1)}function Iv(n){return n.replace(/\./g,"").replace(t1," ").toLowerCase()}function $o(n,i){if(n===null)return null;else return{regex:RegExp(n.map(I6).join("|")),deser:([o])=>n.findIndex((c)=>Iv(o)===Iv(c))+i}}function kv(n,i){return{regex:n,deser:([,o,c])=>Cm(o,c),groups:i}}function Om(n){return{regex:n,deser:([i])=>i}}function k6(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function s6(n,i){let o=lo(i),c=lo(i,"{2}"),p=lo(i,"{3}"),x=lo(i,"{4}"),m=lo(i,"{6}"),a=lo(i,"{1,2}"),f=lo(i,"{1,3}"),l=lo(i,"{1,6}"),$=lo(i,"{1,9}"),v=lo(i,"{2,4}"),T=lo(i,"{4,6}"),F=(M)=>({regex:RegExp(k6(M.val)),deser:([G])=>G,literal:!0}),S=((M)=>{if(n.literal)return F(M);switch(M.val){case"G":return $o(i.eras("short"),0);case"GG":return $o(i.eras("long"),0);case"y":return Wn(l);case"yy":return Wn(v,ol);case"yyyy":return Wn(x);case"yyyyy":return Wn(T);case"yyyyyy":return Wn(m);case"M":return Wn(a);case"MM":return Wn(c);case"MMM":return $o(i.months("short",!0),1);case"MMMM":return $o(i.months("long",!0),1);case"L":return Wn(a);case"LL":return Wn(c);case"LLL":return $o(i.months("short",!1),1);case"LLLL":return $o(i.months("long",!1),1);case"d":return Wn(a);case"dd":return Wn(c);case"o":return Wn(f);case"ooo":return Wn(p);case"HH":return Wn(c);case"H":return Wn(a);case"hh":return Wn(c);case"h":return Wn(a);case"mm":return Wn(c);case"m":return Wn(a);case"q":return Wn(a);case"qq":return Wn(c);case"s":return Wn(a);case"ss":return Wn(c);case"S":return Wn(f);case"SSS":return Wn(p);case"u":return Om($);case"uu":return Om(a);case"uuu":return Wn(o);case"a":return $o(i.meridiems(),0);case"kkkk":return Wn(x);case"kk":return Wn(v,ol);case"W":return Wn(a);case"WW":return Wn(c);case"E":case"c":return Wn(o);case"EEE":return $o(i.weekdays("short",!1),1);case"EEEE":return $o(i.weekdays("long",!1),1);case"ccc":return $o(i.weekdays("short",!0),1);case"cccc":return $o(i.weekdays("long",!0),1);case"Z":case"ZZ":return kv(new RegExp(`([+-]${a.source})(?::(${c.source}))?`),2);case"ZZZ":return kv(new RegExp(`([+-]${a.source})(${c.source})?`),2);case"z":return Om(/[a-z_+-/]{1,256}?/i);case" ":return Om(/[^\S\n\r]/);default:return F(M)}})(n)||{invalidReason:C6};return S.token=n,S}var Z6={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 q6(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let f=/^\s+$/.test(p);return{literal:!f,val:f?" ":p}}let x=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 a=Z6[m];if(typeof a==="object")a=a[x];if(a)return{literal:!1,val:a};return}function P6(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}$`,n]}function t6(n,i,o){let c=n.match(i);if(c){let p={},x=1;for(let m in o)if(Jp(o,m)){let a=o[m],f=a.groups?a.groups+1:1;if(!a.literal&&a.token)p[a.token.val[0]]=a.deser(c.slice(x,x+f));x+=f}return[c,p]}else return[c,{}]}function r6(n){let i=(x)=>{switch(x){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=Yo.create(n.z);if(!pn(n.Z)){if(!o)o=new Ri(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=fl(n.u);return[Object.keys(n).reduce((x,m)=>{let a=i(m);if(a)x[a]=n[m];return x},{}),o,c]}var Zf=null;function g6(){if(!Zf)Zf=cn.fromMillis(1555555555555);return Zf}function d6(n,i){if(n.literal)return n;let o=Mi.macroTokenToFormatOpts(n.val),c=d1(o,i);if(c==null||c.includes(void 0))return n;return c}function r1(n,i){return Array.prototype.concat(...n.map((o)=>d6(o,i)))}class Jl{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=r1(Mi.parseFormat(i),n),this.units=this.tokens.map((o)=>s6(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=P6(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]=t6(n,this.regex,this.handlers),[c,p,x]=o?r6(o):[null,null,void 0];if(Jp(o,"a")&&Jp(o,"H"))throw new Qc("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:x}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function g1(n,i,o){return new Jl(n,o).explainFromTokens(i)}function e6(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:m}=g1(n,i,o);return[c,p,x,m]}function d1(n,i){if(!n)return null;let c=Mi.create(i,n).dtFormatter(g6()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((m)=>q6(m,n,x))}var qf="Invalid DateTime",sv=8640000000000000;function Rx(n){return new ti("unsupported zone",`the zone "${n.name}" is not supported`)}function Pf(n){if(n.weekData===null)n.weekData=Bm(n.c);return n.weekData}function tf(n){if(n.localWeekData===null)n.localWeekData=Bm(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Hc(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 e1(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 x=o.offset(c);if(p===x)return[c,p];return[n-Math.min(p,x)*60*1000,Math.max(p,x)]}function Em(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 _m(n,i,o){return e1(Dm(n),i,o)}function Zv(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,x={...n.c,year:c,month:p,day:Math.min(n.c.day,ym(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},m=Sn.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"),a=Dm(x),[f,l]=e1(a,o,n.zone);if(m!==0)f+=m,l=n.zone.offset(f);return{ts:f,o:l}}function fp(n,i,o,c,p,x){let{setZone:m,zone:a}=o;if(n&&Object.keys(n).length!==0||i){let f=i||a,l=cn.fromObject(n,{...o,zone:f,specificOffset:x});return m?l:l.setZone(a)}else return cn.invalid(new ti("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Um(n,i,o=!0){return n.isValid?Mi.create(Gn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function rf(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 qv(n,i,o,c,p,x){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&&!x)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(x)m+="["+n.zone.ianaName+"]";return m}var nT={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},nW={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iW={ordinal:1,hour:0,minute:0,second:0,millisecond:0},iT=["year","month","day","hour","minute","second","millisecond"],oW=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],cW=["year","ordinal","hour","minute","second","millisecond"];function pW(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 Pv(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return pW(n)}}function xW(n){if(!bm[n]){if(um===void 0)um=Nn.now();bm[n]=n.offset(um)}return bm[n]}function tv(n,i){let o=cc(i.zone,Nn.defaultZone);if(!o.isValid)return cn.invalid(Rx(o));let c=Gn.fromObject(i),p,x;if(!pn(n.year)){for(let f of iT)if(pn(n[f]))n[f]=nT[f];let m=Q1(n)||O1(n);if(m)return cn.invalid(m);let a=xW(o);[p,x]=_m(n,a,o)}else p=Nn.now();return new cn({ts:p,zone:o,loc:c,o:x})}function rv(n,i,o){let c=pn(o.round)?!0:o.round,p=(m,a)=>{return m=ll(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,a)},x=(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(x(o.unit),o.unit);for(let m of o.units){let a=x(m);if(Math.abs(a)>=1)return p(a,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function gv(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 um,bm={};class cn{constructor(n){let i=n.zone||Nn.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new ti("invalid input"):null)||(!i.isValid?Rx(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 m=pc(n.o)&&!n.old?n.o:i.offset(this.ts);c=Em(this.ts,m),o=Number.isNaN(c.year)?new ti("invalid input"):null,c=o?null:c,p=o?null:m}this._zone=i,this.loc=n.loc||Gn.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]=gv(arguments),[o,c,p,x,m,a,f]=i;return tv({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static utc(){let[n,i]=gv(arguments),[o,c,p,x,m,a,f]=i;return n.zone=Ri.utcInstance,tv({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static fromJSDate(n,i={}){let o=j8(n)?n.valueOf():NaN;if(Number.isNaN(o))return cn.invalid("invalid input");let c=cc(i.zone,Nn.defaultZone);if(!c.isValid)return cn.invalid(Rx(c));return new cn({ts:o,zone:c,loc:Gn.fromObject(i)})}static fromMillis(n,i={}){if(!pc(n))throw new li(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-sv||n>sv)return cn.invalid("Timestamp out of range");else return new cn({ts:n,zone:cc(i.zone,Nn.defaultZone),loc:Gn.fromObject(i)})}static fromSeconds(n,i={}){if(!pc(n))throw new li("fromSeconds requires a numerical input");else return new cn({ts:n*1000,zone:cc(i.zone,Nn.defaultZone),loc:Gn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=cc(i.zone,Nn.defaultZone);if(!o.isValid)return cn.invalid(Rx(o));let c=Gn.fromObject(i),p=Lm(n,Pv),{minDaysInFirstWeek:x,startOfWeek:m}=jv(p,c),a=Nn.now(),f=!pn(i.specificOffset)?i.specificOffset:o.offset(a),l=!pn(p.ordinal),$=!pn(p.year),v=!pn(p.month)||!pn(p.day),T=$||v,F=p.weekYear||p.weekNumber;if((T||l)&&F)throw new Qc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(v&&l)throw new Qc("Can't mix ordinal dates with month/day");let R=F||p.weekday&&!T,S,M,G=Em(a,f);if(R)S=oW,M=nW,G=Bm(G,x,m);else if(l)S=cW,M=iW,G=sf(G);else S=iT,M=nT;let H=!1;for(let V of S){let X=p[V];if(!pn(X))H=!0;else if(H)p[V]=M[V];else p[V]=G[V]}let y=R?_8(p,x,m):l?u8(p):Q1(p),k=y||O1(p);if(k)return cn.invalid(k);let Y=R?uv(p,x,m):l?bv(p):p,[K,Q]=_m(Y,f,o),u=new cn({ts:K,zone:o,o:Q,loc:c});if(p.weekday&&T&&n.weekday!==u.weekday)return cn.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${u.toISO()}`);if(!u.isValid)return cn.invalid(u.invalid);return u}static fromISO(n,i={}){let[o,c]=Y6(n);return fp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=z6(n);return fp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=H6(n);return fp(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,x=Gn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,a,f,l]=e6(x,n,i);if(l)return cn.invalid(l);else return fp(m,a,o,`format ${i}`,n,f)}static fromString(n,i,o={}){return cn.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=u6(n);return fp(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 ti?n:new ti(n,i);if(Nn.throwOnInvalid)throw new dv(o);else return new cn({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=d1(n,Gn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return r1(Mi.parseFormat(n),Gn.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){um=void 0,bm={}}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?Pf(this).weekYear:NaN}get weekNumber(){return this.isValid?Pf(this).weekNumber:NaN}get weekday(){return this.isValid?Pf(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?tf(this).weekday:NaN}get localWeekNumber(){return this.isValid?tf(this).weekNumber:NaN}get localWeekYear(){return this.isValid?tf(this).weekYear:NaN}get ordinal(){return this.isValid?sf(this.c).ordinal:NaN}get monthShort(){return this.isValid?$p.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?$p.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?$p.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?$p.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=Dm(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),x=this.zone.offset(o-c*i),m=this.zone.offset(o-p*i);if(x===m)return[this];let a=o-x*i,f=o-m*i,l=Em(a,x),$=Em(f,m);if(l.hour===$.hour&&l.minute===$.minute&&l.second===$.second&&l.millisecond===$.millisecond)return[Hc(this,{ts:a}),Hc(this,{ts:f})];return[this]}get isInLeapYear(){return Gx(this.year)}get daysInMonth(){return ym(this.year,this.month)}get daysInYear(){return this.isValid?vp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Kx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Kx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Mi.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Ri.instance(n),i)}toLocal(){return this.setZone(Nn.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=cc(n,Nn.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return cn.invalid(Rx(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),x=this.toObject();[c]=_m(x,p,n)}return Hc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Hc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=Lm(n,Pv),{minDaysInFirstWeek:o,startOfWeek:c}=jv(i,this.loc),p=!pn(i.weekYear)||!pn(i.weekNumber)||!pn(i.weekday),x=!pn(i.ordinal),m=!pn(i.year),a=!pn(i.month)||!pn(i.day),f=m||a,l=i.weekYear||i.weekNumber;if((f||x)&&l)throw new Qc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&x)throw new Qc("Can't mix ordinal dates with month/day");let $;if(p)$=uv({...Bm(this.c,o,c),...i},o,c);else if(!pn(i.ordinal))$=bv({...sf(this.c),...i});else if($={...this.toObject(),...i},pn(i.day))$.day=Math.min(ym($.year,$.month),$.day);let[v,T]=_m($,this.o,this.zone);return Hc(this,{ts:v,o:T})}plus(n){if(!this.isValid)return this;let i=Sn.fromDurationLike(n);return Hc(this,Zv(this,i))}minus(n){if(!this.isValid)return this;let i=Sn.fromDurationLike(n).negate();return Hc(this,Zv(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=Sn.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:x}=this;if(x<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?Mi.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):qf}toLocaleString(n=jm,i={}){return this.isValid?Mi.create(this.loc.clone(i),n).formatDateTime(this):qf}toLocaleParts(n={}){return this.isValid?Mi.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 x=n==="extended",m=rf(this,x);return m+="T",m+=qv(this,x,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return rf(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:x="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+qv(this,x==="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 rf(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():qf}[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 Sn.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=B8(i).map(Sn.normalizeUnit),x=n.valueOf()>this.valueOf(),m=x?this:n,a=x?n:this,f=D6(m,a,p,c);return x?f.negate():f}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 rv(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return rv(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 Bv(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(cn.isDateTime))throw new li("max requires all arguments be DateTimes");return Bv(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=Gn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return g1(x,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=Gn.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new Jl(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,x=Gn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!x.equals(i.locale))throw new li(`fromFormatParser called with a locale of ${x}, but the format parser was created for ${i.locale}`);let{result:m,zone:a,specificOffset:f,invalidReason:l}=i.explainFromTokens(n);if(l)return cn.invalid(l);else return fp(m,a,o,`format ${i.format}`,n,f)}static get DATE_SHORT(){return jm}static get DATE_MED(){return i1}static get DATE_MED_WITH_WEEKDAY(){return T8}static get DATE_FULL(){return o1}static get DATE_HUGE(){return c1}static get TIME_SIMPLE(){return p1}static get TIME_WITH_SECONDS(){return x1}static get TIME_WITH_SHORT_OFFSET(){return m1}static get TIME_WITH_LONG_OFFSET(){return a1}static get TIME_24_SIMPLE(){return f1}static get TIME_24_WITH_SECONDS(){return l1}static get TIME_24_WITH_SHORT_OFFSET(){return $1}static get TIME_24_WITH_LONG_OFFSET(){return v1}static get DATETIME_SHORT(){return T1}static get DATETIME_SHORT_WITH_SECONDS(){return J1}static get DATETIME_MED(){return w1}static get DATETIME_MED_WITH_SECONDS(){return A1}static get DATETIME_MED_WITH_WEEKDAY(){return J8}static get DATETIME_FULL(){return S1}static get DATETIME_FULL_WITH_SECONDS(){return F1}static get DATETIME_HUGE(){return M1}static get DATETIME_HUGE_WITH_SECONDS(){return R1}}function Fx(n){if(cn.isDateTime(n))return n;else if(n&&n.valueOf&&pc(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 mW="3.5.0";oT.DateTime=cn;oT.Duration=Sn;oT.FixedOffsetZone=Ri;oT.IANAZone=Yo;oT.Info=$p;oT.Interval=Cn;oT.InvalidZone=pl;oT.Settings=Nn;oT.SystemZone=Xx;oT.VERSION=mW;oT.Zone=Ec});var fT=h((pT)=>{Object.defineProperty(pT,"__esModule",{value:!0});pT.RE_RANGE=pT.RE_WILDCARDS=pT.PRESETS=pT.TIME_UNITS_LEN=pT.TIME_UNITS=pT.TIME_UNITS_MAP=pT.ALIASES=pT.PARSE_DEFAULTS=pT.MONTH_CONSTRAINTS=pT.CONSTRAINTS=void 0;pT.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});pT.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});pT.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});pT.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});pT.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});pT.TIME_UNITS=Object.freeze(Object.values(pT.TIME_UNITS_MAP));pT.TIME_UNITS_LEN=pT.TIME_UNITS.length;pT.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"});pT.RE_WILDCARDS=/\*/g;pT.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var Al=h(($T)=>{Object.defineProperty($T,"__esModule",{value:!0});$T.ExclusiveParametersError=$T.CronError=void 0;class wl extends Error{}$T.CronError=wl;class lT extends wl{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}$T.ExclusiveParametersError=lT});var wT=h((TT)=>{Object.defineProperty(TT,"__esModule",{value:!0});TT.getRecordKeys=void 0;var HW=(n)=>{return Object.keys(n)};TT.getRecordKeys=HW});var Im=h((FT)=>{Object.defineProperty(FT,"__esModule",{value:!0});FT.CronTime=void 0;var zo=cT(),xi=fT(),Wi=Al(),AT=wT();class ST{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 Wi.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!zo.DateTime.fromObject({},{zone:i}).isValid)throw new Wi.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof zo.DateTime)this.source=n instanceof Date?zo.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=AT.getRecordKeys(this.month),i=AT.getRecordKeys(this.dayOfMonth),o=!1,c=null;for(let p of n){let x=xi.MONTH_CONSTRAINTS[p];for(let m of i)if(m<=x)o=!0;if(!o)c=p,console.warn(`Month '${p}' is limited to '${x}' days.`)}if(!o&&c!==null){let p=xi.MONTH_CONSTRAINTS[c];for(let x of i)if(x>p){delete this.dayOfMonth[x];let m=x%p;this.dayOfMonth[m]=!0}}}sendAt(n){let i=this.realDate&&this.source instanceof zo.DateTime?this.source:zo.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"),x=Math.abs(this.utcOffset-c*60),m=String(x).padStart(2,"0"),a=`UTC${o}${p}:${m}`;if(i=i.setZone(a),!i.isValid)throw new Wi.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(zo.DateTime.local()>i)throw new Wi.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()-zo.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return xi.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=zo.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 Wi.CronError("ERROR: You specified an invalid date.");let x=zo.DateTime.now().plus({years:8});while(!0){let m=c.toMillis()-n.toMillis();if(c>x)throw new Wi.CronError(`Something went wrong. No execution date was found in the next 8 years.
4
4
  \t\t\t\t\t\t\tPlease provide the following string if you would like to help debug:
5
- \t\t\t\t\t\t\tTime 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: ${zo.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,f]=this._findPreviousDSTJump(c);if(c=f,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,f]=this._findPreviousDSTJump(c);if(c=f,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,f]=this._findPreviousDSTJump(c);if(c=f,m)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let m=c.hour===23&&a>86400000?0:c.hour+1,f=c.minute;if(c=c.set({hour:m}),c=c.set({minute:0,second:0}),this._forwardDSTJump(m,f,c)){let[l,$]=this._findPreviousDSTJump(c);if(c=$,l)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let m=c.minute===59&&a>3600000?0:c.minute+1,f=c.hour+(m===60?1:0);if(c=c.set({minute:m}),c=c.set({second:0}),this._forwardDSTJump(f,m,c)){let[l,$]=this._findPreviousDSTJump(c);if(c=$,l)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let m=c.second===59&&a>60000?0:c.second+1,f=c.minute+(m===60?1:0),l=c.hour+(f===60?1:0);if(c=c.set({second:m}),this._forwardDSTJump(l,f,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}if(c.toMillis()===p){let m=c.second+1,f=c.minute+(m===60?1:0),l=c.hour+(f===60?1:0);if(c=c.set({second:m}),this._forwardDSTJump(l,f,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}break}return c}_findPreviousDSTJump(n){var i;let o,c,p,x,a=n,m=1440,f=0;do{if(++f>m)throw new Ri.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=a.minute-1,c=a.hour,o<0)o+=60,c=(c+24-1)%24;a=a.minus({minute:1}),p=a.minute,x=a.hour}while(o===p&&c===x);let l=a.plus({minute:1}).set({second:0,millisecond:0}),$=l.minus({second:1});if(n.month+1 in this.month&&n.day in this.dayOfMonth&&this._getWeekDay(n)in this.dayOfWeek)return[this._checkTimeInSkippedRange($,l),l];return[!1,l]}_checkTimeInSkippedRange(n,i){let o=(n.minute+1)%60,c=(n.hour+(o===0?1:0))%24,p=i.hour-c+1,x=o===0&&i.minute===0;if(p===2&&x)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 Ri.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},(f,l)=>i+l),x=Array.from({length:c},(f,l)=>l),a=Array.from({length:60},(f,l)=>l),m=(f)=>{if(f===n)return p;else if(f===o)return x;else return a};for(let f=n;f<=o;++f){if(!(f in this.hour))continue;let l=m(f);for(let $ of l)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,x=n%24<c,a=i%60<p;return x||a}_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=xi.CONSTRAINTS[n],o=i[0],c=n===xi.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,x=c;p<x;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(xi.PRESETS).includes(n))n=xi.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(xi.ALIASES).includes(p))return xi.ALIASES[p].toString();throw new Ri.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<xi.TIME_UNITS_LEN-1)throw new Ri.CronError("Too few fields");if(o.length>xi.TIME_UNITS_LEN)throw new Ri.CronError("Too many fields");let c=o.length;for(let p of xi.TIME_UNITS){let x=xi.TIME_UNITS.indexOf(p),a=(i=o[x-(xi.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:xi.PARSE_DEFAULTS[p];this._parseField(a,p)}}_parseField(n,i){let o=this[i],c,p=xi.CONSTRAINTS[i],x=p[0],a=p[1];n.split(",").forEach((l)=>{let $=l.indexOf("*");if($!==-1&&$!==0)throw new Ri.CronError(`Field (${l}) has an invalid wildcard expression`)}),n=n.replace(xi.RE_WILDCARDS,`${x}-${a}`);let f=n.split(",");for(let l of f){let $=[...l.matchAll(xi.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,v,T,F]=$,R=parseInt(v,10),S=T!==void 0?parseInt(T,10):void 0,M=F!==void 0,G=parseInt(F!==null&&F!==void 0?F:"1",10);if(G===0)throw new Ri.CronError(`Field (${i}) has a step of zero`);if(S!==void 0&&R>S)throw new Ri.CronError(`Field (${i}) has an invalid range`);if(R<x||S!==void 0&&S>a||S===void 0&&R>a)throw new Ri.CronError(`Field value (${n}) is out of range`);if(R=Math.min(Math.max(x,~~Math.abs(R)),a),S!==void 0)S=Math.min(a,~~Math.abs(S));else S=M?a:R;c=R;do o[c]=!0,c+=G;while(c<=S);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new Ri.CronError(`Field (${i}) cannot be parsed`)}}}A1.CronTime=w1});var W1=h((M1)=>{Object.defineProperty(M1,"__esModule",{value:!0});M1.CronJob=void 0;var F1=import.meta.require("child_process"),wl=Jl(),ka=Ia();class zx{constructor(n,i,o,c,p,x,a,m,f){if(this.running=!1,this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this._callbacks=[],this.context=x!==null&&x!==void 0?x:this,p!=null&&m!=null)throw new wl.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new ka.CronTime(n,p,null);else if(m!=null)this.cronTime=new ka.CronTime(n,null,m);else this.cronTime=new ka.CronTime(n,p,m);if(f!=null)this.unrefTimeout=f;if(o!=null)this.onComplete=this._fnWrap(o);if(this.cronTime.realDate)this.runOnce=!0;if(this.addCallback(this._fnWrap(i)),a)this.lastExecution=new Date,this.fireOnTick();if(c)this.start()}static from(n){if(n.timeZone!=null&&n.utcOffset!=null)throw new wl.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new zx(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 zx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout);else return new zx(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 F1.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return F1.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 ka.CronTime))throw new wl.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=(a)=>{if(c=Date.now(),this._timeout=setTimeout(x,a),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},x=()=>{let a=c+i-Date.now();if(a>0){let m=this.cronTime.getTimeout();if(m>a)m=a;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)}}M1.CronJob=zx});var Al=h((sa)=>{Object.defineProperty(sa,"__esModule",{value:!0});sa.timeout=sa.sendAt=sa.CronTime=sa.CronJob=void 0;var K1=Ia(),HW=W1();Object.defineProperty(sa,"CronJob",{enumerable:!0,get:function(){return HW.CronJob}});var QW=Ia();Object.defineProperty(sa,"CronTime",{enumerable:!0,get:function(){return QW.CronTime}});var OW=(n)=>new K1.CronTime(n).sendAt();sa.sendAt=OW;var EW=(n)=>new K1.CronTime(n).getTimeout();sa.timeout=EW});var TA=h((Py,bl)=>{bl.exports=vA;bl.exports.preferredCharsets=vA;var LW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function NW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=DW(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function DW(n,i){var o=LW.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var a=0;a<x.length;a++){var m=x[a].trim().split("=");if(m[0]==="q"){p=parseFloat(m[1]);break}}}return{charset:c,q:p,i}}function CW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=hW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function hW(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 vA(n,i){var o=NW(n===void 0?"*":n||"");if(!i)return o.filter($A).sort(lA).map(IW);var c=i.map(function p(x,a){return CW(x,o,a)});return c.filter($A).sort(lA).map(function p(x){return i[c.indexOf(x)]})}function lA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function IW(n){return n.charset}function $A(n){return n.q>0}});var FA=h((ty,jl)=>{jl.exports=SA;jl.exports.preferredEncodings=SA;var kW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function sW(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var a=ZW(i[p].trim(),p);if(a)i[x++]=a,o=o||AA("identity",a),c=Math.min(c,a.q||1)}if(!o)i[x++]={encoding:"identity",q:c,i:p};return i.length=x,i}function ZW(n,i){var o=kW.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var a=0;a<x.length;a++){var m=x[a].trim().split("=");if(m[0]==="q"){p=parseFloat(m[1]);break}}}return{encoding:c,q:p,i}}function qW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=AA(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}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 SA(n,i){var o=sW(n||"");if(!i)return o.filter(wA).sort(JA).map(PW);var c=i.map(function p(x,a){return qW(x,o,a)});return c.filter(wA).sort(JA).map(function p(x){return i[c.indexOf(x)]})}function JA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function PW(n){return n.encoding}function wA(n){return n.q>0}});var XA=h((ry,Bl)=>{Bl.exports=KA;Bl.exports.preferredLanguages=KA;var tW=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function rW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=WA(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function WA(n,i){var o=tW.exec(n);if(!o)return null;var c=o[1],p=o[2],x=c;if(p)x+="-"+p;var a=1;if(o[3]){var m=o[3].split(";");for(var f=0;f<m.length;f++){var l=m[f].split("=");if(l[0]==="q")a=parseFloat(l[1])}}return{prefix:c,suffix:p,q:a,i,full:x}}function gW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=dW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function dW(n,i,o){var c=WA(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 KA(n,i){var o=rW(n===void 0?"*":n||"");if(!i)return o.filter(RA).sort(MA).map(eW);var c=i.map(function p(x,a){return gW(x,o,a)});return c.filter(RA).sort(MA).map(function p(x){return i[c.indexOf(x)]})}function MA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function eW(n){return n.full}function RA(n){return n.q>0}});var OA=h((gy,yl)=>{yl.exports=HA;yl.exports.preferredMediaTypes=HA;var n7=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function i7(n){var i=a7(n);for(var o=0,c=0;o<i.length;o++){var p=zA(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function zA(n,i){var o=n7.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],a=o[1];if(o[3]){var m=m7(o[3]).map(x7);for(var f=0;f<m.length;f++){var l=m[f],$=l[0].toLowerCase(),v=l[1],T=v&&v[0]==='"'&&v[v.length-1]==='"'?v.substr(1,v.length-2):v;if($==="q"){p=parseFloat(T);break}c[$]=T}}return{type:a,subtype:x,params:c,q:p,i}}function o7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=c7(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function c7(n,i,o){var c=zA(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 x=Object.keys(i.params);if(x.length>0)if(x.every(function(a){return i.params[a]=="*"||(i.params[a]||"").toLowerCase()==(c.params[a]||"").toLowerCase()}))p|=1;else return null;return{i:o,o:i.i,q:i.q,s:p}}function HA(n,i){var o=i7(n===void 0?"*/*":n||"");if(!i)return o.filter(YA).sort(GA).map(p7);var c=i.map(function p(x,a){return o7(x,o,a)});return c.filter(YA).sort(GA).map(function p(x){return i[c.indexOf(x)]})}function GA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function p7(n){return n.type+"/"+n.subtype}function YA(n){return n.q>0}function QA(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function x7(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 a7(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(QA(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function m7(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(QA(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 EA=h((dy,Ll)=>{/*!
5
+ \t\t\t\t\t\t\tTime 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: ${zo.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[a,f]=this._findPreviousDSTJump(c);if(c=f,a)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[a,f]=this._findPreviousDSTJump(c);if(c=f,a)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[a,f]=this._findPreviousDSTJump(c);if(c=f,a)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let a=c.hour===23&&m>86400000?0:c.hour+1,f=c.minute;if(c=c.set({hour:a}),c=c.set({minute:0,second:0}),this._forwardDSTJump(a,f,c)){let[l,$]=this._findPreviousDSTJump(c);if(c=$,l)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let a=c.minute===59&&m>3600000?0:c.minute+1,f=c.hour+(a===60?1:0);if(c=c.set({minute:a}),c=c.set({second:0}),this._forwardDSTJump(f,a,c)){let[l,$]=this._findPreviousDSTJump(c);if(c=$,l)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let a=c.second===59&&m>60000?0:c.second+1,f=c.minute+(a===60?1:0),l=c.hour+(f===60?1:0);if(c=c.set({second:a}),this._forwardDSTJump(l,f,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}if(c.toMillis()===p){let a=c.second+1,f=c.minute+(a===60?1:0),l=c.hour+(f===60?1:0);if(c=c.set({second:a}),this._forwardDSTJump(l,f,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}break}return c}_findPreviousDSTJump(n){var i;let o,c,p,x,m=n,a=1440,f=0;do{if(++f>a)throw new Wi.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,x=m.hour}while(o===p&&c===x);let l=m.plus({minute:1}).set({second:0,millisecond:0}),$=l.minus({second:1});if(n.month in this.month&&n.day in this.dayOfMonth&&this._getWeekDay(n)in this.dayOfWeek)return[this._checkTimeInSkippedRange($,l),l];return[!1,l]}_checkTimeInSkippedRange(n,i){let o=(n.minute+1)%60,c=(n.hour+(o===0?1:0))%24,p=i.hour-c+1,x=o===0&&i.minute===0;if(p===2&&x)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 Wi.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},(f,l)=>i+l),x=Array.from({length:c},(f,l)=>l),m=Array.from({length:60},(f,l)=>l),a=(f)=>{if(f===n)return p;else if(f===o)return x;else return m};for(let f=n;f<=o;++f){if(!(f in this.hour))continue;let l=a(f);for(let $ of l)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,x=n%24<c,m=i%60<p;return x||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=xi.CONSTRAINTS[n],o=i[0],c=n===xi.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,x=c;p<x;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(xi.PRESETS).includes(n))n=xi.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(xi.ALIASES).includes(p))return xi.ALIASES[p].toString();throw new Wi.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<xi.TIME_UNITS_LEN-1)throw new Wi.CronError("Too few fields");if(o.length>xi.TIME_UNITS_LEN)throw new Wi.CronError("Too many fields");let c=o.length;for(let p of xi.TIME_UNITS){let x=xi.TIME_UNITS.indexOf(p),m=(i=o[x-(xi.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:xi.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=xi.CONSTRAINTS[i],x=p[0],m=p[1];n.split(",").forEach((l)=>{let $=l.indexOf("*");if($!==-1&&$!==0)throw new Wi.CronError(`Field (${l}) has an invalid wildcard expression`)}),n=n.replace(xi.RE_WILDCARDS,`${x}-${m}`);let f=n.split(",");for(let l of f){let $=[...l.matchAll(xi.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,v,T,F]=$,R=parseInt(v,10),S=T!==void 0?parseInt(T,10):void 0,M=F!==void 0,G=parseInt(F!==null&&F!==void 0?F:"1",10);if(G===0)throw new Wi.CronError(`Field (${i}) has a step of zero`);if(S!==void 0&&R>S)throw new Wi.CronError(`Field (${i}) has an invalid range`);if(R<x||S!==void 0&&S>m||S===void 0&&R>m)throw new Wi.CronError(`Field value (${n}) is out of range`);if(R=Math.min(Math.max(x,~~Math.abs(R)),m),S!==void 0)S=Math.min(m,~~Math.abs(S));else S=M?m:R;c=R;do o[c]=!0,c+=G;while(c<=S);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new Wi.CronError(`Field (${i}) cannot be parsed`)}}}FT.CronTime=ST});var WT=h((Mp)=>{var km=Mp&&Mp.__awaiter||function(n,i,o,c){function p(x){return x instanceof o?x:new o(function(m){m(x)})}return new(o||(o=Promise))(function(x,m){function a($){try{l(c.next($))}catch(v){m(v)}}function f($){try{l(c.throw($))}catch(v){m(v)}}function l($){$.done?x($.value):p($.value).then(a,f)}l((c=c.apply(n,i||[])).next())})};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.CronJob=void 0;var RT=import.meta.require("child_process"),Sl=Al(),sm=Im();class Hx{get isCallbackRunning(){return this._isCallbackRunning}constructor(n,i,o,c,p,x,m,a,f,l){if(this.running=!1,this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this.waitForCompletion=!1,this._isCallbackRunning=!1,this._callbacks=[],this.context=x!==null&&x!==void 0?x:this,this.waitForCompletion=Boolean(l),p!=null&&a!=null)throw new Sl.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new sm.CronTime(n,p,null);else if(a!=null)this.cronTime=new sm.CronTime(n,null,a);else this.cronTime=new sm.CronTime(n,p,a);if(f!=null)this.unrefTimeout=f;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 Sl.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Hx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion);else if(n.utcOffset!=null)return new Hx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion);else return new Hx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion)}_fnWrap(n){var i,o;switch(typeof n){case"function":return n;case"string":{let[c,...p]=n.split(" ");return RT.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return RT.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 sm.CronTime))throw new Sl.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(){return km(this,void 0,void 0,function*(){if(this.waitForCompletion&&this._isCallbackRunning)return;this._isCallbackRunning=!0;try{for(let n of this._callbacks){let i=n.call(this.context,this.onComplete);if(this.waitForCompletion)yield i}}catch(n){console.error("[Cron] error in callback",n)}finally{this._isCallbackRunning=!1}})}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(x,m),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},x=()=>{let m=c+i-Date.now();if(m>0){let a=this.cronTime.getTimeout();if(a>m)a=m;o+=a}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}_executeOnComplete(){return km(this,void 0,void 0,function*(){if(typeof this.onComplete!=="function")return;try{yield this.onComplete.call(this.context)}catch(n){console.error("[Cron] error in onComplete callback:",n)}})}_waitForJobCompletion(){return km(this,void 0,void 0,function*(){while(this._isCallbackRunning)yield new Promise((n)=>setTimeout(n,100))})}stop(){if(this._timeout)clearTimeout(this._timeout);if(this.running=!1,!this.waitForCompletion){this._executeOnComplete();return}Promise.resolve().then(()=>km(this,void 0,void 0,function*(){yield this._waitForJobCompletion(),yield this._executeOnComplete()}))}}Mp.CronJob=Hx});var Fl=h((Zm)=>{Object.defineProperty(Zm,"__esModule",{value:!0});Zm.timeout=Zm.sendAt=Zm.CronTime=Zm.CronJob=void 0;var KT=Im(),QW=WT();Object.defineProperty(Zm,"CronJob",{enumerable:!0,get:function(){return QW.CronJob}});var OW=Im();Object.defineProperty(Zm,"CronTime",{enumerable:!0,get:function(){return OW.CronTime}});var EW=(n)=>new KT.CronTime(n).sendAt();Zm.sendAt=EW;var UW=(n)=>new KT.CronTime(n).getTimeout();Zm.timeout=UW});var TA=h((cL,Bl)=>{Bl.exports=vA;Bl.exports.preferredCharsets=vA;var DW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function CW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=hW(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function hW(n,i){var o=DW.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{charset:c,q:p,i}}function IW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=kW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function kW(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 vA(n,i){var o=CW(n===void 0?"*":n||"");if(!i)return o.filter($A).sort(lA).map(sW);var c=i.map(function p(x,m){return IW(x,o,m)});return c.filter($A).sort(lA).map(function p(x){return i[c.indexOf(x)]})}function lA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function sW(n){return n.charset}function $A(n){return n.q>0}});var FA=h((pL,yl)=>{yl.exports=SA;yl.exports.preferredEncodings=SA;var ZW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function qW(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var m=PW(i[p].trim(),p);if(m)i[x++]=m,o=o||AA("identity",m),c=Math.min(c,m.q||1)}if(!o)i[x++]={encoding:"identity",q:c,i:p};return i.length=x,i}function PW(n,i){var o=ZW.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{encoding:c,q:p,i}}function tW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=AA(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}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 SA(n,i){var o=qW(n||"");if(!i)return o.filter(wA).sort(JA).map(rW);var c=i.map(function p(x,m){return tW(x,o,m)});return c.filter(wA).sort(JA).map(function p(x){return i[c.indexOf(x)]})}function JA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function rW(n){return n.encoding}function wA(n){return n.q>0}});var XA=h((xL,Ll)=>{Ll.exports=KA;Ll.exports.preferredLanguages=KA;var gW=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function dW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=WA(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function WA(n,i){var o=gW.exec(n);if(!o)return null;var c=o[1],p=o[2],x=c;if(p)x+="-"+p;var m=1;if(o[3]){var a=o[3].split(";");for(var f=0;f<a.length;f++){var l=a[f].split("=");if(l[0]==="q")m=parseFloat(l[1])}}return{prefix:c,suffix:p,q:m,i,full:x}}function eW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=n3(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function n3(n,i,o){var c=WA(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 KA(n,i){var o=dW(n===void 0?"*":n||"");if(!i)return o.filter(RA).sort(MA).map(i3);var c=i.map(function p(x,m){return eW(x,o,m)});return c.filter(RA).sort(MA).map(function p(x){return i[c.indexOf(x)]})}function MA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function i3(n){return n.full}function RA(n){return n.q>0}});var OA=h((mL,Nl)=>{Nl.exports=HA;Nl.exports.preferredMediaTypes=HA;var o3=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function c3(n){var i=f3(n);for(var o=0,c=0;o<i.length;o++){var p=zA(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function zA(n,i){var o=o3.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],m=o[1];if(o[3]){var a=l3(o[3]).map(a3);for(var f=0;f<a.length;f++){var l=a[f],$=l[0].toLowerCase(),v=l[1],T=v&&v[0]==='"'&&v[v.length-1]==='"'?v.substr(1,v.length-2):v;if($==="q"){p=parseFloat(T);break}c[$]=T}}return{type:m,subtype:x,params:c,q:p,i}}function p3(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=x3(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function x3(n,i,o){var c=zA(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 x=Object.keys(i.params);if(x.length>0)if(x.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 HA(n,i){var o=c3(n===void 0?"*/*":n||"");if(!i)return o.filter(YA).sort(GA).map(m3);var c=i.map(function p(x,m){return p3(x,o,m)});return c.filter(YA).sort(GA).map(function p(x){return i[c.indexOf(x)]})}function GA(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function m3(n){return n.type+"/"+n.subtype}function YA(n){return n.q>0}function QA(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function a3(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 f3(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(QA(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function l3(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(QA(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 EA=h((aL,Dl)=>{/*!
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 f7=TA(),l7=FA(),$7=XA(),v7=OA();Ll.exports=zn;Ll.exports.Negotiator=zn;function zn(n){if(!(this instanceof zn))return new zn(n);this.request=n}zn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};zn.prototype.charsets=function n(i){return f7(this.request.headers["accept-charset"],i)};zn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};zn.prototype.encodings=function n(i){return l7(this.request.headers["accept-encoding"],i)};zn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};zn.prototype.languages=function n(i){return $7(this.request.headers["accept-language"],i)};zn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};zn.prototype.mediaTypes=function n(i){return v7(this.request.headers.accept,i)};zn.prototype.preferredCharset=zn.prototype.charset;zn.prototype.preferredCharsets=zn.prototype.charsets;zn.prototype.preferredEncoding=zn.prototype.encoding;zn.prototype.preferredEncodings=zn.prototype.encodings;zn.prototype.preferredLanguage=zn.prototype.language;zn.prototype.preferredLanguages=zn.prototype.languages;zn.prototype.preferredMediaType=zn.prototype.mediaType;zn.prototype.preferredMediaTypes=zn.prototype.mediaTypes});var UA=h((ey,T7)=>{T7.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 _A=h((nL,VA)=>{/*!
11
+ */var $3=TA(),v3=FA(),T3=XA(),J3=OA();Dl.exports=zn;Dl.exports.Negotiator=zn;function zn(n){if(!(this instanceof zn))return new zn(n);this.request=n}zn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};zn.prototype.charsets=function n(i){return $3(this.request.headers["accept-charset"],i)};zn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};zn.prototype.encodings=function n(i){return v3(this.request.headers["accept-encoding"],i)};zn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};zn.prototype.languages=function n(i){return T3(this.request.headers["accept-language"],i)};zn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};zn.prototype.mediaTypes=function n(i){return J3(this.request.headers.accept,i)};zn.prototype.preferredCharset=zn.prototype.charset;zn.prototype.preferredCharsets=zn.prototype.charsets;zn.prototype.preferredEncoding=zn.prototype.encoding;zn.prototype.preferredEncodings=zn.prototype.encodings;zn.prototype.preferredLanguage=zn.prototype.language;zn.prototype.preferredLanguages=zn.prototype.languages;zn.prototype.preferredMediaType=zn.prototype.mediaType;zn.prototype.preferredMediaTypes=zn.prototype.mediaTypes});var UA=h((fL,w3)=>{w3.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 _A=h((lL,VA)=>{/*!
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
- */VA.exports=UA()});var yA=h((R7)=>{/*!
16
+ */VA.exports=UA()});var yA=h((K3)=>{/*!
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 Jm=_A(),J7=import.meta.require("path").extname,uA=/^\s*([^;\s]*)(?:;|\s|$)/,w7=/^text\//i;R7.charset=bA;R7.charsets={lookup:bA};R7.contentType=A7;R7.extension=S7;R7.extensions=Object.create(null);R7.lookup=F7;R7.types=Object.create(null);M7(R7.extensions,R7.types);function bA(n){if(!n||typeof n!=="string")return!1;var i=uA.exec(n),o=i&&Jm[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&w7.test(i[1]))return"UTF-8";return!1}function A7(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?R7.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=R7.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function S7(n){if(!n||typeof n!=="string")return!1;var i=uA.exec(n),o=i&&R7.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function F7(n){if(!n||typeof n!=="string")return!1;var i=J7("x."+n).toLowerCase().substr(1);if(!i)return!1;return R7.types[i]||!1}function M7(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(Jm).forEach(function c(p){var x=Jm[p],a=x.extensions;if(!a||!a.length)return;n[p]=a;for(var m=0;m<a.length;m++){var f=a[m];if(i[f]){var l=o.indexOf(Jm[i[f]].source),$=o.indexOf(x.source);if(i[f]!=="application/octet-stream"&&(l>$||l===$&&i[f].substr(0,12)==="application/"))continue}i[f]=p}})}});var wm=h((oL,LA)=>{/*!
21
+ */var wa=_A(),A3=import.meta.require("path").extname,uA=/^\s*([^;\s]*)(?:;|\s|$)/,S3=/^text\//i;K3.charset=bA;K3.charsets={lookup:bA};K3.contentType=F3;K3.extension=M3;K3.extensions=Object.create(null);K3.lookup=R3;K3.types=Object.create(null);W3(K3.extensions,K3.types);function bA(n){if(!n||typeof n!=="string")return!1;var i=uA.exec(n),o=i&&wa[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&S3.test(i[1]))return"UTF-8";return!1}function F3(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?K3.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=K3.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function M3(n){if(!n||typeof n!=="string")return!1;var i=uA.exec(n),o=i&&K3.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function R3(n){if(!n||typeof n!=="string")return!1;var i=A3("x."+n).toLowerCase().substr(1);if(!i)return!1;return K3.types[i]||!1}function W3(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(wa).forEach(function c(p){var x=wa[p],m=x.extensions;if(!m||!m.length)return;n[p]=m;for(var a=0;a<m.length;a++){var f=m[a];if(i[f]){var l=o.indexOf(wa[i[f]].source),$=o.indexOf(x.source);if(i[f]!=="application/octet-stream"&&(l>$||l===$&&i[f].substr(0,12)==="application/"))continue}i[f]=p}})}});var Aa=h((vL,LA)=>{/*!
22
22
  * accepts
23
23
  * Copyright(c) 2014 Jonathan Ong
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var G7=EA(),Y7=yA();LA.exports=Di;function Di(n){if(!(this instanceof Di))return new Di(n);this.headers=n.headers,this.negotiator=new G7(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(z7),p=this.negotiator.mediaTypes(c.filter(H7)),x=p[0];return x?i[c.indexOf(x)]:!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 z7(n){return n.indexOf("/")===-1?Y7.lookup(n):n}function H7(n){return typeof n==="string"}});var hl=h((NA,DA)=>{/*!
26
+ */var z3=EA(),H3=yA();LA.exports=Di;function Di(n){if(!(this instanceof Di))return new Di(n);this.headers=n.headers,this.negotiator=new z3(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(Q3),p=this.negotiator.mediaTypes(c.filter(O3)),x=p[0];return x?i[c.indexOf(x)]:!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 Q3(n){return n.indexOf("/")===-1?H3.lookup(n):n}function O3(n){return typeof n==="string"}});var kl=h((NA,DA)=>{/*!
27
27
  * base64id v0.1.0
28
- */var bx=import.meta.require("crypto"),Cl=function(){};Cl.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return bx.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return bx.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,bx.randomBytes(i,function(a,m){o.bytesBuffer=m,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return bx.randomBytes(n)}var x=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,x};Cl.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),bx.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,"-")};NA=DA.exports=new Cl});var Am=h((hA)=>{Object.defineProperty(hA,"__esModule",{value:!0});hA.ERROR_PACKET=hA.PACKET_TYPES_REVERSE=hA.PACKET_TYPES=void 0;var Oo=Object.create(null);hA.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 CA=Object.create(null);hA.PACKET_TYPES_REVERSE=CA;Object.keys(Oo).forEach((n)=>{CA[Oo[n]]=n});var Q7={type:"error",data:"parser error"};hA.ERROR_PACKET=Q7});var ZA=h((sA)=>{Object.defineProperty(sA,"__esModule",{value:!0});sA.encodePacket=void 0;sA.encodePacketToBinary=_7;var U7=Am(),V7=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+kA(i,!0).toString("base64"));return c(U7.PACKET_TYPES[n]+(i||""))};sA.encodePacket=V7;var kA=(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)},Il;function _7(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(kA(n.data,!1));sA.encodePacket(n,!0,(o)=>{if(!Il)Il=new TextEncoder;i(Il.encode(o))})}});var rA=h((PA)=>{Object.defineProperty(PA,"__esModule",{value:!0});PA.decodePacket=void 0;var Sm=Am(),b7=(n,i)=>{if(typeof n!=="string")return{type:"message",data:qA(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:qA(c,i)}}if(!Sm.PACKET_TYPES_REVERSE[o])return Sm.ERROR_PACKET;return n.length>1?{type:Sm.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:Sm.PACKET_TYPES_REVERSE[o]}};PA.decodePacket=b7;var qA=(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 jx=h((Rm)=>{Object.defineProperty(Rm,"__esModule",{value:!0});Rm.decodePayload=Rm.decodePacket=Rm.encodePayload=Rm.encodePacket=Rm.protocol=void 0;Rm.createPacketEncoderStream=y7;Rm.createPacketDecoderStream=L7;var Zl=ZA();Object.defineProperty(Rm,"encodePacket",{enumerable:!0,get:function(){return Zl.encodePacket}});var ql=rA();Object.defineProperty(Rm,"decodePacket",{enumerable:!0,get:function(){return ql.decodePacket}});var gA=Am(),dA=String.fromCharCode(30),j7=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,a)=>{Zl.encodePacket(x,!1,(m)=>{if(c[a]=m,++p===o)i(c.join(dA))})})};Rm.encodePayload=j7;var B7=(n,i)=>{let o=n.split(dA),c=[];for(let p=0;p<o.length;p++){let x=ql.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Rm.decodePayload=B7;function y7(){return new TransformStream({transform(n,i){Zl.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 x=new DataView(p.buffer);x.setUint8(0,126),x.setUint16(1,c)}else{p=new Uint8Array(9);let x=new DataView(p.buffer);x.setUint8(0,127),x.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var sl;function Fm(n){return n.reduce((i,o)=>i+o.length,0)}function Mm(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 L7(n,i){if(!sl)sl=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(a,m){o.push(a);while(!0){if(c===0){if(Fm(o)<1)break;let f=Mm(o,1);if(x=(f[0]&128)===128,p=f[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Fm(o)<2)break;let f=Mm(o,2);p=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),c=3}else if(c===2){if(Fm(o)<8)break;let f=Mm(o,8),l=new DataView(f.buffer,f.byteOffset,f.length),$=l.getUint32(0);if($>Math.pow(2,21)-1){m.enqueue(gA.ERROR_PACKET);break}p=$*Math.pow(2,32)+l.getUint32(4),c=3}else{if(Fm(o)<p)break;let f=Mm(o,p);m.enqueue(ql.decodePacket(x?f:sl.decode(f),i)),c=0}if(p===0||p>n){m.enqueue(gA.ERROR_PACKET);break}}}})}Rm.protocol=4});var cS=h((lL,oS)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var lc=String.fromCharCode;function nS(n){var i=[],o=0,c=n.length,p,x;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(x=n.charCodeAt(o++),(x&64512)==56320)i.push(((p&1023)<<10)+(x&1023)+65536);else i.push(p),o--;else i.push(p);return i}function I7(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 iS(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 Pl(n,i){return lc(n>>i&63|128)}function k7(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(!iS(n,i))n=65533;o=lc(n>>12&15|224),o+=Pl(n,6)}else if((n&4292870144)==0)o=lc(n>>18&7|240),o+=Pl(n,12),o+=Pl(n,6);return o+=lc(n&63|128),o}function s7(n,i){i=i||{};var o=i.strict!==!1,c=nS(n),p=c.length,x=-1,a,m="";while(++x<p)a=c[x],m+=k7(a,o);return m}function Mp(){if($c>=Km)throw Error("Invalid byte index");var n=Wm[$c]&255;if($c++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function Z7(n){var i,o,c,p,x;if($c>Km)throw Error("Invalid byte index");if($c==Km)return!1;if(i=Wm[$c]&255,$c++,(i&128)==0)return i;if((i&224)==192)if(o=Mp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Mp(),c=Mp(),x=(i&15)<<12|o<<6|c,x>=2048)return iS(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Mp(),c=Mp(),p=Mp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Wm,Km,$c;function q7(n,i){i=i||{};var o=i.strict!==!1;Wm=nS(n),Km=Wm.length,$c=0;var c=[],p;while((p=Z7(o))!==!1)c.push(p);return I7(c)}oS.exports={version:"2.1.2",encode:s7,decode:q7}});var TS=h((vS)=>{Object.defineProperty(vS,"__esModule",{value:!0});vS.packets=vS.protocol=void 0;vS.encodePacket=tl;vS.encodeBase64Packet=aS;vS.decodePacket=rl;vS.decodeBase64Packet=mS;vS.encodePayload=g7;vS.decodePayload=e7;vS.encodePayloadAsBinary=lS;vS.decodePayloadAsBinary=$S;var xS=cS();vS.protocol=3;var P7=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};vS.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Rp=Object.keys(vS.packets),Jo={type:"error",data:"parser error"},t7=Buffer.concat([]);function tl(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 pS(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return pS({type:n.type,data:gl(n.data)},i,c);var p=vS.packets[n.type];if(n.data!==void 0)p+=o?xS.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function pS(n,i,o){if(!i)return aS(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=vS.packets[n.type],o(Buffer.concat([p,c]))}function aS(n,i){var o=Buffer.isBuffer(n.data)?n.data:gl(n.data),c="b"+vS.packets[n.type];return c+=o.toString("base64"),i(c)}function rl(n,i,o){if(n===void 0)return Jo;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return mS(n.slice(1),i);if(o){if(n=r7(n),n===!1)return Jo}if(Number(c)!=c||!Rp[c])return Jo;if(n.length>1)return{type:Rp[c],data:n.slice(1)};else return{type:Rp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Rp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=gl(n);return c=n[0],{type:Rp[c],data:n.slice(1)}}function r7(n){try{n=xS.decode(n,{strict:!1})}catch(i){return!1}return n}function mS(n,i){var o=Rp[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var x=0;x<p.length;x++)p[x]=c[x];c=p.buffer}return{type:o,data:c}}function g7(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&P7(n))return lS(n,o);if(!n.length)return o("0:");function c(p,x){tl(p,i,!1,function(a){x(null,d7(a))})}fS(n,c,function(p,x){return o(x.join(""))})}function d7(n){return n.length+":"+n}function fS(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(a,m)=>{if(c[x]=m,++p===n.length)o(null,c)})}function e7(n,i,o){if(typeof n!=="string")return $S(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o(Jo,0,1);var c="",p,x,a;for(var m=0,f=n.length;m<f;m++){var l=n.charAt(m);if(l!==":"){c+=l;continue}if(c===""||c!=(p=Number(c)))return o(Jo,0,1);if(x=n.slice(m+1,m+1+p),c!=x.length)return o(Jo,0,1);if(x.length){if(a=rl(x,i,!1),Jo.type===a.type&&Jo.data===a.data)return o(Jo,0,1);var $=o(a,m+p,f);if($===!1)return}m+=p,c=""}if(c!=="")return o(Jo,0,1)}function n3(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function i3(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 gl(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function lS(n,i){if(!n.length)return i(t7);fS(n,o3,function(o,c){return i(Buffer.concat(c))})}function o3(n,i){function o(c){var p=""+c.length,x;if(typeof c==="string"){x=Buffer.allocUnsafe(p.length+2),x[0]=0;for(var a=0;a<p.length;a++)x[a+1]=parseInt(p[a],10);return x[x.length-1]=255,i(null,Buffer.concat([x,i3(c)]))}x=Buffer.allocUnsafe(p.length+2),x[0]=1;for(var a=0;a<p.length;a++)x[a+1]=parseInt(p[a],10);x[x.length-1]=255,i(null,Buffer.concat([x,c]))}tl(n,!0,!0,o)}function $S(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var a="",m=c[0]===0;for(x=1;;x++){if(c[x]===255)break;if(a.length>310)return o(Jo,0,1);a+=""+c[x]}c=c.slice(a.length+1);var f=parseInt(a,10),l=c.slice(1,f+1);if(m)l=n3(l);p.push(l),c=c.slice(f+1)}var $=p.length;for(x=0;x<$;x++){var v=p[x];o(rl(v,i,!0),x,$)}}});var wS=h((vL,JS)=>{var Kp=1000,Xp=Kp*60,Gp=Xp*60,_c=Gp*24,T3=_c*7,J3=_c*365.25;JS.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return w3(n);else if(o==="number"&&isFinite(n))return i.long?S3(n):A3(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function w3(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*J3;case"weeks":case"week":case"w":return o*T3;case"days":case"day":case"d":return o*_c;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Gp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Xp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Kp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function A3(n){var i=Math.abs(n);if(i>=_c)return Math.round(n/_c)+"d";if(i>=Gp)return Math.round(n/Gp)+"h";if(i>=Xp)return Math.round(n/Xp)+"m";if(i>=Kp)return Math.round(n/Kp)+"s";return n+"ms"}function S3(n){var i=Math.abs(n);if(i>=_c)return Xm(n,i,_c,"day");if(i>=Gp)return Xm(n,i,Gp,"hour");if(i>=Xp)return Xm(n,i,Xp,"minute");if(i>=Kp)return Xm(n,i,Kp,"second");return n+" ms"}function Xm(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var dl=h((TL,AS)=>{function F3(n){o.debug=o,o.default=o,o.coerce=f,o.disable=x,o.enable=p,o.enabled=a,o.humanize=wS(),o.destroy=l,Object.keys(n).forEach(($)=>{o[$]=n[$]}),o.names=[],o.skips=[],o.formatters={};function i($){let v=0;for(let T=0;T<$.length;T++)v=(v<<5)-v+$.charCodeAt(T),v|=0;return o.colors[Math.abs(v)%o.colors.length]}o.selectColor=i;function o($){let v,T=null,F,R;function S(...M){if(!S.enabled)return;let G=S,H=Number(new Date),B=H-(v||H);if(G.diff=B,G.prev=v,G.curr=H,v=H,M[0]=o.coerce(M[0]),typeof M[0]!=="string")M.unshift("%O");let k=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(K,Q)=>{if(K==="%%")return"%";k++;let u=o.formatters[Q];if(typeof u==="function"){let V=M[k];K=u.call(G,V),M.splice(k,1),k--}return K}),o.formatArgs.call(G,M),(G.log||o.log).apply(G,M)}if(S.namespace=$,S.useColors=o.useColors(),S.color=o.selectColor($),S.extend=c,S.destroy=o.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(T!==null)return T;if(F!==o.namespaces)F=o.namespaces,R=o.enabled($);return R},set:(M)=>{T=M}}),typeof o.init==="function")o.init(S);return S}function c($,v){let T=o(this.namespace+(typeof v==="undefined"?":":v)+$);return T.log=this.log,T}function p($){o.save($),o.namespaces=$,o.names=[],o.skips=[];let v,T=(typeof $==="string"?$:"").split(/[\s,]+/),F=T.length;for(v=0;v<F;v++){if(!T[v])continue;if($=T[v].replace(/\*/g,".*?"),$[0]==="-")o.skips.push(new RegExp("^"+$.slice(1)+"$"));else o.names.push(new RegExp("^"+$+"$"))}}function x(){let $=[...o.names.map(m),...o.skips.map(m).map((v)=>"-"+v)].join(",");return o.enable(""),$}function a($){if($[$.length-1]==="*")return!0;let v,T;for(v=0,T=o.skips.length;v<T;v++)if(o.skips[v].test($))return!1;for(v=0,T=o.names.length;v<T;v++)if(o.names[v].test($))return!0;return!1}function m($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function f($){if($ instanceof Error)return $.stack||$.message;return $}function l(){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}AS.exports=F3});var FS=h((SS,Ym)=>{SS.formatArgs=R3;SS.save=W3;SS.load=K3;SS.useColors=M3;SS.storage=X3();SS.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`.")}})();SS.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 M3(){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 R3(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Ym.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)}SS.log=console.debug||console.log||(()=>{});function W3(n){try{if(n)SS.storage.setItem("debug",n);else SS.storage.removeItem("debug")}catch(i){}}function K3(){let n;try{n=SS.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function X3(){try{return localStorage}catch(n){}}Ym.exports=dl()(SS);var{formatters:G3}=Ym.exports;G3.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var RS=h((wL,MS)=>{MS.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 KS=h((AL,WS)=>{var V3=import.meta.require("os"),wo=RS(),Wi=process.env,Yp;if(wo("no-color")||wo("no-colors")||wo("color=false"))Yp=!1;else if(wo("color")||wo("colors")||wo("color=true")||wo("color=always"))Yp=!0;if("FORCE_COLOR"in Wi)Yp=Wi.FORCE_COLOR.length===0||parseInt(Wi.FORCE_COLOR,10)!==0;function _3(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function u3(n){if(Yp===!1)return 0;if(wo("color=16m")||wo("color=full")||wo("color=truecolor"))return 3;if(wo("color=256"))return 2;if(n&&!n.isTTY&&Yp!==!0)return 0;let i=Yp?1:0;if(process.platform==="win32"){let o=V3.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 Wi){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((o)=>(o in Wi))||Wi.CI_NAME==="codeship")return 1;return i}if("TEAMCITY_VERSION"in Wi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Wi.TEAMCITY_VERSION)?1:0;if(Wi.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Wi){let o=parseInt((Wi.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Wi.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Wi.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Wi.TERM))return 1;if("COLORTERM"in Wi)return 1;if(Wi.TERM==="dumb")return i;return i}function el(n){let i=u3(n);return _3(i)}WS.exports={supportsColor:el,stdout:el(process.stdout),stderr:el(process.stderr)}});var zS=h((GS,Hm)=>{var b3=import.meta.require("tty"),zm=import.meta.require("util");GS.init=C3;GS.log=L3;GS.formatArgs=B3;GS.save=N3;GS.load=D3;GS.useColors=j3;GS.destroy=zm.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");GS.colors=[6,2,3,4,5,1];try{let n=KS();if(n&&(n.stderr||n).level>=2)GS.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){}GS.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,x)=>{return x.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 j3(){return"colors"in GS.inspectOpts?Boolean(GS.inspectOpts.colors):b3.isatty(process.stderr.fd)}function B3(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),x=` ${p};1m${i} \x1B[0m`;n[0]=x+n[0].split(`
28
+ */var jx=import.meta.require("crypto"),Il=function(){};Il.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return jx.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return jx.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,jx.randomBytes(i,function(m,a){o.bytesBuffer=a,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return jx.randomBytes(n)}var x=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,x};Il.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),jx.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,"-")};NA=DA.exports=new Il});var Sa=h((hA)=>{Object.defineProperty(hA,"__esModule",{value:!0});hA.ERROR_PACKET=hA.PACKET_TYPES_REVERSE=hA.PACKET_TYPES=void 0;var Oo=Object.create(null);hA.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 CA=Object.create(null);hA.PACKET_TYPES_REVERSE=CA;Object.keys(Oo).forEach((n)=>{CA[Oo[n]]=n});var E3={type:"error",data:"parser error"};hA.ERROR_PACKET=E3});var ZA=h((sA)=>{Object.defineProperty(sA,"__esModule",{value:!0});sA.encodePacket=void 0;sA.encodePacketToBinary=b3;var _3=Sa(),u3=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+kA(i,!0).toString("base64"));return c(_3.PACKET_TYPES[n]+(i||""))};sA.encodePacket=u3;var kA=(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)},sl;function b3(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(kA(n.data,!1));sA.encodePacket(n,!0,(o)=>{if(!sl)sl=new TextEncoder;i(sl.encode(o))})}});var rA=h((PA)=>{Object.defineProperty(PA,"__esModule",{value:!0});PA.decodePacket=void 0;var Fa=Sa(),B3=(n,i)=>{if(typeof n!=="string")return{type:"message",data:qA(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:qA(c,i)}}if(!Fa.PACKET_TYPES_REVERSE[o])return Fa.ERROR_PACKET;return n.length>1?{type:Fa.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:Fa.PACKET_TYPES_REVERSE[o]}};PA.decodePacket=B3;var qA=(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 Bx=h((Wa)=>{Object.defineProperty(Wa,"__esModule",{value:!0});Wa.decodePayload=Wa.decodePacket=Wa.encodePayload=Wa.encodePacket=Wa.protocol=void 0;Wa.createPacketEncoderStream=N3;Wa.createPacketDecoderStream=D3;var Pl=ZA();Object.defineProperty(Wa,"encodePacket",{enumerable:!0,get:function(){return Pl.encodePacket}});var tl=rA();Object.defineProperty(Wa,"decodePacket",{enumerable:!0,get:function(){return tl.decodePacket}});var gA=Sa(),dA=String.fromCharCode(30),y3=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,m)=>{Pl.encodePacket(x,!1,(a)=>{if(c[m]=a,++p===o)i(c.join(dA))})})};Wa.encodePayload=y3;var L3=(n,i)=>{let o=n.split(dA),c=[];for(let p=0;p<o.length;p++){let x=tl.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Wa.decodePayload=L3;function N3(){return new TransformStream({transform(n,i){Pl.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 x=new DataView(p.buffer);x.setUint8(0,126),x.setUint16(1,c)}else{p=new Uint8Array(9);let x=new DataView(p.buffer);x.setUint8(0,127),x.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var ql;function Ma(n){return n.reduce((i,o)=>i+o.length,0)}function Ra(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 D3(n,i){if(!ql)ql=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(m,a){o.push(m);while(!0){if(c===0){if(Ma(o)<1)break;let f=Ra(o,1);if(x=(f[0]&128)===128,p=f[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Ma(o)<2)break;let f=Ra(o,2);p=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),c=3}else if(c===2){if(Ma(o)<8)break;let f=Ra(o,8),l=new DataView(f.buffer,f.byteOffset,f.length),$=l.getUint32(0);if($>Math.pow(2,21)-1){a.enqueue(gA.ERROR_PACKET);break}p=$*Math.pow(2,32)+l.getUint32(4),c=3}else{if(Ma(o)<p)break;let f=Ra(o,p);a.enqueue(tl.decodePacket(x?f:ql.decode(f),i)),c=0}if(p===0||p>n){a.enqueue(gA.ERROR_PACKET);break}}}})}Wa.protocol=4});var cS=h((ML,oS)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var $c=String.fromCharCode;function nS(n){var i=[],o=0,c=n.length,p,x;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(x=n.charCodeAt(o++),(x&64512)==56320)i.push(((p&1023)<<10)+(x&1023)+65536);else i.push(p),o--;else i.push(p);return i}function s3(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=$c(c>>>10&1023|55296),c=56320|c&1023;p+=$c(c)}return p}function iS(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 rl(n,i){return $c(n>>i&63|128)}function Z3(n,i){if((n&4294967168)==0)return $c(n);var o="";if((n&4294965248)==0)o=$c(n>>6&31|192);else if((n&4294901760)==0){if(!iS(n,i))n=65533;o=$c(n>>12&15|224),o+=rl(n,6)}else if((n&4292870144)==0)o=$c(n>>18&7|240),o+=rl(n,12),o+=rl(n,6);return o+=$c(n&63|128),o}function q3(n,i){i=i||{};var o=i.strict!==!1,c=nS(n),p=c.length,x=-1,m,a="";while(++x<p)m=c[x],a+=Z3(m,o);return a}function Wp(){if(vc>=Xa)throw Error("Invalid byte index");var n=Ka[vc]&255;if(vc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function P3(n){var i,o,c,p,x;if(vc>Xa)throw Error("Invalid byte index");if(vc==Xa)return!1;if(i=Ka[vc]&255,vc++,(i&128)==0)return i;if((i&224)==192)if(o=Wp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Wp(),c=Wp(),x=(i&15)<<12|o<<6|c,x>=2048)return iS(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Wp(),c=Wp(),p=Wp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Ka,Xa,vc;function t3(n,i){i=i||{};var o=i.strict!==!1;Ka=nS(n),Xa=Ka.length,vc=0;var c=[],p;while((p=P3(o))!==!1)c.push(p);return s3(c)}oS.exports={version:"2.1.2",encode:q3,decode:t3}});var TS=h((vS)=>{Object.defineProperty(vS,"__esModule",{value:!0});vS.packets=vS.protocol=void 0;vS.encodePacket=gl;vS.encodeBase64Packet=mS;vS.decodePacket=dl;vS.decodeBase64Packet=aS;vS.encodePayload=e3;vS.decodePayload=iK;vS.encodePayloadAsBinary=lS;vS.decodePayloadAsBinary=$S;var xS=cS();vS.protocol=3;var r3=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};vS.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Kp=Object.keys(vS.packets),wo={type:"error",data:"parser error"},g3=Buffer.concat([]);function gl(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 pS(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return pS({type:n.type,data:el(n.data)},i,c);var p=vS.packets[n.type];if(n.data!==void 0)p+=o?xS.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function pS(n,i,o){if(!i)return mS(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=vS.packets[n.type],o(Buffer.concat([p,c]))}function mS(n,i){var o=Buffer.isBuffer(n.data)?n.data:el(n.data),c="b"+vS.packets[n.type];return c+=o.toString("base64"),i(c)}function dl(n,i,o){if(n===void 0)return wo;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return aS(n.slice(1),i);if(o){if(n=d3(n),n===!1)return wo}if(Number(c)!=c||!Kp[c])return wo;if(n.length>1)return{type:Kp[c],data:n.slice(1)};else return{type:Kp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Kp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=el(n);return c=n[0],{type:Kp[c],data:n.slice(1)}}function d3(n){try{n=xS.decode(n,{strict:!1})}catch(i){return!1}return n}function aS(n,i){var o=Kp[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var x=0;x<p.length;x++)p[x]=c[x];c=p.buffer}return{type:o,data:c}}function e3(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&r3(n))return lS(n,o);if(!n.length)return o("0:");function c(p,x){gl(p,i,!1,function(m){x(null,nK(m))})}fS(n,c,function(p,x){return o(x.join(""))})}function nK(n){return n.length+":"+n}function fS(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(m,a)=>{if(c[x]=a,++p===n.length)o(null,c)})}function iK(n,i,o){if(typeof n!=="string")return $S(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o(wo,0,1);var c="",p,x,m;for(var a=0,f=n.length;a<f;a++){var l=n.charAt(a);if(l!==":"){c+=l;continue}if(c===""||c!=(p=Number(c)))return o(wo,0,1);if(x=n.slice(a+1,a+1+p),c!=x.length)return o(wo,0,1);if(x.length){if(m=dl(x,i,!1),wo.type===m.type&&wo.data===m.data)return o(wo,0,1);var $=o(m,a+p,f);if($===!1)return}a+=p,c=""}if(c!=="")return o(wo,0,1)}function oK(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function cK(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 el(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function lS(n,i){if(!n.length)return i(g3);fS(n,pK,function(o,c){return i(Buffer.concat(c))})}function pK(n,i){function o(c){var p=""+c.length,x;if(typeof c==="string"){x=Buffer.allocUnsafe(p.length+2),x[0]=0;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);return x[x.length-1]=255,i(null,Buffer.concat([x,cK(c)]))}x=Buffer.allocUnsafe(p.length+2),x[0]=1;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);x[x.length-1]=255,i(null,Buffer.concat([x,c]))}gl(n,!0,!0,o)}function $S(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var m="",a=c[0]===0;for(x=1;;x++){if(c[x]===255)break;if(m.length>310)return o(wo,0,1);m+=""+c[x]}c=c.slice(m.length+1);var f=parseInt(m,10),l=c.slice(1,f+1);if(a)l=oK(l);p.push(l),c=c.slice(f+1)}var $=p.length;for(x=0;x<$;x++){var v=p[x];o(dl(v,i,!0),x,$)}}});var wS=h((WL,JS)=>{var Gp=1000,Yp=Gp*60,zp=Yp*60,_c=zp*24,wK=_c*7,AK=_c*365.25;JS.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return SK(n);else if(o==="number"&&isFinite(n))return i.long?MK(n):FK(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function SK(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*AK;case"weeks":case"week":case"w":return o*wK;case"days":case"day":case"d":return o*_c;case"hours":case"hour":case"hrs":case"hr":case"h":return o*zp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Yp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Gp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function FK(n){var i=Math.abs(n);if(i>=_c)return Math.round(n/_c)+"d";if(i>=zp)return Math.round(n/zp)+"h";if(i>=Yp)return Math.round(n/Yp)+"m";if(i>=Gp)return Math.round(n/Gp)+"s";return n+"ms"}function MK(n){var i=Math.abs(n);if(i>=_c)return Ga(n,i,_c,"day");if(i>=zp)return Ga(n,i,zp,"hour");if(i>=Yp)return Ga(n,i,Yp,"minute");if(i>=Gp)return Ga(n,i,Gp,"second");return n+" ms"}function Ga(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var n$=h((KL,AS)=>{function RK(n){o.debug=o,o.default=o,o.coerce=f,o.disable=x,o.enable=p,o.enabled=m,o.humanize=wS(),o.destroy=l,Object.keys(n).forEach(($)=>{o[$]=n[$]}),o.names=[],o.skips=[],o.formatters={};function i($){let v=0;for(let T=0;T<$.length;T++)v=(v<<5)-v+$.charCodeAt(T),v|=0;return o.colors[Math.abs(v)%o.colors.length]}o.selectColor=i;function o($){let v,T=null,F,R;function S(...M){if(!S.enabled)return;let G=S,H=Number(new Date),y=H-(v||H);if(G.diff=y,G.prev=v,G.curr=H,v=H,M[0]=o.coerce(M[0]),typeof M[0]!=="string")M.unshift("%O");let k=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(K,Q)=>{if(K==="%%")return"%";k++;let u=o.formatters[Q];if(typeof u==="function"){let V=M[k];K=u.call(G,V),M.splice(k,1),k--}return K}),o.formatArgs.call(G,M),(G.log||o.log).apply(G,M)}if(S.namespace=$,S.useColors=o.useColors(),S.color=o.selectColor($),S.extend=c,S.destroy=o.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(T!==null)return T;if(F!==o.namespaces)F=o.namespaces,R=o.enabled($);return R},set:(M)=>{T=M}}),typeof o.init==="function")o.init(S);return S}function c($,v){let T=o(this.namespace+(typeof v==="undefined"?":":v)+$);return T.log=this.log,T}function p($){o.save($),o.namespaces=$,o.names=[],o.skips=[];let v,T=(typeof $==="string"?$:"").split(/[\s,]+/),F=T.length;for(v=0;v<F;v++){if(!T[v])continue;if($=T[v].replace(/\*/g,".*?"),$[0]==="-")o.skips.push(new RegExp("^"+$.slice(1)+"$"));else o.names.push(new RegExp("^"+$+"$"))}}function x(){let $=[...o.names.map(a),...o.skips.map(a).map((v)=>"-"+v)].join(",");return o.enable(""),$}function m($){if($[$.length-1]==="*")return!0;let v,T;for(v=0,T=o.skips.length;v<T;v++)if(o.skips[v].test($))return!1;for(v=0,T=o.names.length;v<T;v++)if(o.names[v].test($))return!0;return!1}function a($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function f($){if($ instanceof Error)return $.stack||$.message;return $}function l(){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}AS.exports=RK});var FS=h((SS,za)=>{SS.formatArgs=KK;SS.save=XK;SS.load=GK;SS.useColors=WK;SS.storage=YK();SS.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`.")}})();SS.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 WK(){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 KK(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+za.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)}SS.log=console.debug||console.log||(()=>{});function XK(n){try{if(n)SS.storage.setItem("debug",n);else SS.storage.removeItem("debug")}catch(i){}}function GK(){let n;try{n=SS.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function YK(){try{return localStorage}catch(n){}}za.exports=n$()(SS);var{formatters:zK}=za.exports;zK.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var RS=h((GL,MS)=>{MS.exports=(n,i=process.argv)=>{let o=n.startsWith("-")?"":n.length===1?"-":"--",c=i.indexOf(o+n),p=i.indexOf("--");return c!==-1&&(p===-1||c<p)}});var XS=h((YL,KS)=>{var uK=import.meta.require("os"),WS=import.meta.require("tty"),no=RS(),{env:mi}=process,Ha;if(no("no-color")||no("no-colors")||no("color=false")||no("color=never"))Ha=0;else if(no("color")||no("colors")||no("color=true")||no("color=always"))Ha=1;function bK(){if("FORCE_COLOR"in mi){if(mi.FORCE_COLOR==="true")return 1;if(mi.FORCE_COLOR==="false")return 0;return mi.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(mi.FORCE_COLOR,10),3)}}function jK(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function BK(n,{streamIsTTY:i,sniffFlags:o=!0}={}){let c=bK();if(c!==void 0)Ha=c;let p=o?Ha:c;if(p===0)return 0;if(o){if(no("color=16m")||no("color=full")||no("color=truecolor"))return 3;if(no("color=256"))return 2}if(n&&!i&&p===void 0)return 0;let x=p||0;if(mi.TERM==="dumb")return x;if(process.platform==="win32"){let m=uK.release().split(".");if(Number(m[0])>=10&&Number(m[2])>=10586)return Number(m[2])>=14931?3:2;return 1}if("CI"in mi){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((m)=>(m in mi))||mi.CI_NAME==="codeship")return 1;return x}if("TEAMCITY_VERSION"in mi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mi.TEAMCITY_VERSION)?1:0;if(mi.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in mi){let m=Number.parseInt((mi.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mi.TERM_PROGRAM){case"iTerm.app":return m>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(mi.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mi.TERM))return 1;if("COLORTERM"in mi)return 1;return x}function i$(n,i={}){let o=BK(n,{streamIsTTY:n&&n.isTTY,...i});return jK(o)}KS.exports={supportsColor:i$,stdout:i$({isTTY:WS.isatty(1)}),stderr:i$({isTTY:WS.isatty(2)})}});var HS=h((YS,Oa)=>{var yK=import.meta.require("tty"),Qa=import.meta.require("util");YS.init=kK;YS.log=CK;YS.formatArgs=NK;YS.save=hK;YS.load=IK;YS.useColors=LK;YS.destroy=Qa.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");YS.colors=[6,2,3,4,5,1];try{let n=XS();if(n&&(n.stderr||n).level>=2)YS.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){}YS.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,x)=>{return x.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 LK(){return"colors"in YS.inspectOpts?Boolean(YS.inspectOpts.colors):yK.isatty(process.stderr.fd)}function NK(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),x=` ${p};1m${i} \x1B[0m`;n[0]=x+n[0].split(`
29
29
  `).join(`
30
- `+x),n.push(p+"m+"+Hm.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=y3()+i+" "+n[0]}function y3(){if(GS.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function L3(...n){return process.stderr.write(zm.formatWithOptions(GS.inspectOpts,...n)+`
31
- `)}function N3(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function D3(){return process.env.DEBUG}function C3(n){n.inspectOpts={};let i=Object.keys(GS.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=GS.inspectOpts[i[o]]}Hm.exports=dl()(GS);var{formatters:XS}=Hm.exports;XS.o=function(n){return this.inspectOpts.colors=this.useColors,zm.inspect(n,this.inspectOpts).split(`
32
- `).map((i)=>i.trim()).join(" ")};XS.O=function(n){return this.inspectOpts.colors=this.useColors,zm.inspect(n,this.inspectOpts)}});var ai=h((FL,n$)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)n$.exports=FS();else n$.exports=zS()});var bc=h((OS)=>{Object.defineProperty(OS,"__esModule",{value:!0});OS.Transport=void 0;var t3=import.meta.require("events"),r3=jx(),g3=TS(),d3=ai(),HS=d3.default("engine:transport");function e3(){}class QS extends t3.EventEmitter{get readyState(){return this._readyState}set readyState(n){HS("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?r3:g3,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||e3)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else HS("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")}}OS.Transport=QS});var i$=h((_S)=>{Object.defineProperty(_S,"__esModule",{value:!0});_S.Polling=void 0;var nK=bc(),US=import.meta.require("zlib"),iK=wm(),oK=ai(),Ci=oK.default("engine:polling"),cK={gzip:US.createGzip,deflate:US.createDeflate};class VS extends nK.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",a),n.removeListener("end",m),n.removeListener("close",x),this.dataReq=this.dataRes=c=null},x=()=>{p(),this.onError("data request connection closed prematurely")},a=(f)=>{let l;if(o)c=Buffer.concat([c,f]),l=c.length;else c+=f,l=Buffer.byteLength(c);if(l>this.maxHttpBufferSize)i.writeHead(413).end(),p()},m=()=>{this.onData(c);let f={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,f)),i.end("ok"),p()};if(n.on("close",x),!o)n.setEncoding("utf8");n.on("data",a),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",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},a=(l)=>{x["Content-Length"]=typeof l==="string"?Buffer.byteLength(l):l.length,this.res.writeHead(200,this.headers(this.req,x)),this.res.end(l),o()};if(!this.httpCompression||!i.compress){a(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){a(n);return}let f=iK(this.req).encodings(["gzip","deflate"]);if(!f){a(n);return}this.compress(n,f,(l,$)=>{if(l){this.res.writeHead(500),this.res.end(),o(l);return}x["Content-Encoding"]=f,a($)})}compress(n,i,o){Ci("compressing");let c=[],p=0;cK[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.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}}_S.Polling=VS});var yS=h((jS)=>{Object.defineProperty(jS,"__esModule",{value:!0});jS.JSONP=void 0;var pK=i$(),xK=import.meta.require("querystring"),aK=/\\\\n/g,mK=/(\\)?\\n/g;class bS extends pK.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=xK.parse(n).d,typeof n==="string")n=n.replace(mK,function(i,o){return o?i:`
33
- `}),super.onData(n.replace(aK,"\\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)}}jS.JSONP=bS});var hS=h((DS)=>{Object.defineProperty(DS,"__esModule",{value:!0});DS.WebSocket=void 0;var fK=bc(),lK=ai(),LS=lK.default("engine:ws");class NS extends fK.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();LS('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){LS("closing"),this.socket.close(),n&&n()}}DS.WebSocket=NS});var o$=h((kS)=>{Object.defineProperty(kS,"__esModule",{value:!0});kS.WebTransport=void 0;var $K=bc(),vK=ai(),TK=jx(),zp=vK.default("engine:webtransport");class IS extends $K.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=TK.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{zp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:x}=await o.read();if(x){zp("session is closed");break}zp("received chunk: %o",p),this.onPacket(p)}}catch(p){zp("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){zp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){zp("closing WebTransport session"),this.session.close(),n&&n()}}kS.WebTransport=IS});var c$=h((qS)=>{Object.defineProperty(qS,"__esModule",{value:!0});var JK=i$(),wK=yS(),AK=hS(),SK=o$();qS.default={polling:ZS,websocket:AK.WebSocket,webtransport:SK.WebTransport};function ZS(n){if(typeof n._query.j==="string")return new wK.JSONP(n);else return new JK.Polling(n)}ZS.upgradesTo=["websocket","webtransport"]});var p$=h((tS)=>{Object.defineProperty(tS,"__esModule",{value:!0});tS.Socket=void 0;var MK=import.meta.require("events"),RK=ai(),No=import.meta.require("timers"),qn=RK.default("engine:socket");class PS extends MK.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"),No.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=No.setTimeout(()=>{qn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){No.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=No.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),x=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",x),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",x)})}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=No.setTimeout(()=>{if(qn("client did not complete upgrade - closing transport"),x(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(l)=>{if(l.type==="ping"&&l.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(l.type==="upgrade"&&this.readyState!=="closed"){if(qn("got upgrade packet - upgrading"),x(),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 x(),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"}])},x=()=>{this.upgrading=!1,clearInterval(o),No.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",m),n.removeListener("error",a),this.removeListener("close",f)},a=(l)=>{qn("client did not complete upgrade - %s",l),x(),n.close(),n=null},m=()=>{a("transport closed")},f=()=>{a("socket closed")};n.on("packet",c),n.once("close",m),n.once("error",a),this.once("close",f)}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(),No.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",No.clearTimeout(this.pingIntervalTimer),No.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"))}}tS.Socket=PS});var eS=h((VK)=>{/*!
30
+ `+x),n.push(p+"m+"+Oa.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=DK()+i+" "+n[0]}function DK(){if(YS.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function CK(...n){return process.stderr.write(Qa.formatWithOptions(YS.inspectOpts,...n)+`
31
+ `)}function hK(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function IK(){return process.env.DEBUG}function kK(n){n.inspectOpts={};let i=Object.keys(YS.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=YS.inspectOpts[i[o]]}Oa.exports=n$()(YS);var{formatters:GS}=Oa.exports;GS.o=function(n){return this.inspectOpts.colors=this.useColors,Qa.inspect(n,this.inspectOpts).split(`
32
+ `).map((i)=>i.trim()).join(" ")};GS.O=function(n){return this.inspectOpts.colors=this.useColors,Qa.inspect(n,this.inspectOpts)}});var ai=h((HL,o$)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)o$.exports=FS();else o$.exports=HS()});var bc=h((ES)=>{Object.defineProperty(ES,"__esModule",{value:!0});ES.Transport=void 0;var dK=import.meta.require("events"),eK=Bx(),n7=TS(),i7=ai(),QS=i7.default("engine:transport");function o7(){}class OS extends dK.EventEmitter{get readyState(){return this._readyState}set readyState(n){QS("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?eK:n7,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||o7)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else QS("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")}}ES.Transport=OS});var c$=h((uS)=>{Object.defineProperty(uS,"__esModule",{value:!0});uS.Polling=void 0;var c7=bc(),VS=import.meta.require("zlib"),p7=Aa(),x7=ai(),Ci=x7.default("engine:polling"),m7={gzip:VS.createGzip,deflate:VS.createDeflate};class _S extends c7.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",m),n.removeListener("end",a),n.removeListener("close",x),this.dataReq=this.dataRes=c=null},x=()=>{p(),this.onError("data request connection closed prematurely")},m=(f)=>{let l;if(o)c=Buffer.concat([c,f]),l=c.length;else c+=f,l=Buffer.byteLength(c);if(l>this.maxHttpBufferSize)i.writeHead(413).end(),p()},a=()=>{this.onData(c);let f={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,f)),i.end("ok"),p()};if(n.on("close",x),!o)n.setEncoding("utf8");n.on("data",m),n.on("end",a)}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",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(l)=>{x["Content-Length"]=typeof l==="string"?Buffer.byteLength(l):l.length,this.res.writeHead(200,this.headers(this.req,x)),this.res.end(l),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=p7(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(l,$)=>{if(l){this.res.writeHead(500),this.res.end(),o(l);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){Ci("compressing");let c=[],p=0;m7[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.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}}uS.Polling=_S});var LS=h((BS)=>{Object.defineProperty(BS,"__esModule",{value:!0});BS.JSONP=void 0;var a7=c$(),f7=import.meta.require("querystring"),l7=/\\\\n/g,$7=/(\\)?\\n/g;class jS extends a7.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=f7.parse(n).d,typeof n==="string")n=n.replace($7,function(i,o){return o?i:`
33
+ `}),super.onData(n.replace(l7,"\\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)}}BS.JSONP=jS});var IS=h((CS)=>{Object.defineProperty(CS,"__esModule",{value:!0});CS.WebSocket=void 0;var v7=bc(),T7=ai(),NS=T7.default("engine:ws");class DS extends v7.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();NS('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){NS("closing"),this.socket.close(),n&&n()}}CS.WebSocket=DS});var p$=h((sS)=>{Object.defineProperty(sS,"__esModule",{value:!0});sS.WebTransport=void 0;var J7=bc(),w7=ai(),A7=Bx(),Hp=w7.default("engine:webtransport");class kS extends J7.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=A7.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{Hp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:x}=await o.read();if(x){Hp("session is closed");break}Hp("received chunk: %o",p),this.onPacket(p)}}catch(p){Hp("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){Hp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){Hp("closing WebTransport session"),this.session.close(),n&&n()}}sS.WebTransport=kS});var x$=h((PS)=>{Object.defineProperty(PS,"__esModule",{value:!0});var S7=c$(),F7=LS(),M7=IS(),R7=p$();PS.default={polling:qS,websocket:M7.WebSocket,webtransport:R7.WebTransport};function qS(n){if(typeof n._query.j==="string")return new F7.JSONP(n);else return new S7.Polling(n)}qS.upgradesTo=["websocket","webtransport"]});var m$=h((rS)=>{Object.defineProperty(rS,"__esModule",{value:!0});rS.Socket=void 0;var K7=import.meta.require("events"),X7=ai(),No=import.meta.require("timers"),qn=X7.default("engine:socket");class tS extends K7.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"),No.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=No.setTimeout(()=>{qn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){No.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=No.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),x=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",x),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",x)})}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=No.setTimeout(()=>{if(qn("client did not complete upgrade - closing transport"),x(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(l)=>{if(l.type==="ping"&&l.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(l.type==="upgrade"&&this.readyState!=="closed"){if(qn("got upgrade packet - upgrading"),x(),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 x(),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"}])},x=()=>{this.upgrading=!1,clearInterval(o),No.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",a),n.removeListener("error",m),this.removeListener("close",f)},m=(l)=>{qn("client did not complete upgrade - %s",l),x(),n.close(),n=null},a=()=>{m("transport closed")},f=()=>{m("socket closed")};n.on("packet",c),n.once("close",a),n.once("error",m),this.once("close",f)}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(),No.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",No.clearTimeout(this.pingIntervalTimer),No.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"))}}rS.Socket=tS});var nF=h((b7)=>{/*!
34
34
  * cookie
35
35
  * Copyright(c) 2012-2014 Roman Shtylman
36
36
  * Copyright(c) 2015 Douglas Christopher Wilson
37
37
  * MIT Licensed
38
- */VK.parse=HK;VK.serialize=QK;var WK=Object.prototype.toString,KK=Object.prototype.hasOwnProperty,XK=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,GK=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,YK=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,zK=/^[\u0020-\u003A\u003D-\u007E]*$/;function HK(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=n.length;if(c<2)return o;var p=i&&i.decode||OK,x=0,a=0,m=0;do{if(a=n.indexOf("=",x),a===-1)break;if(m=n.indexOf(";",x),m===-1)m=c;else if(a>m){x=n.lastIndexOf(";",a-1)+1;continue}var f=gS(n,x,a),l=dS(n,a,f),$=n.slice(f,l);if(!KK.call(o,$)){var v=gS(n,a+1,m),T=dS(n,m,v);if(n.charCodeAt(v)===34&&n.charCodeAt(T-1)===34)v++,T--;var F=n.slice(v,T);o[$]=UK(F,p)}x=m+1}while(x<c);return o}function gS(n,i,o){do{var c=n.charCodeAt(i);if(c!==32&&c!==9)return i}while(++i<o);return o}function dS(n,i,o){while(i>o){var c=n.charCodeAt(--i);if(c!==32&&c!==9)return i+1}return o}function QK(n,i,o){var c=o&&o.encode||encodeURIComponent;if(typeof c!=="function")throw new TypeError("option encode is invalid");if(!XK.test(n))throw new TypeError("argument name is invalid");var p=c(i);if(!GK.test(p))throw new TypeError("argument val is invalid");var x=n+"="+p;if(!o)return x;if(o.maxAge!=null){var a=Math.floor(o.maxAge);if(!isFinite(a))throw new TypeError("option maxAge is invalid");x+="; Max-Age="+a}if(o.domain){if(!YK.test(o.domain))throw new TypeError("option domain is invalid");x+="; Domain="+o.domain}if(o.path){if(!zK.test(o.path))throw new TypeError("option path is invalid");x+="; Path="+o.path}if(o.expires){var m=o.expires;if(!EK(m)||isNaN(m.valueOf()))throw new TypeError("option expires is invalid");x+="; Expires="+m.toUTCString()}if(o.httpOnly)x+="; HttpOnly";if(o.secure)x+="; Secure";if(o.partitioned)x+="; Partitioned";if(o.priority){var f=typeof o.priority==="string"?o.priority.toLowerCase():o.priority;switch(f){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){var l=typeof o.sameSite==="string"?o.sameSite.toLowerCase():o.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 OK(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function EK(n){return WK.call(n)==="[object Date]"}function UK(n,i){try{return i(n)}catch(o){return n}}});var oF=h((HL,iF)=>{var nF=Object.getOwnPropertySymbols,bK=Object.prototype.hasOwnProperty,jK=Object.prototype.propertyIsEnumerable;function BK(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function yK(){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(x){return i[x]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(x){p[x]=x}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(x){return!1}}iF.exports=yK()?Object.assign:function(n,i){var o,c=BK(n),p;for(var x=1;x<arguments.length;x++){o=Object(arguments[x]);for(var a in o)if(bK.call(o,a))c[a]=o[a];if(nF){p=nF(o);for(var m=0;m<p.length;m++)if(jK.call(o,p[m]))c[p[m]]=o[p[m]]}}return c}});var xF=h((QL,x$)=>{/*!
38
+ */b7.parse=E7;b7.serialize=U7;var G7=Object.prototype.toString,Y7=Object.prototype.hasOwnProperty,z7=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,H7=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Q7=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,O7=/^[\u0020-\u003A\u003D-\u007E]*$/;function E7(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=n.length;if(c<2)return o;var p=i&&i.decode||V7,x=0,m=0,a=0;do{if(m=n.indexOf("=",x),m===-1)break;if(a=n.indexOf(";",x),a===-1)a=c;else if(m>a){x=n.lastIndexOf(";",m-1)+1;continue}var f=dS(n,x,m),l=eS(n,m,f),$=n.slice(f,l);if(!Y7.call(o,$)){var v=dS(n,m+1,a),T=eS(n,a,v);if(n.charCodeAt(v)===34&&n.charCodeAt(T-1)===34)v++,T--;var F=n.slice(v,T);o[$]=u7(F,p)}x=a+1}while(x<c);return o}function dS(n,i,o){do{var c=n.charCodeAt(i);if(c!==32&&c!==9)return i}while(++i<o);return o}function eS(n,i,o){while(i>o){var c=n.charCodeAt(--i);if(c!==32&&c!==9)return i+1}return o}function U7(n,i,o){var c=o&&o.encode||encodeURIComponent;if(typeof c!=="function")throw new TypeError("option encode is invalid");if(!z7.test(n))throw new TypeError("argument name is invalid");var p=c(i);if(!H7.test(p))throw new TypeError("argument val is invalid");var x=n+"="+p;if(!o)return x;if(o.maxAge!=null){var m=Math.floor(o.maxAge);if(!isFinite(m))throw new TypeError("option maxAge is invalid");x+="; Max-Age="+m}if(o.domain){if(!Q7.test(o.domain))throw new TypeError("option domain is invalid");x+="; Domain="+o.domain}if(o.path){if(!O7.test(o.path))throw new TypeError("option path is invalid");x+="; Path="+o.path}if(o.expires){var a=o.expires;if(!_7(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");x+="; Expires="+a.toUTCString()}if(o.httpOnly)x+="; HttpOnly";if(o.secure)x+="; Secure";if(o.partitioned)x+="; Partitioned";if(o.priority){var f=typeof o.priority==="string"?o.priority.toLowerCase():o.priority;switch(f){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){var l=typeof o.sameSite==="string"?o.sameSite.toLowerCase():o.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 V7(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function _7(n){return G7.call(n)==="[object Date]"}function u7(n,i){try{return i(n)}catch(o){return n}}});var cF=h((jL,oF)=>{var iF=Object.getOwnPropertySymbols,y7=Object.prototype.hasOwnProperty,L7=Object.prototype.propertyIsEnumerable;function N7(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function D7(){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(x){return i[x]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(x){p[x]=x}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(x){return!1}}oF.exports=D7()?Object.assign:function(n,i){var o,c=N7(n),p;for(var x=1;x<arguments.length;x++){o=Object(arguments[x]);for(var m in o)if(y7.call(o,m))c[m]=o[m];if(iF){p=iF(o);for(var a=0;a<p.length;a++)if(L7.call(o,p[a]))c[p[a]]=o[p[a]]}}return c}});var mF=h((BL,a$)=>{/*!
39
39
  * vary
40
40
  * Copyright(c) 2014-2017 Douglas Christopher Wilson
41
41
  * MIT Licensed
42
- */x$.exports=NK;x$.exports.append=pF;var LK=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function pF(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)?cF(String(i)):i;for(var c=0;c<o.length;c++)if(!LK.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=cF(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var a=0;a<o.length;a++){var m=o[a].toLowerCase();if(x.indexOf(m)===-1)x.push(m),p=p?p+", "+o[a]:o[a]}return p}function cF(n){var i=0,o=[],c=0;for(var p=0,x=n.length;p<x;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 NK(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=pF(c,i))n.setHeader("Vary",o)}});var a$=h((OL,aF)=>{(function(){var n=oF(),i=xF(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(R){return typeof R==="string"||R instanceof String}function p(R,S){if(Array.isArray(S)){for(var M=0;M<S.length;++M)if(p(R,S[M]))return!0;return!1}else if(c(S))return R===S;else if(S instanceof RegExp)return S.test(R);else return!!S}function x(R,S){var M=S.headers.origin,G=[],H;if(!R.origin||R.origin==="*")G.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(R.origin))G.push([{key:"Access-Control-Allow-Origin",value:R.origin}]),G.push([{key:"Vary",value:"Origin"}]);else H=p(M,R.origin),G.push([{key:"Access-Control-Allow-Origin",value:H?M:!1}]),G.push([{key:"Vary",value:"Origin"}]);return G}function a(R){var S=R.methods;if(S.join)S=R.methods.join(",");return{key:"Access-Control-Allow-Methods",value:S}}function m(R){if(R.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function f(R,S){var M=R.allowedHeaders||R.headers,G=[];if(!M)M=S.headers["access-control-request-headers"],G.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(M.join)M=M.join(",");if(M&&M.length)G.push([{key:"Access-Control-Allow-Headers",value:M}]);return G}function l(R){var S=R.exposedHeaders;if(!S)return null;else if(S.join)S=S.join(",");if(S&&S.length)return{key:"Access-Control-Expose-Headers",value:S};return null}function $(R){var S=(typeof R.maxAge==="number"||R.maxAge)&&R.maxAge.toString();if(S&&S.length)return{key:"Access-Control-Max-Age",value:S};return null}function v(R,S){for(var M=0,G=R.length;M<G;M++){var H=R[M];if(H){if(Array.isArray(H))v(H,S);else if(H.key==="Vary"&&H.value)i(S,H.value);else if(H.value)S.setHeader(H.key,H.value)}}}function T(R,S,M,G){var H=[],B=S.method&&S.method.toUpperCase&&S.method.toUpperCase();if(B==="OPTIONS")if(H.push(x(R,S)),H.push(m(R,S)),H.push(a(R,S)),H.push(f(R,S)),H.push($(R,S)),H.push(l(R,S)),v(H,M),R.preflightContinue)G();else M.statusCode=R.optionsSuccessStatus,M.setHeader("Content-Length","0"),M.end();else H.push(x(R,S)),H.push(m(R,S)),H.push(l(R,S)),v(H,M),G()}function F(R){var S=null;if(typeof R==="function")S=R;else S=function(M,G){G(null,R)};return function M(G,H,B){S(G,function(k,Y){if(k)B(k);else{var K=n({},o,Y),Q=null;if(K.origin&&typeof K.origin==="function")Q=K.origin;else if(K.origin)Q=function(u,V){V(null,K.origin)};if(Q)Q(G.headers.origin,function(u,V){if(u||!V)B(u);else K.origin=V,T(K,G,H,B)});else B()}})}}aF.exports=F})()});var m$=h((JF)=>{Object.defineProperty(JF,"__esModule",{value:!0});JF.Server=JF.BaseServer=void 0;var DK=import.meta.require("querystring"),CK=import.meta.require("url"),mF=hl(),Qm=c$(),hK=import.meta.require("events"),fF=p$(),IK=ai(),kK=eS(),sK=import.meta.require("ws"),lF=o$(),ZK=jx(),ln=IK.default("engine"),Hp=Symbol("responseHeaders");function qK(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class yx extends hK.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:sK.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(a$()(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 Qm.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return ln('unknown transport "%s"',c),o(Hn.errors.UNKNOWN_TRANSPORT,{transport:c});if(PK(n.headers.origin)){let a=n.headers.origin;return n.headers.origin=null,ln("origin header invalid"),o(Hn.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let x=n._query.sid;if(x){if(!this.clients.hasOwnProperty(x))return ln('unknown sid "%s"',x),o(Hn.errors.UNKNOWN_SID,{sid:x});let a=this.clients[x].transport.name;if(!i&&a!==c)return ln("bad request: unexpected transport without upgrade"),o(Hn.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:a})}else{if(n.method!=="GET")return o(Hn.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return ln("invalid transport upgrade"),o(Hn.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(a,m)=>{if(!m)return o(Hn.errors.FORBIDDEN,{message:a});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return ln("no middleware to apply, skipping"),o();let c=(p)=>{ln("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(x)=>{if(x)return o(x);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){ln("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 mF.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){ln("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(m){ln("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:m}}),o(Hn.errors.BAD_REQUEST);return}ln('handshaking client "%s"',p);try{var x=this.createTransport(n,i);if(n==="polling")x.maxHttpBufferSize=this.opts.maxHttpBufferSize,x.httpCompression=this.opts.httpCompression;else if(n==="websocket")x.perMessageDeflate=this.opts.perMessageDeflate}catch(m){ln('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:m}}),o(Hn.errors.BAD_REQUEST);return}let a=new fF.Socket(p,this,x,i,c);return x.on("headers",(m,f)=>{if(!f._query.sid){if(this.opts.cookie)m["Set-Cookie"]=[kK.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",m,f)}this.emit("headers",m,f)}),x.onRequest(i),this.clients[p]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",a),x}async onWebTransportSession(n){let i=setTimeout(()=>{ln("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){ln("session is closed");return}let p=c.value,x=ZK.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),a=p.readable.pipeThrough(x).getReader(),{value:m,done:f}=await a.read();if(f){ln("stream is closed");return}if(clearTimeout(i),m.type!=="open")return ln("invalid WebTransport handshake"),n.close();if(m.data===void 0){let v=new lF.WebTransport(n,p,a),T=mF.generateId();ln('handshaking client "%s" (WebTransport)',T);let F=new fF.Socket(T,this,v,null,4);this.clients[T]=F,this.clientsCount++,F.once("close",()=>{delete this.clients[T],this.clientsCount--}),this.emit("connection",F);return}let l=qK(m.data);if(!l)return ln("invalid WebTransport handshake"),n.close();let $=this.clients[l];if(!$)ln("upgrade attempt for closed client"),n.close();else if($.upgrading)ln("transport has already been trying to upgrade"),n.close();else if($.upgraded)ln("transport had already been upgraded"),n.close();else{ln("upgrading existing transport");let v=new lF.WebTransport(n,p,a);$._maybeUpgrade(v)}}}JF.BaseServer=yx;yx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};yx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class TF{constructor(n,i){this.req=n,this.socket=i,n[Hp]={}}setHeader(n,i){this.req[Hp][n]=i}getHeader(n){return this.req[Hp][n]}removeHeader(n){delete this.req[Hp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class Hn extends yx{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[Hp]||{};if(delete i[Hp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),ln("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)ln("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?DK.parse(CK.parse(n.url).query):{}}createTransport(n,i){return new Qm.default[n](i)}handleRequest(n,i){ln('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}),$F(i,c,p);return}if(n._query.sid)ln("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let x=(a,m)=>$F(i,a,m);this.handshake(n._query.transport,n,x)}};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 TF(n,i),p=(x,a)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:Hn.errorMessages[x],context:a}),vF(i,x,a);return}let m=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,m,(f)=>{this.onWebSocket(n,i,f)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(Hn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Qm.default[n._query.transport]!==void 0&&!Qm.default[n._query.transport].prototype.handlesUpgrades){ln("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let x=this.clients[c];if(!x)ln("upgrade attempt for closed client"),o.close();else if(x.upgrading)ln("transport has already been trying to upgrade"),o.close();else if(x.upgraded)ln("transport had already been upgraded"),o.close();else{ln("upgrading existing transport"),o.removeListener("error",p);let a=this.createTransport(n._query.transport,n);a.perMessageDeflate=this.opts.perMessageDeflate,x._maybeUpgrade(a)}}else{let x=(a,m)=>vF(i,a,m);this.handshake(n._query.transport,n,x)}function p(){ln("websocket error before upgrade")}}attach(n,i={}){let o=this._computePath(i),c=i.destroyUpgradeTimeout||1000;function p(a){return o===a.url.slice(0,o.length)}let x=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",(a,m)=>{if(p(a))ln('intercepting request for path "%s"',o),this.handleRequest(a,m);else{let f=0,l=x.length;for(;f<l;f++)x[f].call(n,a,m)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(a,m,f)=>{if(p(a))this.handleUpgrade(a,m,f);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(m.writable&&m.bytesWritten<=0)return m.on("error",(l)=>{ln("error while destroying upgrade: %s",l.message)}),m.end()},c)})}}JF.Server=Hn;function $F(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 vF(n,i,o={}){if(n.on("error",()=>{ln("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
42
+ */a$.exports=h7;a$.exports.append=xF;var C7=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function xF(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)?pF(String(i)):i;for(var c=0;c<o.length;c++)if(!C7.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=pF(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var a=o[m].toLowerCase();if(x.indexOf(a)===-1)x.push(a),p=p?p+", "+o[m]:o[m]}return p}function pF(n){var i=0,o=[],c=0;for(var p=0,x=n.length;p<x;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 h7(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=xF(c,i))n.setHeader("Vary",o)}});var f$=h((yL,aF)=>{(function(){var n=cF(),i=mF(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(R){return typeof R==="string"||R instanceof String}function p(R,S){if(Array.isArray(S)){for(var M=0;M<S.length;++M)if(p(R,S[M]))return!0;return!1}else if(c(S))return R===S;else if(S instanceof RegExp)return S.test(R);else return!!S}function x(R,S){var M=S.headers.origin,G=[],H;if(!R.origin||R.origin==="*")G.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(R.origin))G.push([{key:"Access-Control-Allow-Origin",value:R.origin}]),G.push([{key:"Vary",value:"Origin"}]);else H=p(M,R.origin),G.push([{key:"Access-Control-Allow-Origin",value:H?M:!1}]),G.push([{key:"Vary",value:"Origin"}]);return G}function m(R){var S=R.methods;if(S.join)S=R.methods.join(",");return{key:"Access-Control-Allow-Methods",value:S}}function a(R){if(R.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function f(R,S){var M=R.allowedHeaders||R.headers,G=[];if(!M)M=S.headers["access-control-request-headers"],G.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(M.join)M=M.join(",");if(M&&M.length)G.push([{key:"Access-Control-Allow-Headers",value:M}]);return G}function l(R){var S=R.exposedHeaders;if(!S)return null;else if(S.join)S=S.join(",");if(S&&S.length)return{key:"Access-Control-Expose-Headers",value:S};return null}function $(R){var S=(typeof R.maxAge==="number"||R.maxAge)&&R.maxAge.toString();if(S&&S.length)return{key:"Access-Control-Max-Age",value:S};return null}function v(R,S){for(var M=0,G=R.length;M<G;M++){var H=R[M];if(H){if(Array.isArray(H))v(H,S);else if(H.key==="Vary"&&H.value)i(S,H.value);else if(H.value)S.setHeader(H.key,H.value)}}}function T(R,S,M,G){var H=[],y=S.method&&S.method.toUpperCase&&S.method.toUpperCase();if(y==="OPTIONS")if(H.push(x(R,S)),H.push(a(R,S)),H.push(m(R,S)),H.push(f(R,S)),H.push($(R,S)),H.push(l(R,S)),v(H,M),R.preflightContinue)G();else M.statusCode=R.optionsSuccessStatus,M.setHeader("Content-Length","0"),M.end();else H.push(x(R,S)),H.push(a(R,S)),H.push(l(R,S)),v(H,M),G()}function F(R){var S=null;if(typeof R==="function")S=R;else S=function(M,G){G(null,R)};return function M(G,H,y){S(G,function(k,Y){if(k)y(k);else{var K=n({},o,Y),Q=null;if(K.origin&&typeof K.origin==="function")Q=K.origin;else if(K.origin)Q=function(u,V){V(null,K.origin)};if(Q)Q(G.headers.origin,function(u,V){if(u||!V)y(u);else K.origin=V,T(K,G,H,y)});else y()}})}}aF.exports=F})()});var l$=h((wF)=>{Object.defineProperty(wF,"__esModule",{value:!0});wF.Server=wF.BaseServer=void 0;var I7=import.meta.require("querystring"),k7=import.meta.require("url"),fF=kl(),Ea=x$(),s7=import.meta.require("events"),lF=m$(),Z7=ai(),q7=nF(),P7=import.meta.require("ws"),$F=p$(),t7=Bx(),ln=Z7.default("engine"),Qp=Symbol("responseHeaders");function r7(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class Lx extends s7.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:P7.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(f$()(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 Ea.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return ln('unknown transport "%s"',c),o(Hn.errors.UNKNOWN_TRANSPORT,{transport:c});if(g7(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,ln("origin header invalid"),o(Hn.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:m})}let x=n._query.sid;if(x){if(!this.clients.hasOwnProperty(x))return ln('unknown sid "%s"',x),o(Hn.errors.UNKNOWN_SID,{sid:x});let m=this.clients[x].transport.name;if(!i&&m!==c)return ln("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 ln("invalid transport upgrade"),o(Hn.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,a)=>{if(!a)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 ln("no middleware to apply, skipping"),o();let c=(p)=>{ln("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(x)=>{if(x)return o(x);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){ln("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 fF.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){ln("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(a){ln("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:a}}),o(Hn.errors.BAD_REQUEST);return}ln('handshaking client "%s"',p);try{var x=this.createTransport(n,i);if(n==="polling")x.maxHttpBufferSize=this.opts.maxHttpBufferSize,x.httpCompression=this.opts.httpCompression;else if(n==="websocket")x.perMessageDeflate=this.opts.perMessageDeflate}catch(a){ln('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:a}}),o(Hn.errors.BAD_REQUEST);return}let m=new lF.Socket(p,this,x,i,c);return x.on("headers",(a,f)=>{if(!f._query.sid){if(this.opts.cookie)a["Set-Cookie"]=[q7.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",a,f)}this.emit("headers",a,f)}),x.onRequest(i),this.clients[p]=m,this.clientsCount++,m.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",m),x}async onWebTransportSession(n){let i=setTimeout(()=>{ln("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){ln("session is closed");return}let p=c.value,x=t7.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(x).getReader(),{value:a,done:f}=await m.read();if(f){ln("stream is closed");return}if(clearTimeout(i),a.type!=="open")return ln("invalid WebTransport handshake"),n.close();if(a.data===void 0){let v=new $F.WebTransport(n,p,m),T=fF.generateId();ln('handshaking client "%s" (WebTransport)',T);let F=new lF.Socket(T,this,v,null,4);this.clients[T]=F,this.clientsCount++,F.once("close",()=>{delete this.clients[T],this.clientsCount--}),this.emit("connection",F);return}let l=r7(a.data);if(!l)return ln("invalid WebTransport handshake"),n.close();let $=this.clients[l];if(!$)ln("upgrade attempt for closed client"),n.close();else if($.upgrading)ln("transport has already been trying to upgrade"),n.close();else if($.upgraded)ln("transport had already been upgraded"),n.close();else{ln("upgrading existing transport");let v=new $F.WebTransport(n,p,m);$._maybeUpgrade(v)}}}wF.BaseServer=Lx;Lx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};Lx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class JF{constructor(n,i){this.req=n,this.socket=i,n[Qp]={}}setHeader(n,i){this.req[Qp][n]=i}getHeader(n){return this.req[Qp][n]}removeHeader(n){delete this.req[Qp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class Hn extends Lx{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[Qp]||{};if(delete i[Qp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),ln("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)ln("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?I7.parse(k7.parse(n.url).query):{}}createTransport(n,i){return new Ea.default[n](i)}handleRequest(n,i){ln('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}),vF(i,c,p);return}if(n._query.sid)ln("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let x=(m,a)=>vF(i,m,a);this.handshake(n._query.transport,n,x)}};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 JF(n,i),p=(x,m)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:Hn.errorMessages[x],context:m}),TF(i,x,m);return}let a=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,a,(f)=>{this.onWebSocket(n,i,f)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(Hn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Ea.default[n._query.transport]!==void 0&&!Ea.default[n._query.transport].prototype.handlesUpgrades){ln("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let x=this.clients[c];if(!x)ln("upgrade attempt for closed client"),o.close();else if(x.upgrading)ln("transport has already been trying to upgrade"),o.close();else if(x.upgraded)ln("transport had already been upgraded"),o.close();else{ln("upgrading existing transport"),o.removeListener("error",p);let m=this.createTransport(n._query.transport,n);m.perMessageDeflate=this.opts.perMessageDeflate,x._maybeUpgrade(m)}}else{let x=(m,a)=>TF(i,m,a);this.handshake(n._query.transport,n,x)}function p(){ln("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 x=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,a)=>{if(p(m))ln('intercepting request for path "%s"',o),this.handleRequest(m,a);else{let f=0,l=x.length;for(;f<l;f++)x[f].call(n,m,a)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,a,f)=>{if(p(m))this.handleUpgrade(m,a,f);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(a.writable&&a.bytesWritten<=0)return a.on("error",(l)=>{ln("error while destroying upgrade: %s",l.message)}),a.end()},c)})}}wF.Server=Hn;function vF(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 TF(n,i,o={}){if(n.on("error",()=>{ln("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
43
43
  Connection: close\r
44
44
  Content-type: text/html\r
45
45
  Content-Length: `+p+`\r
46
46
  \r
47
- `+c)}n.destroy()}var Bx=[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 PK(n){if(n+="",n.length<1)return!1;if(!Bx[n.charCodeAt(0)])return ln('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!Bx[n.charCodeAt(1)])return ln('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!Bx[n.charCodeAt(2)])return ln('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!Bx[n.charCodeAt(3)])return ln('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!Bx[n.charCodeAt(i)])return ln('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var RF=h((FF)=>{Object.defineProperty(FF,"__esModule",{value:!0});FF.Polling=void 0;var rK=bc(),AF=import.meta.require("zlib"),gK=wm(),dK=ai(),no=dK.default("engine:polling"),eK={gzip:AF.createGzip,deflate:AF.createDeflate};class SF extends rK.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,x=0,a={"Content-Type":"text/html"};this.headers(n,a);for(let f in a)i.writeHeader(f,String(a[f]));let m=(f)=>{this.onData(f.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((f,l)=>{let $=x+f.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(l){m(Buffer.from(f));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(f).copy(p,x),l){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}m(p);return}x=$})}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",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},a=(l)=>{this.headers(this.req,x),this.res.cork(()=>{Object.keys(x).forEach(($)=>{this.res.writeHeader($,String(x[$]))}),this.res.end(l)}),o()};if(!this.httpCompression||!i.compress){a(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){a(n);return}let f=gK(this.req).encodings(["gzip","deflate"]);if(!f){a(n);return}this.compress(n,f,(l,$)=>{if(l){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(l);return}x["Content-Encoding"]=f,a($)})}compress(n,i,o){no("compressing");let c=[],p=0;eK[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.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}}FF.Polling=SF});var YF=h((XF)=>{Object.defineProperty(XF,"__esModule",{value:!0});XF.WebSocket=void 0;var nX=bc(),iX=ai(),WF=iX.default("engine:ws");class KF extends nX.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=(x)=>{let a=typeof x!=="string",m=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(WF('writing "%s"',x),this.socket.send(x,a,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){WF("closing"),n&&n(),this.socket.end()}}XF.WebSocket=KF});var HF=h((zF)=>{Object.defineProperty(zF,"__esModule",{value:!0});var oX=RF(),cX=YF();zF.default={polling:oX.Polling,websocket:cX.WebSocket}});var VF=h((EF)=>{Object.defineProperty(EF,"__esModule",{value:!0});EF.uServer=void 0;var xX=ai(),jc=m$(),aX=HF(),vc=xX.default("engine:uws");class QF extends jc.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 aX.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,x)=>{c.getUserData().transport.onData(x?p:Buffer.from(p).toString())},close:(c,p,x)=>{c.getUserData().transport.onClose(p,x)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new OF(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:jc.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 x=(a,m)=>this.abortRequest(n,a,m);this.handshake(i._query.transport,i,x)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(jc.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,x)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:jc.Server.errorMessages[p],context:x}),this.abortRequest(n,p,x);return}let a=i._query.sid,m;if(a){let f=this.clients[a];if(!f)return vc("upgrade attempt for closed client"),n.close();else if(f.upgrading)return vc("transport has already been trying to upgrade"),n.close();else if(f.upgraded)return vc("transport had already been upgraded"),n.close();else vc("upgrading existing transport"),m=this.createTransport(i._query.transport,i),f._maybeUpgrade(m)}else if(m=await this.handshake(i._query.transport,i,(f,l)=>this.abortRequest(n,f,l)),!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(jc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===jc.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:jc.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}EF.uServer=QF;class OF{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=TX;Qp.attach=bF;var mX=import.meta.require("http"),_F=m$();Object.defineProperty(Qp,"Server",{enumerable:!0,get:function(){return _F.Server}});var fX=c$();Qp.transports=fX.default;var uF=jx();Qp.parser=uF;var lX=VF();Object.defineProperty(Qp,"uServer",{enumerable:!0,get:function(){return lX.uServer}});var $X=p$();Object.defineProperty(Qp,"Socket",{enumerable:!0,get:function(){return $X.Socket}});var vX=bc();Object.defineProperty(Qp,"Transport",{enumerable:!0,get:function(){return vX.Transport}});Qp.protocol=uF.protocol;function TX(n,i,o){if(typeof i==="function")o=i,i={};let c=mX.createServer(function(x,a){a.writeHead(501),a.end("Not Implemented")}),p=bF(c,i);return p.httpServer=c,c.listen(n,o),p}function bF(n,i){let o=new _F.Server(i);return o.attach(n,i),o}});var yF=h((MX)=>{MX.Emitter=Oi;function Oi(n){if(n)return FX(n)}function FX(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 f$=h((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.hasBinary=DF.isBinary=void 0;var WX=typeof ArrayBuffer==="function",KX=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},LF=Object.prototype.toString,XX=typeof Blob==="function"||typeof Blob!=="undefined"&&LF.call(Blob)==="[object BlobConstructor]",GX=typeof File==="function"||typeof File!=="undefined"&&LF.call(File)==="[object FileConstructor]";function NF(n){return WX&&(n instanceof ArrayBuffer||KX(n))||XX&&n instanceof Blob||GX&&n instanceof File}DF.isBinary=NF;function Om(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Om(n[o]))return!0;return!1}if(NF(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Om(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Om(n[o]))return!0;return!1}DF.hasBinary=Om});var kF=h((hF)=>{Object.defineProperty(hF,"__esModule",{value:!0});hF.reconstructPacket=hF.deconstructPacket=void 0;var zX=f$();function HX(n){let i=[],o=n.data,c=n;return c.data=l$(o,i),c.attachments=i.length,{packet:c,buffers:i}}hF.deconstructPacket=HX;function l$(n,i){if(!n)return n;if(zX.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]=l$(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]=l$(n[c],i);return o}return n}function QX(n,i){return n.data=$$(n.data,i),delete n.attachments,n}hF.reconstructPacket=QX;function $$(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]=$$(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=$$(n[o],i)}return n}});var Lx=h((gF)=>{Object.defineProperty(gF,"__esModule",{value:!0});gF.Decoder=gF.Encoder=gF.PacketType=gF.protocol=void 0;var EX=yF(),qF=kF(),PF=f$(),UX=ai(),v$=UX.default("socket.io-parser"),VX=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];gF.protocol=5;var kn;(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"})(kn=gF.PacketType||(gF.PacketType={}));class tF{constructor(n){this.replacer=n}encode(n){if(v$("encoding packet %j",n),n.type===kn.EVENT||n.type===kn.ACK){if(PF.hasBinary(n))return this.encodeAsBinary({type:n.type===kn.EVENT?kn.BINARY_EVENT:kn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===kn.BINARY_EVENT||n.type===kn.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 v$("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=qF.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}gF.Encoder=tF;function sF(n){return Object.prototype.toString.call(n)==="[object Object]"}class T$ extends EX.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===kn.BINARY_EVENT;if(o||i.type===kn.BINARY_ACK){if(i.type=o?kn.EVENT:kn.ACK,this.reconstructor=new rF(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(PF.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(kn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===kn.BINARY_EVENT||o.type===kn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let x=n.substring(p,i);if(x!=Number(x)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(x)}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 x=n.charAt(i);if(x==null||Number(x)!=x){--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(T$.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return v$("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 kn.CONNECT:return sF(i);case kn.DISCONNECT:return i===void 0;case kn.CONNECT_ERROR:return typeof i==="string"||sF(i);case kn.EVENT:case kn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&VX.indexOf(i[0])===-1);case kn.ACK:case kn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}gF.Decoder=T$;class rF{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=qF.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var oM=h((nM)=>{Object.defineProperty(nM,"__esModule",{value:!0});nM.Client=void 0;var Em=Lx(),bX=ai(),jX=import.meta.require("url"),Ao=bX("socket.io:client");class eF{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:Em.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=jX.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===Em.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==Em.PacketType.CONNECT&&n.type!==Em.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}}nM.Client=eF});var Um=h((pM)=>{Object.defineProperty(pM,"__esModule",{value:!0});pM.StrictEventEmitter=void 0;var BX=import.meta.require("events");class cM extends BX.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)}}pM.StrictEventEmitter=cM});var J$=h((aM)=>{Object.defineProperty(aM,"__esModule",{value:!0});aM.RESERVED_EVENTS=void 0;aM.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var A$=h((fM)=>{Object.defineProperty(fM,"__esModule",{value:!0});fM.RemoteSocket=fM.BroadcastOperator=void 0;var yX=J$(),LX=Lx();class Do{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 Do(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 Do(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new Do(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new Do(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new Do(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new Do(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(yX.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:LX.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 x=o.pop(),a=!1,m=[],f=setTimeout(()=>{a=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:m])},this.flags.timeout),l=-1,$=0,v=0,T=()=>{if(!a&&l===$&&m.length===v)clearTimeout(f),x.apply(this,[null,this.flags.expectSingleResponse?m[0]:m])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(F)=>{v+=F,$++,T()},(F)=>{m.push(F),T()}),this.adapter.serverCount().then((F)=>{l=F,T()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),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 w$(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)}}fM.BroadcastOperator=Do;class w${constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new Do(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}}fM.RemoteSocket=w$});var S$=h((Op)=>{var TM=Op&&Op.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Op,"__esModule",{value:!0});Op.Socket=void 0;var io=Lx(),DX=TM(ai()),CX=Um(),$M=TM(hl()),hX=A$(),IX=J$(),Ki=DX.default("socket.io:socket"),kX=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function vM(){}class JM extends CX.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=$M.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=$M.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",vM)}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(IX.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 x=this.nsp._ids++;Ki("emitting packet with ack id %d",x),this.registerAckCallback(x,o.pop()),c.id=x}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((x,a)=>{if(o)return x?p(x):c(a);else return c(x)}),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(()=>{Ki("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 Ki("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Ki("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Ki("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(Ki("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(Ki("emitting event %j",i),n.id!=null)Ki("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);Ki("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")Ki("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Ki("bad ack %s",n.id)}ondisconnect(){Ki("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Ki("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&kX.has(n))Ki("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=vM}_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){Ki("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 Ki("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,(x)=>{if(x)return i(x);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 hX.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Op.Socket=JM});var F$=h((Co)=>{var sX=Co&&Co.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Co,"__esModule",{value:!0});Co.Namespace=Co.RESERVED_EVENTS=void 0;var wM=S$(),ZX=Um(),qX=sX(ai()),hi=A$(),Nx=qX.default("socket.io:namespace");Co.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class AM extends ZX.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,(x)=>{if(x)return i(x);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;Nx("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,(x)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Nx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Nx("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(x.data||x.message);else return p._error({message:x.message,data:x.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(x){Nx("error while restoring session: %s",x)}if(p)return Nx("connection state recovered for sid %s",p.sid),new wM.Socket(this,n,i,p)}return new wM.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(Co.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,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),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)}}Co.Namespace=AM});var XM=h((WM)=>{Object.defineProperty(WM,"__esModule",{value:!0});WM.yeast=WM.decode=WM.encode=void 0;var MM="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Vm=64,RM={},SM=0,Tc=0,FM;function M$(n){let i="";do i=MM[n%Vm]+i,n=Math.floor(n/Vm);while(n>0);return i}WM.encode=M$;function PX(n){let i=0;for(Tc=0;Tc<n.length;Tc++)i=i*Vm+RM[n.charAt(Tc)];return i}WM.decode=PX;function tX(){let n=M$(+new Date);if(n!==FM)return SM=0,FM=n;return n+"."+M$(SM++)}WM.yeast=tX;for(;Tc<Vm;Tc++)RM[MM[Tc]]=Tc});var K$=h((YM)=>{var R$;Object.defineProperty(YM,"__esModule",{value:!0});YM.SessionAwareAdapter=YM.Adapter=void 0;var dX=import.meta.require("events"),eX=XM(),_m=import.meta.require("ws"),n5=typeof((R$=_m===null||_m===void 0?void 0:_m.Sender)===null||R$===void 0?void 0:R$.frame)==="function";class W$ extends dX.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,(x)=>{if(typeof x.notifyOutgoingListeners==="function")x.notifyOutgoingListeners(n);x.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let a=this._encode(n,x),m=0;this.apply(i,(f)=>{if(m++,f.acks.set(n.id,c),typeof f.notifyOutgoingListeners==="function")f.notifyOutgoingListeners(n);f.client.writeToEngine(a,x)}),o(m)}_encode(n,i){let o=this.encoder.encode(n);if(n5&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=_m.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 x of o){if(!this.rooms.has(x))continue;for(let a of this.rooms.get(x)){if(p.has(a)||c.has(a))continue;let m=this.nsp.sockets.get(a);if(m)i(m),p.add(a)}}}else for(let[p]of this.sids){if(c.has(p))continue;let x=this.nsp.sockets.get(p);if(x)i(x)}}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}}YM.Adapter=W$;class GM extends W${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((a)=>a.id===i);if(p===-1)return null;let x=[];for(let a=p+1;a<this.packets.length;a++){let m=this.packets[a];if(i5(o.rooms,m.opts))x.push(m.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:x}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,x=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&x){let a=eX.yeast();n.data.push(a),this.packets.push({id:a,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}YM.SessionAwareAdapter=GM;function i5(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 QM=h((So)=>{var c5=So&&So.__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(So,"__esModule",{value:!0});So.ClusterAdapterWithHeartbeat=So.ClusterAdapter=So.MessageType=void 0;var p5=K$(),x5=ai(),a5=import.meta.require("crypto"),Pn=x5.debug("socket.io-adapter"),m5="emitter",um=5000;function Up(){return a5.randomBytes(8).toString("hex")}var xn;(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"})(xn=So.MessageType||(So.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 X$ extends p5.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Up()}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 xn.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:xn.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:xn.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 xn.SOCKETS_JOIN:super.addSockets(Ep(n.data.opts),n.data.rooms);break;case xn.SOCKETS_LEAVE:super.delSockets(Ep(n.data.opts),n.data.rooms);break;case xn.DISCONNECT_SOCKETS:super.disconnectSockets(Ep(n.data.opts),n.data.close);break;case xn.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:xn.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:x}=p,a=c5(p,["sessionStore"]);return{id:c.id,handshake:a,rooms:[...c.rooms],data:c.data}})}})});break}case xn.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,x=(a)=>{if(p)return;p=!0,Pn("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(n.uid,{type:xn.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:a}})};this.nsp._onServerSideEmit([...o,x]);break}case xn.BROADCAST_CLIENT_COUNT:case xn.BROADCAST_ACK:case xn.FETCH_SOCKETS_RESPONSE:case xn.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 xn.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case xn.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case xn.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((x)=>p.responses.push(x)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case xn.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:xn.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,x=n.id===void 0,a=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&x&&a)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 a=Up();this.ackRequests.set(a,{clientCountCallback:o,ack:c}),this.publish({type:xn.BROADCAST,data:{packet:n,requestId:a,opts:Bc(i)}}),setTimeout(()=>{this.ackRequests.delete(a)},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:xn.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:xn.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:xn.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 x=Up();return new Promise((a,m)=>{let f=setTimeout(()=>{let $=this.requests.get(x);if($)m(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(x)},n.flags.timeout||um),l={type:xn.FETCH_SOCKETS,resolve:a,timeout:f,current:0,expected:p,responses:o};this.requests.set(x,l),this.publish({type:xn.FETCH_SOCKETS,data:{opts:Bc(n),requestId:x}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:xn.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=Up(),x=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)},um),a={type:xn.SERVER_SIDE_EMIT,resolve:o,timeout:x,current:0,expected:c,responses:[]};this.requests.set(p,a),this.publish({type:xn.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)})}}So.ClusterAdapter=X$;class HM extends X${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:xn.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:xn.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:xn.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!==m5)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 xn.INITIAL_HEARTBEAT:this.publish({type:xn.HEARTBEAT});break;case xn.HEARTBEAT:break;case xn.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:xn.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=Up(),x=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)},um),a={type:xn.SERVER_SIDE_EMIT,resolve:o,timeout:x,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,a),this.publish({type:xn.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 x=Up();return new Promise((a,m)=>{let f=setTimeout(()=>{let $=this.customRequests.get(x);if($)m(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||um),l={type:xn.FETCH_SOCKETS,resolve:a,timeout:f,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,l),this.publish({type:xn.FETCH_SOCKETS,data:{opts:Bc(n),requestId:x}})})}onResponse(n){let i=n.data.requestId;switch(Pn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case xn.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 xn.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===xn.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===xn.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}So.ClusterAdapterWithHeartbeat=HM});var bm=h((yc)=>{Object.defineProperty(yc,"__esModule",{value:!0});yc.MessageType=yc.ClusterAdapterWithHeartbeat=yc.ClusterAdapter=yc.SessionAwareAdapter=yc.Adapter=void 0;var OM=K$();Object.defineProperty(yc,"Adapter",{enumerable:!0,get:function(){return OM.Adapter}});Object.defineProperty(yc,"SessionAwareAdapter",{enumerable:!0,get:function(){return OM.SessionAwareAdapter}});var G$=QM();Object.defineProperty(yc,"ClusterAdapter",{enumerable:!0,get:function(){return G$.ClusterAdapter}});Object.defineProperty(yc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return G$.ClusterAdapterWithHeartbeat}});Object.defineProperty(yc,"MessageType",{enumerable:!0,get:function(){return G$.MessageType}})});var _M=h((Vp)=>{var l5=Vp&&Vp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.ParentNamespace=void 0;var EM=F$(),$5=bm(),v5=l5(ai()),UM=v5.default("socket.io:parent-namespace");class jm extends EM.Namespace{constructor(n){super(n,"/_"+jm.count++);this.children=new Set}_initAdapter(){this.adapter=new VM(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){UM("creating child namespace %s",n);let i=new EM.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)UM("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")}}Vp.ParentNamespace=jm;jm.count=0;class VM extends $5.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var LM=h((Nc)=>{var T5=Nc&&Nc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Nc,"__esModule",{value:!0});Nc.patchAdapter=w5;Nc.restoreAdapter=A5;Nc.serveFile=F5;var Lc=bm(),uM=import.meta.require("fs"),J5=T5(ai()),Bm=J5.default("socket.io:adapter-uws"),Y$="\x1F",{addAll:jM,del:BM,broadcast:yM}=Lc.Adapter.prototype;function w5(n){Lc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);jM.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"){bM(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)bM(this.nsp.name,p,c,x)})},Lc.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,x=c.conn.transport.socket,a=`${this.nsp.name}${Y$}${o}`;Bm("unsubscribe connection %s from topic %s",p,a),x.unsubscribe(a)}},Lc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){yM.call(this,i,o);return}let p=o.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let a=this.encoder.encode(i),m=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${Y$}${o.rooms.keys().next().value}`;Bm("fast publish to %s",m),a.forEach((f)=>{let l=typeof f!=="string";n.publish(m,l?f:"4"+f,l)}),this.apply(o,(f)=>{if(f.conn.transport.name!=="websocket")f.client.writeToEngine(a,x)})}}function bM(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)Bm("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((a)=>{let m=`${n}${Y$}${a}`;Bm("subscribe connection %s to topic %s",p,m),x.subscribe(m)})}function A5(){Lc.Adapter.prototype.addAll=jM,Lc.Adapter.prototype.del=BM,Lc.Adapter.prototype.broadcast=yM}var S5=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function F5(n,i){let{size:o}=uM.statSync(i),c=uM.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(m)=>{throw p(),m},a=(m)=>{let f=S5(m);n.cork(()=>{let l=n.getWriteOffset(),[$,v]=n.tryEnd(f,o);if(!v&&!$)c.pause(),n.onWritable((T)=>{let[F,R]=n.tryEnd(f.slice(T-l),o);if(!R&&F)c.resume();return F})})};n.onAborted(p),c.on("data",a).on("error",x).on("end",p)}});var NM=h((xN,M5)=>{M5.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 PM=h((Xi,Dx)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",R5=Xi&&Xi.__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]}),W5=Xi&&Xi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),K5=Xi&&Xi.__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))R5(i,n,o)}return W5(i,n),i},ZM=Xi&&Xi.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Namespace=Xi.Socket=Xi.Server=void 0;var X5=import.meta.require("http"),G5=import.meta.require("fs"),z$=import.meta.require("zlib"),Y5=wm(),ym=import.meta.require("stream"),DM=import.meta.require("path"),CM=BF(),z5=oM(),hM=import.meta.require("events"),Q$=F$();Object.defineProperty(Xi,"Namespace",{enumerable:!0,get:function(){return Q$.Namespace}});var H5=_M(),IM=bm(),Q5=K5(Lx()),O5=ZM(ai()),qM=S$();Object.defineProperty(Xi,"Socket",{enumerable:!0,get:function(){return qM.Socket}});var E5=Um(),H$=LM(),U5=ZM(a$()),ji=O5.default("socket.io:server"),kM=NM().version,sM=/\.map/;class _p extends E5.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||Q5,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||IM.SessionAwareAdapter);else this.adapter(i.adapter||IM.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=U5.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 x=c.next();if(x.done)return o(!1);x.value(n,i,(a,m)=>{if(a||!m)return p();if(this._nsps.has(n))return ji("dynamic namespace %s already exists",n),o(this._nsps.get(n));let f=this.parentNsps.get(x.value).createChild(n);ji("dynamic namespace %s was created",n),o(f)})};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"){ji("creating http server and binding to %d",n);let o=n;n=X5.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,ji("creating uWebSockets.js-based engine with opts %j",i);let o=new CM.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 x=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=sM.test(x),m=a?"map":"source",f='"'+kM+'"',l="W/"+f,$=p.getHeader("if-none-match");if($){if(f===$||l===$){ji("serve client %s 304",m),c.writeStatus("304 Not Modified"),c.end();return}}ji("serve client %s",m),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",f);let v=DM.join(__dirname,"../client-dist/",x);H$.serveFile(c,v)});H$.patchAdapter(n)}initEngine(n,i){if(ji("creating engine.io instance with opts %j",i),this.eio=CM.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){ji("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=sM.test(o),p=c?"map":"source",x='"'+kM+'"',a="W/"+x,m=n.headers["if-none-match"];if(m){if(x===m||a===m){ji("serve client %s 304",p),i.writeHead(304),i.end();return}}ji("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",x),_p.sendFile(o,n,i)}static sendFile(n,i,o){let c=G5.createReadStream(DM.join(__dirname,"../client-dist/",n)),p=Y5(i).encodings(["br","gzip","deflate"]),x=(a)=>{if(a)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),ym.pipeline(c,z$.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),ym.pipeline(c,z$.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),ym.pipeline(c,z$.createDeflate(),o,x);break;default:o.writeHead(200),ym.pipeline(c,o,x)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){ji("incoming connection with id %s",n.id);let i=new z5.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new H5.ParentNamespace(this);if(ji("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,x,a)=>a(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 ji("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(ji("initializing namespace %s",n),o=new Q$.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(),H$.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)}}Xi.Server=_p;var V5=Object.keys(hM.EventEmitter.prototype).filter(function(n){return typeof hM.EventEmitter.prototype[n]==="function"});V5.forEach(function(n){_p.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});Dx.exports=(n,i)=>new _p(n,i);Dx.exports.Server=_p;Dx.exports.Namespace=Q$.Namespace;Dx.exports.Socket=qM.Socket});import{createHash as n4}from"crypto";import{createServer as CG}from"http";import{createServer as hG}from"https";function dc(n=Math.random){return n().toString(36).slice(2)}class px 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 E0(n){return Object.entries(n)}var U0=(n,i,o=on.STORE)=>{return xx(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 V0(n){while(n.parent!==null)n=n.parent;return n}class an{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 Sf extends an{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function Zo(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new an,m=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F=i.default,R={key:v,default:F instanceof Function?F(f):F};if(i.effects)R.effects=i.effects(f);let S=qo(T,R,$);return x.next({type:"state_creation",token:S}),S},c,{subject:x,install:(f)=>Zo(f,i),internalRoles:o});return n.families.set(i.key,m),n.defaults.set(i.key,i.default),c}function _0(n,i){if("mutable"in i)return ax(n,i);return Zo(n,i)}function Po(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new an,m=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F=mx(T,{key:v,get:i.get(f)},$);return x.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:x,install:(f)=>Po(f,i),default:(f)=>{return i.get(f)({get:(...$)=>An(n,...$),find:($,v)=>Tn(n,$,v),seek:($,v)=>jn(n,$,v),json:($)=>sn(n,$)})}});return n.families.set(i.key,m),c}function Ff(n,i){if("set"in i)return fx(n,i);return Po(n,i)}var i8={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function ec(n,i){let o=g(i),c=`${n.key}(${o})`,p=i8[n.type],x={key:c,type:p};if(p==="molecule")Object.assign(x,{key:i,family:n});else Object.assign(x,{family:{key:n.key,subKey:o}});return Object.assign(x,{counterfeit:!0}),x}function si(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class Bi{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 x of o){c??=x,p??=x;let a=this.relations.get(x);if(a){if(a.size===1)this.relations.delete(x);else a.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let x of i){let a=this.relations.get(x);if(a)a.add(n);else a=new Set().add(n),this.relations.set(x,a)}}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 x=this.isAType?.(c)?c:void 0,a=x===void 0?c:void 0;for(let m of p)x??=m,a??=m,this.addRelation(x,a)}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 x of p){let a=this.makeContentKey(n,x),m=i[x];this.setContent(a,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 Zn(n){return"epoch"in n.transactionMeta}function wn(n){return"phase"in n.transactionMeta}var u0=(n)=>{let i=U(n);if(!wn(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 o8=(n)=>n[0].toUpperCase()+n.slice(1);function ao(n){return n.type.split("_").map(o8).join(" ")}class _i extends Error{constructor(...n){let i=n[0],o=n.length===2?n[1]:n[2];if(n.length===2)super(`${ao(i)} ${g(i.key)} not found in store "${o.config.name}".`);else{let c=n[1];super(`${ao(i)} "${i.key}" member ${g(c)} not found in store "${o.config.name}".`)}}}function to(n,i,o){return(...c)=>{let p=e(n,o);if(p)return p.run(c,i);throw new _i(n,o)}}var $a=(n)=>(i)=>n instanceof Function?n(i):n;var ro=(n,i)=>{if(i.valueMap.has(n.key))return i.logger.info("\uD83D\uDCD6",n.type,n.key,"reading cached value"),b0(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 j0=(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}"${!wn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},B0=(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)},y0=(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)},np=(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 L0=(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 Mf=(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(y0(o,p))continue;N0(p,o),np(o,p)}}};function c8(n,i){if(C0(i.newValue))return!1;if(n.includes("\uD83D\uDD0D"))return!1;return!0}var D0=(n,i,o)=>{let{key:c}=n,p=U(o);if(!wn(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(!c8(c,i))return;let a={type:"atom_update",key:c,...i};if(n.family)a.family=n.family;p.transactionMeta.update.updates.push(a),o.logger.info("\uD83D\uDCC1","atom",c,"stowed (",i.oldValue,"->",i.newValue,")")};var h0=(n,i,o)=>{let c=ro(n,o),p=c;if(n.type==="mutable_atom"&&wn(o)){let{parent:a}=o;p=lx(n,a,o)}if(p=$a(i)(p),o.logger.info("\uD83D\uDCDD","atom",n.key,"set to",p),p=Zi(n.key,p,n.subject,o),I0(n.key,o))k0(n.key,o);np(o,n.key),Mf(n,o);let x={oldValue:c,newValue:p};if(Zn(o))L0(n,x,o);else if(o.parent){if(o.on.transactionApplying.state===null)D0(n,x,o);else if(n.key.startsWith("*")){let a=n.key.slice(1),m=o.atoms.get(a),f=o.valueMap.get(a);if(m.type==="mutable_atom"&&wn(o)){let{parent:$}=o;f=lx(m,$,o)}if(f.do(x.newValue)===null)Mf(m,o)}}};var va=(n,i,o)=>{switch(n.type){case"atom":case"mutable_atom":h0(n,i,o);break;case"selector":n.set(i);break}};function Ta(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function Yn(n,...i){let o,c,p,x;if(i.length===2){if(o=i[0],x=i[1],c=Ta(n,o)??null,c)p=o.family?ii(o.family.subKey):null,o=Tn(n,c,p)}else c=i[0],p=i[1],x=i[2],o=Tn(n,c,p);if("counterfeit"in o){let f=n.disposalTraces.buffer.find((l)=>l?.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}".`,f?`This state was previously disposed:
48
- ${f.trace}`:"No previous disposal trace was found.");return}let a=j0(n,o);if(a){let f=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${a}`,()=>{f(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${a}`),Yn(n,o,x)});return}let m=e(o,n);va(m,x,n),B0(n)}function Ja(n,i,o){let{key:c,newValue:p,oldValue:x}=i,a=n==="newValue"?p:x,m={key:c,type:"atom"};if(i.family)Object.assign(m,{family:i.family});Yn(o,m,a)}function s0(n,i){let o=new an,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 mo(n,i,o){let c=uo(o,i,n.key);n.tokens.set(c.key,c);let p=wn(o)&&o.transactionMeta.phase==="building",x=o.moleculeInProgress===n.key;if(!p&&!x)n.subject.next({type:"state_creation",token:c});return c}class oi extends Set{mode="record";subject=new an;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof oi)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 oi(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:${g(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:${g(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new oi(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 x=n.substring(i+1);return this.doStep(x),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let x=this.cacheIdx+c;if(this.cache[x]===n)return null;this.mode="playback";let m=!1;while(!m){this.cacheIdx%=this.cacheLimit;let l=this.cache[this.cacheIdx];if(this.cacheIdx--,!l)return"OUT_OF_RANGE";this.undo(l),m=this.cacheIdx===x-1}let f=n.substring(i+1);return this.doStep(f),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 x of p)this.add(x);break}case"tx":{let p=c.split(";");for(let x=p.length-1;x>=0;x--)this.undoStep(p[x])}}}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 Kf{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 Kf(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=(Y,K)=>{let Q=this.toolkit.seek(Y,K);if(Q)return Q;let u=this.store.molecules.get(g(K));if(u){let V=e(Y,o);return mo(u,V,o)}if(o.config.lifespan==="immortal")throw new _i(Y,K,o);return uo(o,Y,K)},this.toolkit={get:(...Y)=>An(o,...Y),set:(...Y)=>{Yn(o,...Y)},find:this.retrieve,seek:(...Y)=>jn(o,...Y),json:(Y)=>sn(o,Y),dispose:(...Y)=>{Hi(o,...Y)}};let c=n.between[0],p=n.between[1],x=ax(o,{key:`${n.key}/relatedKeys`,default:()=>new oi,mutable:!0,fromJson:(Y)=>oi.fromJSON(Y),toJson:(Y)=>Y.toJSON()},["join","relations"]);this.core={findRelatedKeysState:x};let a=({get:Y},K)=>Y(this.retrieve(x,K)),m=(Y,K,Q)=>{let{set:u}=Y,V=this.retrieve(x,K),X=this.retrieve(x,Q);u(V,(s)=>s.add(Q)),u(X,(s)=>s.add(K))},f=(Y,K,Q)=>{let{set:u}=Y,V=this.retrieve(x,K),X=this.retrieve(x,Q),s,C;u(V,(q)=>{if(q.delete(Q),q.size===0)s=`"${K}"`;return q}),u(X,(q)=>{if(q.delete(K),q.size===0)C=`"${Q}"`;return q})},l=(Y,K,Q)=>{let{get:u,set:V}=Y,X=this.retrieve(x,K),s=u(X);for(let C of s){if(Q.includes(C))continue;let Xn=this.retrieve(x,C);V(Xn,(Un)=>{return Un.delete(K),Un})}V(X,(C)=>{return C.transaction((q)=>{q.clear();for(let Xn of Q){let Un=a(Y,Xn),Vi=Un.has(K);if(this.relations.cardinality==="1:n"){let _o=[];for(let O of Un){if(O===K)continue;let P=a(Y,O);if(P.delete(Xn),P.size===0)_o.push(O)}if(!Vi&&Un.size>0)Un.clear();for(let O of _o){let P=[Xn,O].sort(),Mn=`"${P[0]}:${P[1]}"`;this.molecules.delete(Mn)}}if(!Vi)Un.add(K);q.add(Xn)}return!0}),C})},$=(Y,K,Q)=>{let{set:u}=Y,V=this.retrieve(x,K);u(V,(X)=>{return X.transaction((s)=>{for(let C of Q)s.add(C);return!0}),X});for(let X of Q){let s=this.retrieve(x,X);u(s,(C)=>{return C.add(K),C})}return!0},v=(Y,K,Q)=>{let u=a(Y,K);return Q?u.has(Q):u.size>0},T={getRelatedKeys:(Y)=>a(this.toolkit,Y),addRelation:(Y,K)=>{m(this.toolkit,Y,K)},deleteRelation:(Y,K)=>{f(this.toolkit,Y,K)},replaceRelationsSafely:(Y,K)=>{l(this.toolkit,Y,K)},replaceRelationsUnsafely:(Y,K)=>{$(this.toolkit,Y,K)},has:(Y,K)=>v(this.toolkit,Y,K)},F,R,S;if(i){R=Zo(o,{key:`${n.key}/content`,default:i},["join","content"]),S=s0(o,{key:`${n.key}/content-molecules`,new:class V{key;constructor(X,s){this.key=s}}});let Y=({get:V},X)=>V(this.retrieve(R,X)),K=({set:V},X,s)=>{V(this.retrieve(R,X),s)},Q=(V,X)=>{let s=o.molecules.get(`"${X}"`);if(s)this.toolkit.dispose(s),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)=>{Q(this.toolkit,V)}})}else F=T;let M=new Bi(n,{externalStore:F,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...Y)=>{let K=Y.sort(),Q=`${K[0]}:${K[1]}`,[u,V]=K.map((X)=>this.molecules.get(g(X)));if(o.config.lifespan==="immortal"&&u&&V){let X=U(o),s=bo(X,[u,V],S,Q);this.molecules.set(`"${Q}"`,e(s,X))}return Q}}),G=()=>Po(o,{key:`${n.key}/singleRelatedKey`,get:(Y)=>({get:K})=>{let Q=this.retrieve(x,Y),u=K(Q);for(let V of u)return V;return null}},["join","keys"]),H=()=>{return Po(o,{key:`${n.key}/multipleRelatedKeys`,get:(Y)=>({get:K})=>{let Q=Wf(x,o),u=this.retrieve(Q,Y);return K(u).members}},["join","keys"])},B=()=>Po(o,{key:`${n.key}/singleRelatedEntry`,get:(Y)=>({get:K})=>{let Q=this.retrieve(x,Y),u=K(Q);for(let V of u){let X=M.isAType?.(Y)?Y:void 0,s=X===void 0?Y:void 0;X??=V,s??=V;let C=M.makeContentKey(X,s),q=this.retrieve(R,C),Xn=K(q);return[V,Xn]}return null}},["join","entries"]),k=()=>Po(o,{key:`${n.key}/multipleRelatedEntries`,get:(Y)=>({get:K})=>{let Q=Wf(x,o),u=this.retrieve(Q,Y);return K(u).members.map((X)=>{let s=M.isAType?.(Y)?Y:void 0,C=s===void 0?Y:void 0;s??=X,C??=X;let q=M.makeContentKey(s,C),Xn=this.retrieve(R,q),Un=K(Xn);return[X,Un]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let Y=G(),K=`${c}KeyOf${Ln(p)}`,Q=`${p}KeyOf${Ln(c)}`,u={[K]:Y,[Q]:Y},V;if(i){let X=B(),s=`${c}EntryOf${Ln(p)}`,C=`${p}EntryOf${Ln(c)}`,q={[s]:X,[C]:X};V=Object.assign(u,q)}else V=u;this.relations=M,this.states=V;break}case"1:n":{let Y=G(),K=H(),Q=`${c}KeyOf${Ln(p)}`,u=`${p}KeysOf${Ln(c)}`,V={[Q]:Y,[u]:K},X;if(i){let s=B(),C=k(),q=`${c}EntryOf${Ln(p)}`,Xn=`${p}EntriesOf${Ln(c)}`,Un={[q]:s,[Xn]:C};X=Object.assign(V,Un)}else X=V;this.relations=M,this.states=X;break}default:{let Y=H(),K=`${c}KeysOf${Ln(p)}`,Q=`${p}KeysOf${Ln(c)}`,u={[K]:Y,[Q]:Y},V;if(i){let X=k(),s=`${c}EntriesOf${Ln(p)}`,C=`${p}EntriesOf${Ln(c)}`,q={[s]:X,[C]:X};V=Object.assign(u,q)}else V=u;this.relations=M,this.states=V}}}}function wa(n,i,o=on.STORE){return Rf(o).set(n.key,new Kf(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function Rf(n){if("joins"in n&&n.joins instanceof Map)return n.joins;let i=new Map;return n.joins=i,i}function $x(n,i){let o=Rf(i),c=o.get(n.key);if(c===void 0){if(c=Rf(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 ip(n,i,o){let c=$x(n,o),p;switch(n.cardinality){case"1:1":{let x=`${n.a}KeyOf${Ln(n.b)}`,a=`${n.b}KeyOf${Ln(n.a)}`;p={get[x](){let f=c.states[x];return c.retrieve(f,i)},get[a](){let f=c.states[a];return c.retrieve(f,i)}};let m=`${n.a}EntryOf${Ln(n.b)}`;if(m in c.states){let f=`${n.b}EntryOf${Ln(n.a)}`;Object.assign(p,{get[m](){let l=c.states[m];return c.retrieve(l,i)},get[f](){let l=c.states[f];return c.retrieve(l,i)}})}break}case"1:n":{let x=`${n.a}KeyOf${Ln(n.b)}`,a=`${n.b}KeysOf${Ln(n.a)}`;p={get[x](){let f=c.states[x];return c.retrieve(f,i)},get[a](){let f=c.states[a];return c.retrieve(f,i)}};let m=`${n.a}EntryOf${Ln(n.b)}`;if(m in c.states){let f=`${n.b}EntriesOf${Ln(n.a)}`;Object.assign(p,{get[m](){let l=c.states[m];return c.retrieve(l,i)},get[f](){let l=c.states[f];return c.retrieve(l,i)}})}break}case"n:n":{let x=`${n.a}KeysOf${Ln(n.b)}`,a=`${n.b}KeysOf${Ln(n.a)}`;p={get[x](){let f=c.states[x];return c.retrieve(f,i)},get[a](){let f=c.states[a];return c.retrieve(f,i)}};let m=`${n.a}EntriesOf${Ln(n.b)}`;if(m in c.states){let f=`${n.b}EntriesOf${Ln(n.a)}`;Object.assign(p,{get[m](){let l=c.states[m];return c.retrieve(l,i)},get[f](){let l=c.states[f];return c.retrieve(l,i)}})}}}return p}function Z0(n,i){return ip(n,i,on.STORE)}function Wc(n,i,o){let c=$x(n,o),p=U(o);if(wn(p)){let{toolkit:x}=p.transactionMeta;c.transact(x,({relations:a})=>{i(a)})}else i(c.relations)}function p8(n,i){return $x(n,i).core.findRelatedKeysState}function q0(n){return p8(n,on.STORE)}function Aa(n){return{store:n}}function An(n,...i){let o,c,p;if(i.length===1){if(o=i[0],o.type!=="molecule"){if(c=Ta(n,o)??null,c)p=o.family?ii(o.family.subKey):null,o=Tn(n,c,p)}}else{c=i[0],p=i[1];let x;if(c.type==="molecule_family")x=jn(n,c,p)??ec(c,p);else x=Tn(n,c,p);o=x}if("counterfeit"in o&&"family"in o){c=o.type==="molecule"?e(o.family,n):n.families.get(o.family.key);let x=o.type==="molecule"?o.key:o.family.subKey,a=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}".`,a?`This state was previously disposed:
49
- ${a.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=e(c,n).default(x);return n.defaults.set(c.key,m),m}case"molecule_family":throw new _i(c,x,n)}}switch(o.type){case"atom":case"mutable_atom":case"selector":case"readonly_selector":return ro(e(o,n),n);case"molecule":return e(o,n).instance}}class op{key;type="molecule";stringKey;family;_dependsOn;get dependsOn(){if(this.family)return this.family.dependsOn;return this._dependsOn}subject=new an;tokens=new Map;above=new Map;below=new Map;joins=new Map;instance;constructor(n,i,o){this.key=i;if(this.stringKey=g(i),o)this.family=o,this._dependsOn=o.dependsOn;if(n)for(let c of n)this.above.set(c.stringKey,c)}}function P0(n){return n[0].toUpperCase()+n.slice(1)}function bo(n,i,o,c,...p){let x=V0(n),a=U(n),m=g(c);a.moleculeInProgress=m;let f=Array.isArray(i)?i:[i],l=f.map((M)=>{if(M instanceof op)return M;let G=g(M.key),H=n.molecules.get(G);if(!H)throw new Error(`Molecule ${G} not found in store "${n.config.name}"`);return H}),$=new op(l,c,o);a.molecules.set(m,$);for(let M of l)M.below.set($.stringKey,$);let v={get:(...M)=>An(U(x),...M),set:(...M)=>{Yn(U(x),...M)},seek:(M,G)=>jn(U(x),M,G),json:(M)=>sn(U(x),M),run:(M,G=dc())=>to(M,G,U(n)),make:(M,G,H,...B)=>bo(U(x),M,G,H,...B),dispose:(M)=>{Hi(U(x),M)},env:()=>Aa(U(x)),bond:(M,G)=>{if(M.type==="join"){let{as:H}=G,B=$x(M,x);B.molecules.set(m,$),$.joins.set(M.key,B);let k=T.subject.subscribe(`join:${M.key}-${m}`,(X)=>{if(X.type==="molecule_disposal"){if(g(X.token.key)===m)k(),B.molecules.delete(m)}});if(H===null)return;let Y=M.a===H?M.b:M.a,K=Z0(M,c),Q=K[`${Y}KeysOf${P0(H)}`],u=K[`${Y}EntriesOf${P0(H)}`],V={relatedKeys:Q};if(u)V=Object.assign(V,{relatedEntries:u});return V}return mo($,e(M,x),U(x))},claim:(M,G)=>{let{exclusive:H}=G,B=U(n).molecules.get(g(M.key));if(B)if(H){for(let k of B.above.values())k.below.delete(B.stringKey);B.above.clear(),B.above.set($.stringKey,$),$.below.set(B.stringKey,B)}else B.above.set($.stringKey,$),$.below.set(B.stringKey,B)},spawn:(M,G,...H)=>bo(U(n),[$],e(M,n),G,...H)},T=e(o,n),F=T.new;$.instance=new F(v,c,...p);let R={type:"molecule",key:c,family:o},S={type:"molecule_creation",subType:"classic",token:R,family:o,context:f,params:p};if(Zn(a))T.subject.next(S);else if(wn(a)&&a.on.transactionApplying.state===null)a.transactionMeta.update.updates.push(S);return a.moleculeInProgress=null,R}function Gf(n,i,o){switch(i){case"newValue":{t0(n,o);break}case"oldValue":{Hi(o,n.token);break}}}function Yf(n,i,o){switch(i){case"newValue":{Hi(o,n.token);break}case"oldValue":{t0(n,o),o.valueMap.set(n.token.key,n.value);break}}}function t0(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)Tn(i,c,ii(o.subKey))}}function zf(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":Xf(o,n.provenance,n.key);break}break;case"oldValue":switch(n.subType){case"classic":Hi(o,n.token);break;case"modern":vx(o,n.key);break}break}}function Hf(n,i,o){switch(i){case"newValue":switch(n.subType){case"classic":Hi(o,n.token);break;case"modern":vx(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,x]of n.values){let a=`${p}(${g(c.key)})`,m=e(c,o),f=m.tokens.has(a),l=o.families.get(p);if(l&&!f)mo(m,l,o);o.valueMap.set(a,x)}}break;case"modern":{Xf(o,n.provenance,n.key);for(let[c,p]of n.values){let x=o.families.get(c);if(x){Tn(o,x,n.key);let a=`${c}(${g(n.key)})`;o.valueMap.set(a,p)}}}}break}}function Sa(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":Ja(n,p,o);break;case"state_creation":Gf(p,n,o);break;case"state_disposal":Yf(p,n,o);break;case"molecule_creation":zf(p,n,o);break;case"molecule_disposal":Hf(p,n,o);break;case"transaction_update":Sa(n,p,o);break}}function r0(n,i,o){if(Zn(o)&&n)o.transactionMeta.epoch.set(n,i)}function g0(n,i,o){if(!Zn(o))return;let p=o.transactionMeta.actionContinuities.getRelatedKey(n);if(p!==void 0)o.transactionMeta.epoch.set(p,i)}var d0=(n,i)=>{let o=U(i),{parent:c}=o;if(c===null||!wn(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),Sa("newValue",o.transactionMeta.update,c),Zn(c))g0(o.transactionMeta.update.key,o.transactionMeta.update.epoch,c),e({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(wn(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function e0(n,i,o){if(!Zn(o))return;let{epoch:p,actionContinuities:x}=o.transactionMeta;if(x.set(n,i),!p.has(n))p.set(n,-1)}class qi extends Map{source;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 nv=(n,i,o,c)=>{let p=U(o),x={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new qi(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new qi(p.families),operation:{open:!1},readonlySelectors:new qi(p.readonlySelectors),timelines:new qi(p.timelines),timelineTopics:new Bi(p.timelineTopics.toJSON()),trackers:new Map,transactions:new qi(p.transactions),selectorAtoms:new Bi(p.selectorAtoms.toJSON()),selectorGraph:new Bi(p.selectorGraph.toJSON(),{makeContentKey:(...l)=>l.sort().join(":")}),selectors:new qi(p.selectors),valueMap:new qi(p.valueMap),defaults:p.defaults,disposalTraces:o.disposalTraces.copy(),molecules:new qi(p.molecules),moleculeFamilies:new qi(p.moleculeFamilies),moleculeInProgress:p.moleculeInProgress,miscResources:new qi(p.miscResources)},a=iv(n,o),m={phase:"building",update:{type:"transaction_update",key:n,id:c,epoch:a===void 0?Number.NaN:a+1,updates:[],params:i,output:void 0},toolkit:{get:(...l)=>An(f,...l),set:(...l)=>{Yn(f,...l)},run:(l,$=dc())=>to(l,$,f),find:(l,$)=>Tn(f,l,$),seek:(l,$)=>jn(f,l,$),json:(l)=>sn(f,l),make:(l,$,v,...T)=>bo(f,l,$,v,...T),dispose:(...l)=>{Hi(f,...l)},env:()=>Aa(f)}},f=Object.assign(x,{transactionMeta:m});return p.child=f,o.logger.info("\uD83D\uDEEB","transaction",n,"Building transaction with params:",i),f};function Qf(n,i){let o={key:n.key,type:"transaction",run:(x,a)=>{let m=nv(n.key,x,i,a);try{let f=U(i),{toolkit:l}=m.transactionMeta,$=n.do(l,...x);return d0($,f),$}catch(f){throw u0(c),i.logger.warn("\uD83D\uDCA5","transaction",n.key,"caught:",f),f}},install:(x)=>Qf(n,x),subject:new an},c=U(i);c.transactions.set(o.key,o);let p=si(o);return i.on.transactionCreation.next(p),p}function iv(n,i){let o=Zn(i),c=o?i.transactionMeta.actionContinuities.getRelatedKey(n):void 0;return o&&c!==void 0?i.transactionMeta.epoch.get(c):void 0}class Fa{_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 Fa([...this._buffer]);return n._index=this._index,n}}class ov{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new Bi({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new Bi({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 Bi({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new Bi({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new Fa(100);molecules=new Map;moleculeFamilies=new Map;moleculeInProgress=null;miscResources=new Map;on={atomCreation:new an,atomDisposal:new an,selectorCreation:new an,selectorDisposal:new an,timelineCreation:new an,transactionCreation:new an,transactionApplying:new Sf(null),operationClose:new an,moleculeCreationStart:new an,moleculeCreationDone:new an,moleculeDisposal:new an};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Kc("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},Zn(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new Bi(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=sn(i,c),x=jo(c);o.add(p.key),o.add(x.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 ov({name:"IMPLICIT_STORE",lifespan:"ephemeral"});return globalThis.ATOM_IO_IMPLICIT_STORE}};function e(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(g(n.key));break;case"molecule_family":o=c.moleculeFamilies.get(n.key);break}if(o)return o;c=c.child}throw new _i(n,i)}function Ma(n,i){let o;o=e(n,i);let{family:c}=n;for(let a of o.joins.values())a.relations.delete(o.key),a.molecules.delete(o.stringKey);let p=[];for(let a of o.above.values())p.push(si(a));let x=[];for(let a of o.tokens.values()){let m=a.family;x.push([m.key,i.valueMap.get(a.key)])}if(c){let a=e(c,i),m={type:"molecule_disposal",subType:"classic",token:n,family:c,context:p,values:x};if(n.family)m.family=n.family;for(let l of o.tokens.values())Hi(i,l);for(let l of o.below.values())if(l.dependsOn==="all")Ma(l,i);else if(l.above.delete(o.stringKey),l.above.size===0)Ma(l,i);if(o.below.clear(),wn(i)&&i.transactionMeta.phase==="building")i.transactionMeta.update.updates.push(m);else a.subject.next(m);i.molecules.delete(o.stringKey)}for(let a of o.above.values())a.below.delete(o.stringKey)}function uo(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new _i(i,n);let p=c(o),x=U(n);if(p.family&&x.moleculeInProgress===null){if(Zn(x))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(wn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function jn(n,i,o){let c=g(o),p=`${i.key}(${c})`,x=U(n),a;switch(i.type){case"atom_family":case"mutable_atom_family":a=x.atoms.get(p);break;case"selector_family":a=x.selectors.get(p);break;case"readonly_selector_family":a=x.readonlySelectors.get(p);break;case"molecule_family":a=x.molecules.get(g(o))}if(a)return si(a);return a}function Tn(n,i,o){let c=jn(n,i,o);if(c)return c;let p=n.molecules.get(g(o));if(p)return mo(p,i,n);if(n.config.lifespan==="immortal"){let x=ec(i,o);return n.logger.error("\u274C",x.type,x.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),x}return c=uo(n,i,o),c}function Hi(n,...i){let o,c;if(i.length===1)o=i[0],c=o.key;else{let x=i[0],a=i[1];o=x.type==="molecule_family"?jn(n,x,a)??ec(x,a):Tn(n,x,a)}try{e(o,n)}catch(x){let a=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}".`,a?`
47
+ `+c)}n.destroy()}var yx=[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 g7(n){if(n+="",n.length<1)return!1;if(!yx[n.charCodeAt(0)])return ln('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!yx[n.charCodeAt(1)])return ln('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!yx[n.charCodeAt(2)])return ln('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!yx[n.charCodeAt(3)])return ln('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!yx[n.charCodeAt(i)])return ln('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var WF=h((MF)=>{Object.defineProperty(MF,"__esModule",{value:!0});MF.Polling=void 0;var e7=bc(),SF=import.meta.require("zlib"),nX=Aa(),iX=ai(),io=iX.default("engine:polling"),oX={gzip:SF.createGzip,deflate:SF.createDeflate};class FF extends e7.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,x=0,m={"Content-Type":"text/html"};this.headers(n,m);for(let f in m)i.writeHeader(f,String(m[f]));let a=(f)=>{this.onData(f.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((f,l)=>{let $=x+f.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(l){a(Buffer.from(f));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(f).copy(p,x),l){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}a(p);return}x=$})}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",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(l)=>{this.headers(this.req,x),this.res.cork(()=>{Object.keys(x).forEach(($)=>{this.res.writeHeader($,String(x[$]))}),this.res.end(l)}),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=nX(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(l,$)=>{if(l){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(l);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){io("compressing");let c=[],p=0;oX[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.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}}MF.Polling=FF});var zF=h((GF)=>{Object.defineProperty(GF,"__esModule",{value:!0});GF.WebSocket=void 0;var cX=bc(),pX=ai(),KF=pX.default("engine:ws");class XF extends cX.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=(x)=>{let m=typeof x!=="string",a=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(KF('writing "%s"',x),this.socket.send(x,m,a),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){KF("closing"),n&&n(),this.socket.end()}}GF.WebSocket=XF});var QF=h((HF)=>{Object.defineProperty(HF,"__esModule",{value:!0});var xX=WF(),mX=zF();HF.default={polling:xX.Polling,websocket:mX.WebSocket}});var _F=h((UF)=>{Object.defineProperty(UF,"__esModule",{value:!0});UF.uServer=void 0;var fX=ai(),jc=l$(),lX=QF(),Tc=fX.default("engine:uws");class OF extends jc.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(()=>{Tc("response has been aborted")})}createTransport(n,i){return new lX.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,x)=>{c.getUserData().transport.onData(x?p:Buffer.from(p).toString())},close:(c,p,x)=>{c.getUserData().transport.onClose(p,x)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new EF(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){Tc('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:jc.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)Tc("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let x=(m,a)=>this.abortRequest(n,m,a);this.handshake(i._query.transport,i,x)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(jc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){Tc("on upgrade"),this.prepare(i,n),i.res=n;let c=async(p,x)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:jc.Server.errorMessages[p],context:x}),this.abortRequest(n,p,x);return}let m=i._query.sid,a;if(m){let f=this.clients[m];if(!f)return Tc("upgrade attempt for closed client"),n.close();else if(f.upgrading)return Tc("transport has already been trying to upgrade"),n.close();else if(f.upgraded)return Tc("transport had already been upgraded"),n.close();else Tc("upgrading existing transport"),a=this.createTransport(i._query.transport,i),f._maybeUpgrade(a)}else if(a=await this.handshake(i._query.transport,i,(f,l)=>this.abortRequest(n,f,l)),!a)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:a},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(jc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===jc.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:jc.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}UF.uServer=OF;class EF{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 yF=h((Op)=>{Object.defineProperty(Op,"__esModule",{value:!0});Op.protocol=Op.Transport=Op.Socket=Op.uServer=Op.parser=Op.transports=Op.Server=void 0;Op.listen=AX;Op.attach=jF;var $X=import.meta.require("http"),uF=l$();Object.defineProperty(Op,"Server",{enumerable:!0,get:function(){return uF.Server}});var vX=x$();Op.transports=vX.default;var bF=Bx();Op.parser=bF;var TX=_F();Object.defineProperty(Op,"uServer",{enumerable:!0,get:function(){return TX.uServer}});var JX=m$();Object.defineProperty(Op,"Socket",{enumerable:!0,get:function(){return JX.Socket}});var wX=bc();Object.defineProperty(Op,"Transport",{enumerable:!0,get:function(){return wX.Transport}});Op.protocol=bF.protocol;function AX(n,i,o){if(typeof i==="function")o=i,i={};let c=$X.createServer(function(x,m){m.writeHead(501),m.end("Not Implemented")}),p=jF(c,i);return p.httpServer=c,c.listen(n,o),p}function jF(n,i){let o=new uF.Server(i);return o.attach(n,i),o}});var LF=h((KX)=>{KX.Emitter=Oi;function Oi(n){if(n)return WX(n)}function WX(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 $$=h((CF)=>{Object.defineProperty(CF,"__esModule",{value:!0});CF.hasBinary=CF.isBinary=void 0;var GX=typeof ArrayBuffer==="function",YX=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},NF=Object.prototype.toString,zX=typeof Blob==="function"||typeof Blob!=="undefined"&&NF.call(Blob)==="[object BlobConstructor]",HX=typeof File==="function"||typeof File!=="undefined"&&NF.call(File)==="[object FileConstructor]";function DF(n){return GX&&(n instanceof ArrayBuffer||YX(n))||zX&&n instanceof Blob||HX&&n instanceof File}CF.isBinary=DF;function Ua(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Ua(n[o]))return!0;return!1}if(DF(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Ua(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Ua(n[o]))return!0;return!1}CF.hasBinary=Ua});var sF=h((IF)=>{Object.defineProperty(IF,"__esModule",{value:!0});IF.reconstructPacket=IF.deconstructPacket=void 0;var OX=$$();function EX(n){let i=[],o=n.data,c=n;return c.data=v$(o,i),c.attachments=i.length,{packet:c,buffers:i}}IF.deconstructPacket=EX;function v$(n,i){if(!n)return n;if(OX.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]=v$(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]=v$(n[c],i);return o}return n}function UX(n,i){return n.data=T$(n.data,i),delete n.attachments,n}IF.reconstructPacket=UX;function T$(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]=T$(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=T$(n[o],i)}return n}});var Nx=h((dF)=>{Object.defineProperty(dF,"__esModule",{value:!0});dF.Decoder=dF.Encoder=dF.PacketType=dF.protocol=void 0;var _X=LF(),PF=sF(),tF=$$(),uX=ai(),J$=uX.default("socket.io-parser"),bX=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];dF.protocol=5;var kn;(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"})(kn=dF.PacketType||(dF.PacketType={}));class rF{constructor(n){this.replacer=n}encode(n){if(J$("encoding packet %j",n),n.type===kn.EVENT||n.type===kn.ACK){if(tF.hasBinary(n))return this.encodeAsBinary({type:n.type===kn.EVENT?kn.BINARY_EVENT:kn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===kn.BINARY_EVENT||n.type===kn.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 J$("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=PF.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}dF.Encoder=rF;function ZF(n){return Object.prototype.toString.call(n)==="[object Object]"}class w$ extends _X.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===kn.BINARY_EVENT;if(o||i.type===kn.BINARY_ACK){if(i.type=o?kn.EVENT:kn.ACK,this.reconstructor=new gF(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(tF.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(kn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===kn.BINARY_EVENT||o.type===kn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let x=n.substring(p,i);if(x!=Number(x)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(x)}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 x=n.charAt(i);if(x==null||Number(x)!=x){--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(w$.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return J$("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 kn.CONNECT:return ZF(i);case kn.DISCONNECT:return i===void 0;case kn.CONNECT_ERROR:return typeof i==="string"||ZF(i);case kn.EVENT:case kn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&bX.indexOf(i[0])===-1);case kn.ACK:case kn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}dF.Decoder=w$;class gF{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=PF.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var cM=h((iM)=>{Object.defineProperty(iM,"__esModule",{value:!0});iM.Client=void 0;var Va=Nx(),yX=ai(),LX=import.meta.require("url"),Ao=yX("socket.io:client");class nM{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:Va.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=LX.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===Va.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==Va.PacketType.CONNECT&&n.type!==Va.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}}iM.Client=nM});var _a=h((xM)=>{Object.defineProperty(xM,"__esModule",{value:!0});xM.StrictEventEmitter=void 0;var NX=import.meta.require("events");class pM extends NX.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)}}xM.StrictEventEmitter=pM});var A$=h((aM)=>{Object.defineProperty(aM,"__esModule",{value:!0});aM.RESERVED_EVENTS=void 0;aM.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var F$=h((lM)=>{Object.defineProperty(lM,"__esModule",{value:!0});lM.RemoteSocket=lM.BroadcastOperator=void 0;var DX=A$(),CX=Nx();class Do{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 Do(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 Do(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new Do(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new Do(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new Do(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new Do(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(DX.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:CX.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 x=o.pop(),m=!1,a=[],f=setTimeout(()=>{m=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:a])},this.flags.timeout),l=-1,$=0,v=0,T=()=>{if(!m&&l===$&&a.length===v)clearTimeout(f),x.apply(this,[null,this.flags.expectSingleResponse?a[0]:a])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(F)=>{v+=F,$++,T()},(F)=>{a.push(F),T()}),this.adapter.serverCount().then((F)=>{l=F,T()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),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 S$(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)}}lM.BroadcastOperator=Do;class S${constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new Do(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}}lM.RemoteSocket=S$});var M$=h((Ep)=>{var JM=Ep&&Ep.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Socket=void 0;var oo=Nx(),IX=JM(ai()),kX=_a(),vM=JM(kl()),sX=F$(),ZX=A$(),Ki=IX.default("socket.io:socket"),qX=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function TM(){}class wM extends kX.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=vM.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=vM.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",TM)}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(ZX.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 x=this.nsp._ids++;Ki("emitting packet with ack id %d",x),this.registerAckCallback(x,o.pop()),c.id=x}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((x,m)=>{if(o)return x?p(x):c(m);else return c(x)}),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(()=>{Ki("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 Ki("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Ki("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Ki("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(Ki("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(Ki("emitting event %j",i),n.id!=null)Ki("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);Ki("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")Ki("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Ki("bad ack %s",n.id)}ondisconnect(){Ki("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Ki("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&qX.has(n))Ki("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=TM}_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){Ki("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 Ki("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,(x)=>{if(x)return i(x);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 sX.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Ep.Socket=wM});var R$=h((Co)=>{var PX=Co&&Co.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Co,"__esModule",{value:!0});Co.Namespace=Co.RESERVED_EVENTS=void 0;var AM=M$(),tX=_a(),rX=PX(ai()),hi=F$(),Dx=rX.default("socket.io:namespace");Co.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class SM extends tX.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,(x)=>{if(x)return i(x);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;Dx("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,(x)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Dx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Dx("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(x.data||x.message);else return p._error({message:x.message,data:x.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(x){Dx("error while restoring session: %s",x)}if(p)return Dx("connection state recovered for sid %s",p.sid),new AM.Socket(this,n,i,p)}return new AM.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(Co.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,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),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)}}Co.Namespace=SM});var GM=h((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});KM.yeast=KM.decode=KM.encode=void 0;var RM="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),ua=64,WM={},FM=0,Jc=0,MM;function W$(n){let i="";do i=RM[n%ua]+i,n=Math.floor(n/ua);while(n>0);return i}KM.encode=W$;function gX(n){let i=0;for(Jc=0;Jc<n.length;Jc++)i=i*ua+WM[n.charAt(Jc)];return i}KM.decode=gX;function dX(){let n=W$(+new Date);if(n!==MM)return FM=0,MM=n;return n+"."+W$(FM++)}KM.yeast=dX;for(;Jc<ua;Jc++)WM[RM[Jc]]=Jc});var G$=h((zM)=>{var K$;Object.defineProperty(zM,"__esModule",{value:!0});zM.SessionAwareAdapter=zM.Adapter=void 0;var i5=import.meta.require("events"),o5=GM(),ba=import.meta.require("ws"),c5=typeof((K$=ba===null||ba===void 0?void 0:ba.Sender)===null||K$===void 0?void 0:K$.frame)==="function";class X$ extends i5.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,(x)=>{if(typeof x.notifyOutgoingListeners==="function")x.notifyOutgoingListeners(n);x.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let m=this._encode(n,x),a=0;this.apply(i,(f)=>{if(a++,f.acks.set(n.id,c),typeof f.notifyOutgoingListeners==="function")f.notifyOutgoingListeners(n);f.client.writeToEngine(m,x)}),o(a)}_encode(n,i){let o=this.encoder.encode(n);if(c5&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=ba.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 x of o){if(!this.rooms.has(x))continue;for(let m of this.rooms.get(x)){if(p.has(m)||c.has(m))continue;let a=this.nsp.sockets.get(m);if(a)i(a),p.add(m)}}}else for(let[p]of this.sids){if(c.has(p))continue;let x=this.nsp.sockets.get(p);if(x)i(x)}}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}}zM.Adapter=X$;class YM extends X${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 x=[];for(let m=p+1;m<this.packets.length;m++){let a=this.packets[m];if(p5(o.rooms,a.opts))x.push(a.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:x}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,x=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&x){let m=o5.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}zM.SessionAwareAdapter=YM;function p5(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 OM=h((So)=>{var m5=So&&So.__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(So,"__esModule",{value:!0});So.ClusterAdapterWithHeartbeat=So.ClusterAdapter=So.MessageType=void 0;var a5=G$(),f5=ai(),l5=import.meta.require("crypto"),Pn=f5.debug("socket.io-adapter"),$5="emitter",ja=5000;function Vp(){return l5.randomBytes(8).toString("hex")}var xn;(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"})(xn=So.MessageType||(So.MessageType={}));function Bc(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 Y$ extends a5.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Vp()}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 xn.BROADCAST:{if(n.data.requestId!==void 0)super.broadcastWithAck(n.data.packet,Up(n.data.opts),(c)=>{Pn("[%s] waiting for %d client acknowledgements",this.uid,c),this.publishResponse(n.uid,{type:xn.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:xn.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 xn.SOCKETS_JOIN:super.addSockets(Up(n.data.opts),n.data.rooms);break;case xn.SOCKETS_LEAVE:super.delSockets(Up(n.data.opts),n.data.rooms);break;case xn.DISCONNECT_SOCKETS:super.disconnectSockets(Up(n.data.opts),n.data.close);break;case xn.FETCH_SOCKETS:{Pn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(Up(n.data.opts)).then((o)=>{this.publishResponse(n.uid,{type:xn.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:x}=p,m=m5(p,["sessionStore"]);return{id:c.id,handshake:m,rooms:[...c.rooms],data:c.data}})}})});break}case xn.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,x=(m)=>{if(p)return;p=!0,Pn("[%s] calling acknowledgement with %j",this.uid,m),this.publishResponse(n.uid,{type:xn.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:m}})};this.nsp._onServerSideEmit([...o,x]);break}case xn.BROADCAST_CLIENT_COUNT:case xn.BROADCAST_ACK:case xn.FETCH_SOCKETS_RESPONSE:case xn.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 xn.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case xn.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case xn.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((x)=>p.responses.push(x)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case xn.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:xn.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,x=n.id===void 0,m=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&x&&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=Vp();this.ackRequests.set(m,{clientCountCallback:o,ack:c}),this.publish({type:xn.BROADCAST,data:{packet:n,requestId:m,opts:Bc(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:xn.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:xn.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:xn.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 x=Vp();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.requests.get(x);if($)a(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(x)},n.flags.timeout||ja),l={type:xn.FETCH_SOCKETS,resolve:m,timeout:f,current:0,expected:p,responses:o};this.requests.set(x,l),this.publish({type:xn.FETCH_SOCKETS,data:{opts:Bc(n),requestId:x}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:xn.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=Vp(),x=setTimeout(()=>{let a=this.requests.get(p);if(a)o(new Error(`timeout reached: only ${a.current} responses received out of ${a.expected}`),a.responses),this.requests.delete(p)},ja),m={type:xn.SERVER_SIDE_EMIT,resolve:o,timeout:x,current:0,expected:c,responses:[]};this.requests.set(p,m),this.publish({type:xn.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)})}}So.ClusterAdapter=Y$;class QM extends Y${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:xn.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:xn.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:xn.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!==$5)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 xn.INITIAL_HEARTBEAT:this.publish({type:xn.HEARTBEAT});break;case xn.HEARTBEAT:break;case xn.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:xn.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=Vp(),x=setTimeout(()=>{let a=this.customRequests.get(p);if(a)o(new Error(`timeout reached: missing ${a.missingUids.size} responses`),a.responses),this.customRequests.delete(p)},ja),m={type:xn.SERVER_SIDE_EMIT,resolve:o,timeout:x,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,m),this.publish({type:xn.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 x=Vp();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.customRequests.get(x);if($)a(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||ja),l={type:xn.FETCH_SOCKETS,resolve:m,timeout:f,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,l),this.publish({type:xn.FETCH_SOCKETS,data:{opts:Bc(n),requestId:x}})})}onResponse(n){let i=n.data.requestId;switch(Pn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case xn.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 xn.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===xn.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===xn.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}So.ClusterAdapterWithHeartbeat=QM});var Ba=h((yc)=>{Object.defineProperty(yc,"__esModule",{value:!0});yc.MessageType=yc.ClusterAdapterWithHeartbeat=yc.ClusterAdapter=yc.SessionAwareAdapter=yc.Adapter=void 0;var EM=G$();Object.defineProperty(yc,"Adapter",{enumerable:!0,get:function(){return EM.Adapter}});Object.defineProperty(yc,"SessionAwareAdapter",{enumerable:!0,get:function(){return EM.SessionAwareAdapter}});var z$=OM();Object.defineProperty(yc,"ClusterAdapter",{enumerable:!0,get:function(){return z$.ClusterAdapter}});Object.defineProperty(yc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return z$.ClusterAdapterWithHeartbeat}});Object.defineProperty(yc,"MessageType",{enumerable:!0,get:function(){return z$.MessageType}})});var uM=h((_p)=>{var T5=_p&&_p.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(_p,"__esModule",{value:!0});_p.ParentNamespace=void 0;var UM=R$(),J5=Ba(),w5=T5(ai()),VM=w5.default("socket.io:parent-namespace");class ya extends UM.Namespace{constructor(n){super(n,"/_"+ya.count++);this.children=new Set}_initAdapter(){this.adapter=new _M(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){VM("creating child namespace %s",n);let i=new UM.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)VM("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")}}_p.ParentNamespace=ya;ya.count=0;class _M extends J5.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var NM=h((Nc)=>{var A5=Nc&&Nc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Nc,"__esModule",{value:!0});Nc.patchAdapter=F5;Nc.restoreAdapter=M5;Nc.serveFile=W5;var Lc=Ba(),bM=import.meta.require("fs"),S5=A5(ai()),La=S5.default("socket.io:adapter-uws"),H$="\x1F",{addAll:BM,del:yM,broadcast:LM}=Lc.Adapter.prototype;function F5(n){Lc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);BM.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"){jM(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)jM(this.nsp.name,p,c,x)})},Lc.Adapter.prototype.del=function(i,o){yM.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,x=c.conn.transport.socket,m=`${this.nsp.name}${H$}${o}`;La("unsubscribe connection %s from topic %s",p,m),x.unsubscribe(m)}},Lc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){LM.call(this,i,o);return}let p=o.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let m=this.encoder.encode(i),a=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${H$}${o.rooms.keys().next().value}`;La("fast publish to %s",a),m.forEach((f)=>{let l=typeof f!=="string";n.publish(a,l?f:"4"+f,l)}),this.apply(o,(f)=>{if(f.conn.transport.name!=="websocket")f.client.writeToEngine(m,x)})}}function jM(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)La("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((m)=>{let a=`${n}${H$}${m}`;La("subscribe connection %s to topic %s",p,a),x.subscribe(a)})}function M5(){Lc.Adapter.prototype.addAll=BM,Lc.Adapter.prototype.del=yM,Lc.Adapter.prototype.broadcast=LM}var R5=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function W5(n,i){let{size:o}=bM.statSync(i),c=bM.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(a)=>{throw p(),a},m=(a)=>{let f=R5(a);n.cork(()=>{let l=n.getWriteOffset(),[$,v]=n.tryEnd(f,o);if(!v&&!$)c.pause(),n.onWritable((T)=>{let[F,R]=n.tryEnd(f.slice(T-l),o);if(!R&&F)c.resume();return F})})};n.onAborted(p),c.on("data",m).on("error",x).on("end",p)}});var DM=h((wN,K5)=>{K5.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 tM=h((Xi,Cx)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",X5=Xi&&Xi.__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]}),G5=Xi&&Xi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),Y5=Xi&&Xi.__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))X5(i,n,o)}return G5(i,n),i},qM=Xi&&Xi.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Namespace=Xi.Socket=Xi.Server=void 0;var z5=import.meta.require("http"),H5=import.meta.require("fs"),Q$=import.meta.require("zlib"),Q5=Aa(),Na=import.meta.require("stream"),CM=import.meta.require("path"),hM=yF(),O5=cM(),IM=import.meta.require("events"),E$=R$();Object.defineProperty(Xi,"Namespace",{enumerable:!0,get:function(){return E$.Namespace}});var E5=uM(),kM=Ba(),U5=Y5(Nx()),V5=qM(ai()),PM=M$();Object.defineProperty(Xi,"Socket",{enumerable:!0,get:function(){return PM.Socket}});var _5=_a(),O$=NM(),u5=qM(f$()),ji=V5.default("socket.io:server"),sM=DM().version,ZM=/\.map/;class up extends _5.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||U5,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||kM.SessionAwareAdapter);else this.adapter(i.adapter||kM.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=u5.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 x=c.next();if(x.done)return o(!1);x.value(n,i,(m,a)=>{if(m||!a)return p();if(this._nsps.has(n))return ji("dynamic namespace %s already exists",n),o(this._nsps.get(n));let f=this.parentNsps.get(x.value).createChild(n);ji("dynamic namespace %s was created",n),o(f)})};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"){ji("creating http server and binding to %d",n);let o=n;n=z5.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,ji("creating uWebSockets.js-based engine with opts %j",i);let o=new hM.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 x=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),m=ZM.test(x),a=m?"map":"source",f='"'+sM+'"',l="W/"+f,$=p.getHeader("if-none-match");if($){if(f===$||l===$){ji("serve client %s 304",a),c.writeStatus("304 Not Modified"),c.end();return}}ji("serve client %s",a),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",f);let v=CM.join(__dirname,"../client-dist/",x);O$.serveFile(c,v)});O$.patchAdapter(n)}initEngine(n,i){if(ji("creating engine.io instance with opts %j",i),this.eio=hM.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){ji("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=ZM.test(o),p=c?"map":"source",x='"'+sM+'"',m="W/"+x,a=n.headers["if-none-match"];if(a){if(x===a||m===a){ji("serve client %s 304",p),i.writeHead(304),i.end();return}}ji("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",x),up.sendFile(o,n,i)}static sendFile(n,i,o){let c=H5.createReadStream(CM.join(__dirname,"../client-dist/",n)),p=Q5(i).encodings(["br","gzip","deflate"]),x=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),Na.pipeline(c,Q$.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),Na.pipeline(c,Q$.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),Na.pipeline(c,Q$.createDeflate(),o,x);break;default:o.writeHead(200),Na.pipeline(c,o,x)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){ji("incoming connection with id %s",n.id);let i=new O5.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new E5.ParentNamespace(this);if(ji("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,x,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 ji("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(ji("initializing namespace %s",n),o=new E$.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(),O$.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)}}Xi.Server=up;var b5=Object.keys(IM.EventEmitter.prototype).filter(function(n){return typeof IM.EventEmitter.prototype[n]==="function"});b5.forEach(function(n){up.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});Cx.exports=(n,i)=>new up(n,i);Cx.exports.Server=up;Cx.exports.Namespace=E$.Namespace;Cx.exports.Socket=PM.Socket});import{createHash as i4}from"crypto";import{createServer as rG}from"http";import{createServer as gG}from"https";function ec(n=Math.random){return n().toString(36).slice(2)}class xx 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 V0(n){return Object.entries(n)}var _0=(n,i,o=on.STORE)=>{return mx(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 u0(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 Mf extends mn{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function qo(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new mn,a=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F=i.default,R={key:v,default:F instanceof Function?F(f):F};if(i.effects)R.effects=i.effects(f);let S=Po(T,R,$);return x.next({type:"state_creation",token:S}),S},c,{subject:x,install:(f)=>qo(f,i),internalRoles:o});return n.families.set(i.key,a),n.defaults.set(i.key,i.default),c}function b0(n,i){if("mutable"in i)return ax(n,i);return qo(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new mn,a=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F=fx(T,{key:v,get:i.get(f)},$);return x.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:x,install:(f)=>to(f,i),default:(f)=>{return i.get(f)({get:(...$)=>An(n,...$),find:($,v)=>Tn(n,$,v),seek:($,v)=>jn(n,$,v),json:($)=>sn(n,$)})}});return n.families.set(i.key,a),c}function Rf(n,i){if("set"in i)return lx(n,i);return to(n,i)}var o8={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function np(n,i){let o=g(i),c=`${n.key}(${o})`,p=o8[n.type],x={key:c,type:p};if(p==="molecule")Object.assign(x,{key:i,family:n});else Object.assign(x,{family:{key:n.key,subKey:o}});return Object.assign(x,{counterfeit:!0}),x}function si(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class Bi{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 x of o){c??=x,p??=x;let m=this.relations.get(x);if(m){if(m.size===1)this.relations.delete(x);else m.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let x of i){let m=this.relations.get(x);if(m)m.add(n);else m=new Set().add(n),this.relations.set(x,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 x=this.isAType?.(c)?c:void 0,m=x===void 0?c:void 0;for(let a of p)x??=a,m??=a,this.addRelation(x,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 x of p){let m=this.makeContentKey(n,x),a=i[x];this.setContent(m,a)}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 Zn(n){return"epoch"in n.transactionMeta}function wn(n){return"phase"in n.transactionMeta}var j0=(n)=>{let i=U(n);if(!wn(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 c8=(n)=>n[0].toUpperCase()+n.slice(1);function ao(n){return n.type.split("_").map(c8).join(" ")}class _i extends Error{constructor(...n){let i=n[0],o=n.length===2?n[1]:n[2];if(n.length===2)super(`${ao(i)} ${g(i.key)} not found in store "${o.config.name}".`);else{let c=n[1];super(`${ao(i)} "${i.key}" member ${g(c)} not found in store "${o.config.name}".`)}}}function ro(n,i,o){return(...c)=>{let p=e(n,o);if(p)return p.run(c,i);throw new _i(n,o)}}var $m=(n)=>(i)=>n instanceof Function?n(i):n;var go=(n,i)=>{if(i.valueMap.has(n.key))return i.logger.info("\uD83D\uDCD6",n.type,n.key,"reading cached value"),B0(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 y0=(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}"${!wn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},L0=(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)},N0=(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)},ip=(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 D0=(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 Wf=(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(N0(o,p))continue;C0(p,o),ip(o,p)}}};function p8(n,i){if(I0(i.newValue))return!1;if(n.includes("\uD83D\uDD0D"))return!1;return!0}var h0=(n,i,o)=>{let{key:c}=n,p=U(o);if(!wn(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(!p8(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 k0=(n,i,o)=>{let c=go(n,o),p=c;if(n.type==="mutable_atom"&&wn(o)){let{parent:m}=o;p=$x(n,m,o)}if(p=$m(i)(p),o.logger.info("\uD83D\uDCDD","atom",n.key,"set to",p),p=Zi(n.key,p,n.subject,o),s0(n.key,o))Z0(n.key,o);ip(o,n.key),Wf(n,o);let x={oldValue:c,newValue:p};if(Zn(o))D0(n,x,o);else if(o.parent){if(o.on.transactionApplying.state===null)h0(n,x,o);else if(n.key.startsWith("*")){let m=n.key.slice(1),a=o.atoms.get(m),f=o.valueMap.get(m);if(a.type==="mutable_atom"&&wn(o)){let{parent:$}=o;f=$x(a,$,o)}if(f.do(x.newValue)===null)Wf(a,o)}}};var vm=(n,i,o)=>{switch(n.type){case"atom":case"mutable_atom":k0(n,i,o);break;case"selector":n.set(i);break}};function Tm(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function Yn(n,...i){let o,c,p,x;if(i.length===2){if(o=i[0],x=i[1],c=Tm(n,o)??null,c)p=o.family?ii(o.family.subKey):null,o=Tn(n,c,p)}else c=i[0],p=i[1],x=i[2],o=Tn(n,c,p);if("counterfeit"in o){let f=n.disposalTraces.buffer.find((l)=>l?.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}".`,f?`This state was previously disposed:
48
+ ${f.trace}`:"No previous disposal trace was found.");return}let m=y0(n,o);if(m){let f=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${m}`,()=>{f(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${m}`),Yn(n,o,x)});return}let a=e(o,n);vm(a,x,n),L0(n)}function Jm(n,i,o){let{key:c,newValue:p,oldValue:x}=i,m=n==="newValue"?p:x,a={key:c,type:"atom"};if(i.family)Object.assign(a,{family:i.family});Yn(o,a,m)}function q0(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 fo(n,i,o){let c=uo(o,i,n.key);n.tokens.set(c.key,c);let p=wn(o)&&o.transactionMeta.phase==="building",x=o.moleculeInProgress===n.key;if(!p&&!x)n.subject.next({type:"state_creation",token:c});return c}class oi extends Set{mode="record";subject=new mn;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof oi)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 oi(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:${g(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:${g(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new oi(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 x=n.substring(i+1);return this.doStep(x),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let x=this.cacheIdx+c;if(this.cache[x]===n)return null;this.mode="playback";let a=!1;while(!a){this.cacheIdx%=this.cacheLimit;let l=this.cache[this.cacheIdx];if(this.cacheIdx--,!l)return"OUT_OF_RANGE";this.undo(l),a=this.cacheIdx===x-1}let f=n.substring(i+1);return this.doStep(f),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 x of p)this.add(x);break}case"tx":{let p=c.split(";");for(let x=p.length-1;x>=0;x--)this.undoStep(p[x])}}}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 Gf{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 Gf(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=(Y,K)=>{let Q=this.toolkit.seek(Y,K);if(Q)return Q;let u=this.store.molecules.get(g(K));if(u){let V=e(Y,o);return fo(u,V,o)}if(o.config.lifespan==="immortal")throw new _i(Y,K,o);return uo(o,Y,K)},this.toolkit={get:(...Y)=>An(o,...Y),set:(...Y)=>{Yn(o,...Y)},find:this.retrieve,seek:(...Y)=>jn(o,...Y),json:(Y)=>sn(o,Y),dispose:(...Y)=>{Hi(o,...Y)}};let c=n.between[0],p=n.between[1],x=ax(o,{key:`${n.key}/relatedKeys`,default:()=>new oi,mutable:!0,fromJson:(Y)=>oi.fromJSON(Y),toJson:(Y)=>Y.toJSON()},["join","relations"]);this.core={findRelatedKeysState:x};let m=({get:Y},K)=>Y(this.retrieve(x,K)),a=(Y,K,Q)=>{let{set:u}=Y,V=this.retrieve(x,K),X=this.retrieve(x,Q);u(V,(s)=>s.add(Q)),u(X,(s)=>s.add(K))},f=(Y,K,Q)=>{let{set:u}=Y,V=this.retrieve(x,K),X=this.retrieve(x,Q),s,C;u(V,(q)=>{if(q.delete(Q),q.size===0)s=`"${K}"`;return q}),u(X,(q)=>{if(q.delete(K),q.size===0)C=`"${Q}"`;return q})},l=(Y,K,Q)=>{let{get:u,set:V}=Y,X=this.retrieve(x,K),s=u(X);for(let C of s){if(Q.includes(C))continue;let Xn=this.retrieve(x,C);V(Xn,(Un)=>{return Un.delete(K),Un})}V(X,(C)=>{return C.transaction((q)=>{q.clear();for(let Xn of Q){let Un=m(Y,Xn),Vi=Un.has(K);if(this.relations.cardinality==="1:n"){let _o=[];for(let O of Un){if(O===K)continue;let P=m(Y,O);if(P.delete(Xn),P.size===0)_o.push(O)}if(!Vi&&Un.size>0)Un.clear();for(let O of _o){let P=[Xn,O].sort(),Mn=`"${P[0]}:${P[1]}"`;this.molecules.delete(Mn)}}if(!Vi)Un.add(K);q.add(Xn)}return!0}),C})},$=(Y,K,Q)=>{let{set:u}=Y,V=this.retrieve(x,K);u(V,(X)=>{return X.transaction((s)=>{for(let C of Q)s.add(C);return!0}),X});for(let X of Q){let s=this.retrieve(x,X);u(s,(C)=>{return C.add(K),C})}return!0},v=(Y,K,Q)=>{let u=m(Y,K);return Q?u.has(Q):u.size>0},T={getRelatedKeys:(Y)=>m(this.toolkit,Y),addRelation:(Y,K)=>{a(this.toolkit,Y,K)},deleteRelation:(Y,K)=>{f(this.toolkit,Y,K)},replaceRelationsSafely:(Y,K)=>{l(this.toolkit,Y,K)},replaceRelationsUnsafely:(Y,K)=>{$(this.toolkit,Y,K)},has:(Y,K)=>v(this.toolkit,Y,K)},F,R,S;if(i){R=qo(o,{key:`${n.key}/content`,default:i},["join","content"]),S=q0(o,{key:`${n.key}/content-molecules`,new:class V{key;constructor(X,s){this.key=s}}});let Y=({get:V},X)=>V(this.retrieve(R,X)),K=({set:V},X,s)=>{V(this.retrieve(R,X),s)},Q=(V,X)=>{let s=o.molecules.get(`"${X}"`);if(s)this.toolkit.dispose(s),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)=>{Q(this.toolkit,V)}})}else F=T;let M=new Bi(n,{externalStore:F,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...Y)=>{let K=Y.sort(),Q=`${K[0]}:${K[1]}`,[u,V]=K.map((X)=>this.molecules.get(g(X)));if(o.config.lifespan==="immortal"&&u&&V){let X=U(o),s=bo(X,[u,V],S,Q);this.molecules.set(`"${Q}"`,e(s,X))}return Q}}),G=()=>to(o,{key:`${n.key}/singleRelatedKey`,get:(Y)=>({get:K})=>{let Q=this.retrieve(x,Y),u=K(Q);for(let V of u)return V;return null}},["join","keys"]),H=()=>{return to(o,{key:`${n.key}/multipleRelatedKeys`,get:(Y)=>({get:K})=>{let Q=Xf(x,o),u=this.retrieve(Q,Y);return K(u).members}},["join","keys"])},y=()=>to(o,{key:`${n.key}/singleRelatedEntry`,get:(Y)=>({get:K})=>{let Q=this.retrieve(x,Y),u=K(Q);for(let V of u){let X=M.isAType?.(Y)?Y:void 0,s=X===void 0?Y:void 0;X??=V,s??=V;let C=M.makeContentKey(X,s),q=this.retrieve(R,C),Xn=K(q);return[V,Xn]}return null}},["join","entries"]),k=()=>to(o,{key:`${n.key}/multipleRelatedEntries`,get:(Y)=>({get:K})=>{let Q=Xf(x,o),u=this.retrieve(Q,Y);return K(u).members.map((X)=>{let s=M.isAType?.(Y)?Y:void 0,C=s===void 0?Y:void 0;s??=X,C??=X;let q=M.makeContentKey(s,C),Xn=this.retrieve(R,q),Un=K(Xn);return[X,Un]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let Y=G(),K=`${c}KeyOf${Ln(p)}`,Q=`${p}KeyOf${Ln(c)}`,u={[K]:Y,[Q]:Y},V;if(i){let X=y(),s=`${c}EntryOf${Ln(p)}`,C=`${p}EntryOf${Ln(c)}`,q={[s]:X,[C]:X};V=Object.assign(u,q)}else V=u;this.relations=M,this.states=V;break}case"1:n":{let Y=G(),K=H(),Q=`${c}KeyOf${Ln(p)}`,u=`${p}KeysOf${Ln(c)}`,V={[Q]:Y,[u]:K},X;if(i){let s=y(),C=k(),q=`${c}EntryOf${Ln(p)}`,Xn=`${p}EntriesOf${Ln(c)}`,Un={[q]:s,[Xn]:C};X=Object.assign(V,Un)}else X=V;this.relations=M,this.states=X;break}default:{let Y=H(),K=`${c}KeysOf${Ln(p)}`,Q=`${p}KeysOf${Ln(c)}`,u={[K]:Y,[Q]:Y},V;if(i){let X=k(),s=`${c}EntriesOf${Ln(p)}`,C=`${p}EntriesOf${Ln(c)}`,q={[s]:X,[C]:X};V=Object.assign(u,q)}else V=u;this.relations=M,this.states=V}}}}function wm(n,i,o=on.STORE){return Kf(o).set(n.key,new Gf(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function Kf(n){if("joins"in n&&n.joins instanceof Map)return n.joins;let i=new Map;return n.joins=i,i}function vx(n,i){let o=Kf(i),c=o.get(n.key);if(c===void 0){if(c=Kf(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 op(n,i,o){let c=vx(n,o),p;switch(n.cardinality){case"1:1":{let x=`${n.a}KeyOf${Ln(n.b)}`,m=`${n.b}KeyOf${Ln(n.a)}`;p={get[x](){let f=c.states[x];return c.retrieve(f,i)},get[m](){let f=c.states[m];return c.retrieve(f,i)}};let a=`${n.a}EntryOf${Ln(n.b)}`;if(a in c.states){let f=`${n.b}EntryOf${Ln(n.a)}`;Object.assign(p,{get[a](){let l=c.states[a];return c.retrieve(l,i)},get[f](){let l=c.states[f];return c.retrieve(l,i)}})}break}case"1:n":{let x=`${n.a}KeyOf${Ln(n.b)}`,m=`${n.b}KeysOf${Ln(n.a)}`;p={get[x](){let f=c.states[x];return c.retrieve(f,i)},get[m](){let f=c.states[m];return c.retrieve(f,i)}};let a=`${n.a}EntryOf${Ln(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Ln(n.a)}`;Object.assign(p,{get[a](){let l=c.states[a];return c.retrieve(l,i)},get[f](){let l=c.states[f];return c.retrieve(l,i)}})}break}case"n:n":{let x=`${n.a}KeysOf${Ln(n.b)}`,m=`${n.b}KeysOf${Ln(n.a)}`;p={get[x](){let f=c.states[x];return c.retrieve(f,i)},get[m](){let f=c.states[m];return c.retrieve(f,i)}};let a=`${n.a}EntriesOf${Ln(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Ln(n.a)}`;Object.assign(p,{get[a](){let l=c.states[a];return c.retrieve(l,i)},get[f](){let l=c.states[f];return c.retrieve(l,i)}})}}}return p}function P0(n,i){return op(n,i,on.STORE)}function Wc(n,i,o){let c=vx(n,o),p=U(o);if(wn(p)){let{toolkit:x}=p.transactionMeta;c.transact(x,({relations:m})=>{i(m)})}else i(c.relations)}function x8(n,i){return vx(n,i).core.findRelatedKeysState}function t0(n){return x8(n,on.STORE)}function Am(n){return{store:n}}function An(n,...i){let o,c,p;if(i.length===1){if(o=i[0],o.type!=="molecule"){if(c=Tm(n,o)??null,c)p=o.family?ii(o.family.subKey):null,o=Tn(n,c,p)}}else{c=i[0],p=i[1];let x;if(c.type==="molecule_family")x=jn(n,c,p)??np(c,p);else x=Tn(n,c,p);o=x}if("counterfeit"in o&&"family"in o){c=o.type==="molecule"?e(o.family,n):n.families.get(o.family.key);let x=o.type==="molecule"?o.key:o.family.subKey,m=n.disposalTraces.buffer.find((a)=>a?.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:
49
+ ${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 a=e(c,n).default(x);return n.defaults.set(c.key,a),a}case"molecule_family":throw new _i(c,x,n)}}switch(o.type){case"atom":case"mutable_atom":case"selector":case"readonly_selector":return go(e(o,n),n);case"molecule":return e(o,n).instance}}class cp{key;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=g(i),o)this.family=o,this._dependsOn=o.dependsOn;if(n)for(let c of n)this.above.set(c.stringKey,c)}}function r0(n){return n[0].toUpperCase()+n.slice(1)}function bo(n,i,o,c,...p){let x=u0(n),m=U(n),a=g(c);m.moleculeInProgress=a;let f=Array.isArray(i)?i:[i],l=f.map((M)=>{if(M instanceof cp)return M;let G=g(M.key),H=n.molecules.get(G);if(!H)throw new Error(`Molecule ${G} not found in store "${n.config.name}"`);return H}),$=new cp(l,c,o);m.molecules.set(a,$);for(let M of l)M.below.set($.stringKey,$);let v={get:(...M)=>An(U(x),...M),set:(...M)=>{Yn(U(x),...M)},seek:(M,G)=>jn(U(x),M,G),json:(M)=>sn(U(x),M),run:(M,G=ec())=>ro(M,G,U(n)),make:(M,G,H,...y)=>bo(U(x),M,G,H,...y),dispose:(M)=>{Hi(U(x),M)},env:()=>Am(U(x)),bond:(M,G)=>{if(M.type==="join"){let{as:H}=G,y=vx(M,x);y.molecules.set(a,$),$.joins.set(M.key,y);let k=T.subject.subscribe(`join:${M.key}-${a}`,(X)=>{if(X.type==="molecule_disposal"){if(g(X.token.key)===a)k(),y.molecules.delete(a)}});if(H===null)return;let Y=M.a===H?M.b:M.a,K=P0(M,c),Q=K[`${Y}KeysOf${r0(H)}`],u=K[`${Y}EntriesOf${r0(H)}`],V={relatedKeys:Q};if(u)V=Object.assign(V,{relatedEntries:u});return V}return fo($,e(M,x),U(x))},claim:(M,G)=>{let{exclusive:H}=G,y=U(n).molecules.get(g(M.key));if(y)if(H){for(let k of y.above.values())k.below.delete(y.stringKey);y.above.clear(),y.above.set($.stringKey,$),$.below.set(y.stringKey,y)}else y.above.set($.stringKey,$),$.below.set(y.stringKey,y)},spawn:(M,G,...H)=>bo(U(n),[$],e(M,n),G,...H)},T=e(o,n),F=T.new;$.instance=new F(v,c,...p);let R={type:"molecule",key:c,family:o},S={type:"molecule_creation",subType:"classic",token:R,family:o,context:f,params:p};if(Zn(m))T.subject.next(S);else if(wn(m)&&m.on.transactionApplying.state===null)m.transactionMeta.update.updates.push(S);return m.moleculeInProgress=null,R}function zf(n,i,o){switch(i){case"newValue":{g0(n,o);break}case"oldValue":{Hi(o,n.token);break}}}function Hf(n,i,o){switch(i){case"newValue":{Hi(o,n.token);break}case"oldValue":{g0(n,o),o.valueMap.set(n.token.key,n.value);break}}}function g0(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)Tn(i,c,ii(o.subKey))}}function Qf(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":Yf(o,n.provenance,n.key);break}break;case"oldValue":switch(n.subType){case"classic":Hi(o,n.token);break;case"modern":Tx(o,n.key);break}break}}function Of(n,i,o){switch(i){case"newValue":switch(n.subType){case"classic":Hi(o,n.token);break;case"modern":Tx(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,x]of n.values){let m=`${p}(${g(c.key)})`,a=e(c,o),f=a.tokens.has(m),l=o.families.get(p);if(l&&!f)fo(a,l,o);o.valueMap.set(m,x)}}break;case"modern":{Yf(o,n.provenance,n.key);for(let[c,p]of n.values){let x=o.families.get(c);if(x){Tn(o,x,n.key);let m=`${c}(${g(n.key)})`;o.valueMap.set(m,p)}}}}break}}function Sm(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":Jm(n,p,o);break;case"state_creation":zf(p,n,o);break;case"state_disposal":Hf(p,n,o);break;case"molecule_creation":Qf(p,n,o);break;case"molecule_disposal":Of(p,n,o);break;case"transaction_update":Sm(n,p,o);break}}function d0(n,i,o){if(Zn(o)&&n)o.transactionMeta.epoch.set(n,i)}function e0(n,i,o){if(!Zn(o))return;let p=o.transactionMeta.actionContinuities.getRelatedKey(n);if(p!==void 0)o.transactionMeta.epoch.set(p,i)}var nv=(n,i)=>{let o=U(i),{parent:c}=o;if(c===null||!wn(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),Sm("newValue",o.transactionMeta.update,c),Zn(c))e0(o.transactionMeta.update.key,o.transactionMeta.update.epoch,c),e({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(wn(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function iv(n,i,o){if(!Zn(o))return;let{epoch:p,actionContinuities:x}=o.transactionMeta;if(x.set(n,i),!p.has(n))p.set(n,-1)}class qi extends Map{source;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 ov=(n,i,o,c)=>{let p=U(o),x={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new qi(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new qi(p.families),operation:{open:!1},readonlySelectors:new qi(p.readonlySelectors),timelines:new qi(p.timelines),timelineTopics:new Bi(p.timelineTopics.toJSON()),trackers:new Map,transactions:new qi(p.transactions),selectorAtoms:new Bi(p.selectorAtoms.toJSON()),selectorGraph:new Bi(p.selectorGraph.toJSON(),{makeContentKey:(...l)=>l.sort().join(":")}),selectors:new qi(p.selectors),valueMap:new qi(p.valueMap),defaults:p.defaults,disposalTraces:o.disposalTraces.copy(),molecules:new qi(p.molecules),moleculeFamilies:new qi(p.moleculeFamilies),moleculeInProgress:p.moleculeInProgress,miscResources:new qi(p.miscResources)},m=cv(n,o),a={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:(...l)=>An(f,...l),set:(...l)=>{Yn(f,...l)},run:(l,$=ec())=>ro(l,$,f),find:(l,$)=>Tn(f,l,$),seek:(l,$)=>jn(f,l,$),json:(l)=>sn(f,l),make:(l,$,v,...T)=>bo(f,l,$,v,...T),dispose:(...l)=>{Hi(f,...l)},env:()=>Am(f)}},f=Object.assign(x,{transactionMeta:a});return p.child=f,o.logger.info("\uD83D\uDEEB","transaction",n,"Building transaction with params:",i),f};function Ef(n,i){let o={key:n.key,type:"transaction",run:(x,m)=>{let a=ov(n.key,x,i,m);try{let f=U(i),{toolkit:l}=a.transactionMeta,$=n.do(l,...x);return nv($,f),$}catch(f){throw j0(c),i.logger.warn("\uD83D\uDCA5","transaction",n.key,"caught:",f),f}},install:(x)=>Ef(n,x),subject:new mn},c=U(i);c.transactions.set(o.key,o);let p=si(o);return i.on.transactionCreation.next(p),p}function cv(n,i){let o=Zn(i),c=o?i.transactionMeta.actionContinuities.getRelatedKey(n):void 0;return o&&c!==void 0?i.transactionMeta.epoch.get(c):void 0}class Fm{_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 Fm([...this._buffer]);return n._index=this._index,n}}class pv{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new Bi({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new Bi({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 Bi({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new Bi({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new Fm(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 Mf(null),operationClose:new mn,moleculeCreationStart:new mn,moleculeCreationDone:new mn,moleculeDisposal:new mn};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Kc("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},Zn(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new Bi(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=sn(i,c),x=jo(c);o.add(p.key),o.add(x.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 pv({name:"IMPLICIT_STORE",lifespan:"ephemeral"});return globalThis.ATOM_IO_IMPLICIT_STORE}};function e(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(g(n.key));break;case"molecule_family":o=c.moleculeFamilies.get(n.key);break}if(o)return o;c=c.child}throw new _i(n,i)}function Mm(n,i){let o;o=e(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(si(m));let x=[];for(let m of o.tokens.values()){let a=m.family;x.push([a.key,i.valueMap.get(m.key)])}if(c){let m=e(c,i),a={type:"molecule_disposal",subType:"classic",token:n,family:c,context:p,values:x};if(n.family)a.family=n.family;for(let l of o.tokens.values())Hi(i,l);for(let l of o.below.values())if(l.dependsOn==="all")Mm(l,i);else if(l.above.delete(o.stringKey),l.above.size===0)Mm(l,i);if(o.below.clear(),wn(i)&&i.transactionMeta.phase==="building")i.transactionMeta.update.updates.push(a);else m.subject.next(a);i.molecules.delete(o.stringKey)}for(let m of o.above.values())m.below.delete(o.stringKey)}function uo(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new _i(i,n);let p=c(o),x=U(n);if(p.family&&x.moleculeInProgress===null){if(Zn(x))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(wn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function jn(n,i,o){let c=g(o),p=`${i.key}(${c})`,x=U(n),m;switch(i.type){case"atom_family":case"mutable_atom_family":m=x.atoms.get(p);break;case"selector_family":m=x.selectors.get(p);break;case"readonly_selector_family":m=x.readonlySelectors.get(p);break;case"molecule_family":m=x.molecules.get(g(o))}if(m)return si(m);return m}function Tn(n,i,o){let c=jn(n,i,o);if(c)return c;let p=n.molecules.get(g(o));if(p)return fo(p,i,n);if(n.config.lifespan==="immortal"){let x=np(i,o);return n.logger.error("\u274C",x.type,x.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),x}return c=uo(n,i,o),c}function Hi(n,...i){let o,c;if(i.length===1)o=i[0],c=o.key;else{let x=i[0],m=i[1];o=x.type==="molecule_family"?jn(n,x,m)??np(x,m):Tn(n,x,m)}try{e(o,n)}catch(x){let m=n.disposalTraces.buffer.find((a)=>a?.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?`
50
50
  This state was most recently disposed
51
- ${a.trace}`:"No previous disposal trace was found.");return}switch(o.type){case"atom":case"mutable_atom":Of(o,n);break;case"selector":case"readonly_selector":cv(o,n);break;case"molecule":Ma(o,n);break}let{stack:p}=new Error;if(p){let x=p?.split(`
51
+ ${m.trace}`:"No previous disposal trace was found.");return}switch(o.type){case"atom":case"mutable_atom":Uf(o,n);break;case"selector":case"readonly_selector":xv(o,n);break;case"molecule":Mm(o,n);break}let{stack:p}=new Error;if(p){let x=p?.split(`
52
52
  `)?.slice(3)?.join(`
53
- `);n.disposalTraces.add({key:o.key,trace:x})}}var Ra=(n,i)=>U(i).atoms.has(n),x8=(n,i)=>U(i).selectors.has(n),a8=(n,i)=>U(i).readonlySelectors.has(n),pv=(n,i)=>Ra(n,i)||x8(n,i)||a8(n,i);var Wa=(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 Ef=(n,i,o)=>{let c=[],p=Wa(n,o);while(p.length>0){let x=p.shift();if(i.has(x))continue;if(i.add(x),!Ra(x,o))p.push(...Wa(x,o));else if(!c.includes(x))c.push(x)}return c},xv=(n,i)=>{let o=n.key,c=Wa(o,i),p=new Set;return c.flatMap((x)=>Ra(x,i)?x:Ef(x,p,i))};var av=(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 x=Ef(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${x.map((a)=>`"${a}"`).join(", ")} ]`);for(let a of x)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:a})}o.add(i.key)};var Ka=(n,i,o)=>({get:(...c)=>{let p=U(o),x;if(c.length===2){let[f,l]=c;switch(f.type){case"molecule_family":return An(o,f,l);default:if(o.config.lifespan==="ephemeral")x=Tn(o,f,l);else{let $=jn(o,f,l);if($)x=$;else throw new _i(f,l,o)}}}else[x]=c;if(x.type==="molecule")return An(o,x);let a=e(x,o),m=ro(a,o);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,m,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),av(n,x,i,o),m},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let f=c[0],l=c[1];x=c[2];let $=o.config.lifespan==="ephemeral"?Tn(o,f,l):jn(o,f,l);if(!$)throw new _i(f,l,o);p=$}let a=U(o),m=e(p,a);va(m,x,a)},find:(c,p)=>Tn(o,c,p),seek:(c,p)=>jn(o,c,p),json:(c)=>sn(o,c)});var mx=(n,i,o)=>{let c=U(n),p=new an,x=new Set,{get:a,find:m,seek:f,json:l}=Ka(i.key,x,c),$=()=>{let R=i.get({get:a,find:m,seek:f,json:l});return Zi(i.key,R,p,U(n)),x.clear(),R},v={...i,subject:p,install:(R)=>mx(R,i,o),get:$,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,v);let T=$();n.logger.info("\u2728",v.type,v.key,"=",T);let F={key:i.key,type:"readonly_selector"};if(o)F.family=o;return F};var Tx=(n,i,o)=>{let c=U(n),p=new an,x=new Set,a=Ka(i.key,x,c),{find:m,get:f,seek:l,json:$}=a,v={find:m,get:f,seek:l,json:$},T=(G=i.get,H=U(n))=>{let B=G(v);return Zi(i.key,B,p,H),x.clear(),B},R={...i,subject:p,install:(G)=>Tx(G,i,o),get:T,set:(G)=>{let H=U(n),B=T(i.get,H),k=$a(G)(B);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",B,"->",k,")"),Zi(i.key,k,p,H),np(H,i.key),Zn(H))p.next({newValue:k,oldValue:B});i.set(a,k)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,R);let S=T();n.logger.info("\u2728",R.type,R.key,"=",S);let M={key:i.key,type:"selector"};if(o)M.family=o;return M};function xx(n,i){if("set"in i){let p=Tx(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=mx(n,i,void 0);return n.on.selectorCreation.next(c),c}function cv(n,i){let o=U(i),{key:c}=n,p=e(n,o);if(!p.family)i.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{let x=o.molecules.get(p.family.subKey);if(x)x.tokens.delete(c);switch(n.type){case"selector":o.selectors.delete(c),e({key:p.family.key,type:"selector_family"},i).subject.next({type:"state_disposal",token:n});break;case"readonly_selector":o.readonlySelectors.delete(c),e({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"),wn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.selectorDisposal.next(n)}}function fx(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new an,m=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F=Tx(T,{key:v,get:i.get(f),set:i.set(f)},$);return x.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:x,install:(f)=>fx(f,i),default:(f)=>{return i.get(f)({get:(...$)=>An(n,...$),find:($,v)=>Tn(n,$,v),seek:($,v)=>jn(n,$,v),json:($)=>sn(n,$)})}});return n.families.set(i.key,m),c}function mv(n,i,o=on.STORE){let c=fx(o,{key:`${n.key}:JSON`,get:(x)=>({seek:a,get:m})=>{let f=a(n,x);if(f)return i.toJson(m(f));let l=g(x),$=o.molecules.get(l);if($){let T=mo($,n,o);return i.toJson(m(T))}if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${l}"`);let v=uo(o,n,x);return i.toJson(m(v))},set:(x)=>({seek:a,set:m},f)=>{let l=a(n,x);if(l)m(l,i.fromJson(f));else{let $=g(x),v=o.molecules.get($);if(v){let T=mo(v,n,o);m(T,i.fromJson(f))}else{if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${$}"`);m(uo(o,n,x),i.fromJson(f))}}}},["mutable","json"]);return e(n,o).subject.subscribe(`store=${o.config.name}::json-selector-family`,(x)=>{if(x.token.family)jn(o,c,ii(x.token.family.subKey))}),c}var ii=(n)=>JSON.parse(n),g=(n)=>JSON.stringify(n),VO=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var fv=(n,i)=>{let o=U(i);if(o.operation.open)return o.operation.prev.get(n.key);return o.valueMap.get(n.key)};var _f=(n,i)=>{let o=U(i);return xv(n,i).map((p)=>{let x=o.atoms.get(p);if(x===void 0)throw new Error(`Atom "${p}", a dependency of selector "${n.key}", not found in store "${i.config.name}".`);return x.subject.subscribe(`${n.type}:${n.key}`,(a)=>{i.logger.info("\uD83D\uDCE2",n.type,n.key,"root",p,"went",a.oldValue,"->",a.newValue);let m=fv(n,o),f=ro(n,o);i.logger.info("\u2728",n.type,n.key,"went",m,"->",f),n.subject.next({newValue:f,oldValue:m})})})};function Si(n,i,o,c){function p(v){if(c.operation.open){let T=c.on.operationClose.subscribe(`state subscription ${o}`,()=>{T(),i(v)})}else i(v)}let x=e(n,c);c.logger.info("\uD83D\uDC40",x.type,x.key,`Adding subscription "${o}"`);let a=x.type==="selector"||x.type==="readonly_selector",m=null,f=p;if(a)m=_f(x,c),f=(v)=>{if(m)m.length=0,m.push(..._f(x,c));p(v)};let l=x.subject.subscribe(o,f);return()=>{if(c.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),l(),m)for(let v of m)v()}}var Uf=(n,i,o,c)=>{let p=e(n,c);c.logger.info("\uD83D\uDC40","timeline",n.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","timeline",n.key,`Removing subscription "${o}" from timeline`),x()}};var Vf=(n,i,o,c)=>{let p=e(n,c);c.logger.info("\uD83D\uDC40","transaction",n.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","transaction",n.key,`Removing subscription "${o}"`),x()}};class go{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=qo(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let x=i.parent.valueMap.get(o);i.valueMap.set(o,x)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${wn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=An(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{Yn(o,i,x)}),this.unsubscribeFromState=Si(n,(x)=>{if(x.newValue!==x.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=x.newValue.subscribe(c,(a)=>{Yn(o,i,a)})},c,o)}updateCore(n,i,o){let c=`tracker:${o.config.name}:${wn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Si(i,({newValue:p,oldValue:x})=>{let a=o.timelineTopics.getRelatedKey(i.key);if(a){if(o.timelines.get(a)?.timeTraveling){let l=Uf({key:a,type:"timeline"},($)=>{l(),Yn(o,n,(v)=>{if($==="redo"&&p)v.do(p);else if($==="undo"&&x)v.undo(x);return v})},c,o);return}}let m=o.on.operationClose.subscribe(c,()=>{m();let f=An(o,n),l=p===null?-1:f.getUpdateNumber(p),$=l-f.cacheUpdateNumber;if(p&&$===1)Yn(o,n,(v)=>(v.do(p),v));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${f.cacheUpdateNumber+1}, but got ${l}`)})},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 Jx(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 x=new an,a={...i,type:"mutable_atom",install:(l)=>{return l.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${l.config.name}"`),Jx(l,i,o)},subject:x};if(o)a.family=o;let m=i.default();c.atoms.set(a.key,a),Xa(i.key,n),Zi(i.key,m,x,c);let f=si(a);if(i.effects){let l=0,$=[];for(let v of i.effects){let T=v({setSelf:(F)=>{Yn(n,f,F)},onSet:(F)=>Si(f,F,`effect[${l}]`,n)});if(T)$.push(T);++l}a.cleanup=()=>{for(let v of $)v()}}if(new go(f,n),!o)U0(f,i,n);return f}class uf{Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=Zo(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=e(o,i),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=ii(c.token.family.subKey);jn(i,this.latestUpdateAtoms,p),new go(c.token,i)}}),this.latestUpdateAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=ii(c.token.family.subKey),x=jn(i,this.mutableAtoms,p);if(x)new go(x,i)}})}}function ax(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new an,m=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F={key:v,default:()=>i.default(f),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)F.effects=i.effects(f);let R=Jx(T,F,$);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(f)=>ax(f,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,m),mv(m,i,n),new uf(m,n),c}var Wf=(n,i)=>{let o=U(i),c=`${n.key}:JSON`;return o.families.get(c)};var sn=(n,i)=>{if(i.family){let c=U(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},a=e(x,c),m=JSON.parse(i.family.subKey);return Tn(n,a,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 C0(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function lx(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 x=n.toJson(c),a=n.fromJson(x);return o.valueMap.set(n.key,a),new go(n,i),a}return p}function Zi(n,i,o,c){let p=c.valueMap.get(n);if(p instanceof px)p.use(i);if(i instanceof Promise){let x=new px(i);return c.valueMap.set(n,x),x.then((a)=>{Zi(n,a,o,c),o.next({newValue:a,oldValue:x})}).catch((a)=>{c.logger.error("\uD83D\uDCA5","state",n,"rejected:",a)}),x}return c.valueMap.set(n,i),i}var b0=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&wn(i)){let{parent:c}=i;o=lx(n,c,i)}return o},N0=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof px){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 I0=(n,i)=>{return U(i).atomsThatAreDefault.has(n)},Xa=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(n)},k0=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(U(i).atomsThatAreDefault),o.atomsThatAreDefault.delete(n)};function qo(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 x=new an,a={...i,type:"atom",install:(l)=>{return l.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${l.config.name}"`),qo(l,i,o)},subject:x};if(o)a.family=o;let m=i.default;if(i.default instanceof Function)m=i.default();c.atoms.set(a.key,a),Xa(i.key,n),Zi(i.key,m,x,c);let f=si(a);if(i.effects){let l=0,$=[];for(let v of i.effects){let T=v({setSelf:(F)=>{Yn(n,f,F)},onSet:(F)=>Si(f,F,`effect[${l}]`,n)});if(T)$.push(T);++l}a.cleanup=()=>{for(let v of $)v()}}return f}function lv(n,i){if("mutable"in i){let p=Jx(n,i,void 0);return n.on.atomCreation.next(p),p}let c=qo(n,i,void 0);return n.on.atomCreation.next(c),c}function Of(n,i){let o=U(i),{key:c}=n,p=e(n,o);if(!p.family)i.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{p.cleanup?.();let x=i.valueMap.get(p.key);e({key:p.family.key,type:"atom_family"},i).subject.next({type:"state_disposal",token:n,value:x});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 f=jo(n);Of(f,i),i.trackers.delete(c)}if(i.logger.info("\uD83D\uDD25","atom",c,"deleted"),wn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.atomDisposal.next(n)}}var fV=Symbol("provenance");function Xf(n,i,o){let c=g(o);try{let p=[],x;if(i==="root")p.push(n.molecules.get('"root"')),x="all";else if(typeof i==="string"&&i.startsWith(m8)){x="any";let $=g(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$--")){x="all";for(let v of i){let T=g(v),F=n.molecules.get(T);if(!F)throw new Error(`Molecule ${T} not found in store "${n.config.name}"`);p.push(F)}}else{x="any";let v=g(i),T=n.molecules.get(v);if(!T)throw new Error(`Molecule ${v} not found in store "${n.config.name}"`);p.push(T)}let a=new op(p,o);a._dependsOn=x,n.molecules.set(c,a);for(let $ of p)$.below.set(a.stringKey,a);let m={type:"molecule_creation",subType:"modern",key:a.key,provenance:i},f=U(n);if(wn(f)&&f.transactionMeta.phase==="building")f.transactionMeta.update.updates.push(m);else f.on.moleculeCreationStart.next(m)}catch(p){if(p instanceof Error)n.logger.error("\u274C","molecule",c,"allocation failed:",p.message)}return o}function vx(n,i){let o=g(i),c=n.molecules.get(o);if(!c)throw new Error(`Molecule ${o} not found in store "${n.config.name}"`);for(let l of c.joins.values())l.relations.delete(c.key),l.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:l})=>l);let x=[];for(let l of c.tokens.values()){let $=l.family;x.push([$.key,n.valueMap.get(l.key)])}for(let l of c.tokens.values())Hi(n,l);for(let l of c.below.values())if(l.dependsOn==="all")vx(n,l.key);else if(l.above.delete(c.stringKey),l.above.size===0)vx(n,l.key);c.below.clear();let a={type:"molecule_disposal",subType:"modern",key:c.key,values:x,provenance:p},m=U(n);if(wn(m)&&m.transactionMeta.phase==="building")m.transactionMeta.update.updates.push(a);else m.on.moleculeDisposal.next(a);m.molecules.delete(c.stringKey);for(let l of c.above.values())l.below.delete(c.stringKey)}var m8="T$";function eo(n){return lv(on.STORE,n)}function Xc(n){return _0(on.STORE,n)}var bf=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},f8={error:bf("error"),info:bf("info"),warn:bf("warn")};class Kc{logLevel;filter;logger;constructor(n,i,o=f8){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 Ga(n){return Ff(on.STORE,n)}function Gc(n){return Qf(n,on.STORE)}class $v 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 Ya{key;type="continuity";globals=[];actions=[];perspectives=[];constructor(n){this.key=n}static existing=new $v;static create(n,i){let o=new Ya(n),{type:c,globals:p,actions:x,perspectives:a}=i(o),m={type:c,key:n,globals:p,actions:x,perspectives:a};return Ya.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 vv(n){let{key:i,config:o}=n,c=Ya.create(i,o),{actions:p}=c;for(let x of p)e0(i,x.key,on.STORE);return r0(i,-1,on.STORE),c}var XV=eo({key:"usersInRoomIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),jf=eo({key:"roomIndex",default:()=>new oi,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),l8={enteredAtEpoch:0},wx=wa({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},l8),GV=Ga({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=q0(wx);return[i(o,n)]}});import{spawn as $8}from"child_process";class cp{emit;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 Ax extends cp{process;key;logger;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 x=JSON.stringify([c,...p])+"\x03",a=(m)=>{if(m.code==="EPIPE")console.error("EPIPE error during write",this.process.stdin);this.process.stdin.removeListener("error",a)};return this.process.stdin.once("error",a),this.process.stdin.write(x),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==="ALIVE")return;this.unprocessedEvents.push(...p.split("\x03"));let x=this.unprocessedEvents.shift();this.incompleteData+=x??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let a=ii(this.incompleteData);this.handleEvent(...a);while(this.unprocessedEvents.length>0){let m=this.unprocessedEvents.shift();if(m){if(this.unprocessedEvents.length===0)this.incompleteData=m;a=ii(m),this.handleEvent(...a)}}this.incompleteData=""}catch(a){console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.warn(this.incompleteData),console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.error(a)}}),this.process.stderr.on("data",(c)=>{let p=c.toString();this.unprocessedLogs.push(...p.split("\x03"));let x=this.unprocessedLogs.shift();this.incompleteLog+=x??"";try{let a=ii(this.incompleteLog);this.handleLog(a);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)a=ii(this.incompleteLog),this.handleLog(a)}catch(a){console.error("\u274C\u274C\u274C"),console.error(this.incompleteLog),console.error(a),console.error("\u274C\u274C\u274C\uFE0F")}}),n.pid)this.id=n.pid.toString()}}class Tv extends cp{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new an,this.out=new an,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class Bf extends cp{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(g(n.map((i)=>i instanceof oi?`{ ${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=ii(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 x=ii(p);this.handleEvent(...x)}}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 Tv(`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("ALIVE")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}var yf=Xc({key:"roomArguments",default:["echo",["Hello World!"]]}),Jv=Ga({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(yf,n),p=i(c),[x,a]=p,m=await new Promise((f)=>{let l=$8(x,a,{env:process.env}),$=(v)=>{if(v.toString()==="ALIVE")l.stdout.off("data",$),f(l)};l.stdout.on("data",$)});return new Ax(m,n)}});var gV=Gc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let a=x?[p,x]:[p],m=o(yf,c);i(m,a),i(jf,($)=>$.add(c));let f=o(Jv,c);return n(f)}}),dV=Gc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return Wc(wx,(x)=>{x.set({room:i,user:o},p)},n.env().store),p}}),eV=Gc({key:"leaveRoom",do:(n,i,o)=>{Wc(wx,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),n_=Gc({key:"destroyRoom",do:(n,i)=>{Wc(wx,(o)=>{o.delete({room:i})},n.env().store),n.set(jf,(o)=>(o.delete(i),o))}});function Lf(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Lf(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 c_=Xc({key:"redactor",default:{occlude:(n)=>n}}),pp=Xc({key:"unacknowledgedUpdates",default:()=>[]});var za=Xc({key:"sockets",default:null}),Nf=eo({key:"socketsIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Df=eo({key:"usersIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Yc=wa({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function wv(n,i,o,c){let p=i.key;return function x(){let a=[];for(let f of i.globals){let l=f.type==="mutable_atom"?sn(n,f):f,$=An(n,l);a.push(l,$)}for(let f of i.perspectives){let{viewAtoms:l,resourceAtoms:$}=f,v=Tn(n,l,o),T=An(n,v);n.logger.info("\uD83D\uDC41","atom",$.key,`${o} can see`,{viewAtoms:l,resourceAtoms:$,userView:T});for(let F of T){let R=F.type==="mutable_atom"?sn(n,F):F,S=An(n,R);a.push(R,S)}}let m=Zn(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,m,a)}}function Av(n,i,o){let c=i.key;return function p(x){n.logger.info("\uD83D\uDECE\uFE0F","continuity",c,"received",x);let{key:a,id:m}=x,f=`tx-run:${a}:${m}`,l=`${f}:start`,$=`${f}:end`;performance.mark(l);try{to({type:"transaction",key:a},m,n)(...x.params)}catch(T){if(T instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${a} from ${o} with update ${m}`,T.message)}performance.mark($);let v=performance.measure(f,l,$);n?.logger.info("\uD83D\uDE80","transaction",a,m,o,v.duration)}}function Sv(n,i,o,c){let p=i.key;return function x(a){if(n.logger.info("\uD83D\uDC4D","continuity",p,`${o} acknowledged epoch ${a}`),c[0]?.epoch===a)Yn(n,pp,o,(f)=>{return f.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,f.length,"items"),f})}}function Fv(n,i,o,c){let p=i.key,x=[];for(let a of i.actions){let m=Vf(a,(f)=>{try{let l=i.globals.map((T)=>{if(T.type==="atom")return T.key;return jo(T).key}).concat(i.perspectives.flatMap((T)=>{let{viewAtoms:F}=T,R=Tn(n,F,o);return An(n,R).map((M)=>{return M.type==="mutable_atom"?"*"+M.key:M.key})})),$=Lf(l,f.updates),v={...f,updates:$};Yn(n,pp,o,(T)=>{if(v)T.push(v),T.sort((F,R)=>F.epoch-R.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,T.length,"items");return T}),c?.emit(`tx-new:${p}`,v)}catch(l){if(l instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${a.key} to ${o}`,l.message)}},`sync-continuity:${p}:${o}`,n);x.push(m)}return x}function Mv(n,i,o,c){let p=i.key,x=[];for(let a of i.perspectives){let{viewAtoms:m}=a,f=Tn(n,m,o),l=Si(f,({oldValue:$,newValue:v})=>{let T=$.map((M)=>M.key),F=v.map((M)=>M.key),R=$.filter((M)=>!F.includes(M.key)),S=v.filter((M)=>!T.includes(M.key)).flatMap((M)=>{let G=M.type==="mutable_atom"?sn(n,M):M,H=An(n,G);return[G,H]});if(n.logger.info("\uD83D\uDC41","atom",a.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:T,newKeys:F,revealed:S,concealed:R}),S.length>0)c?.emit(`reveal:${p}`,S);if(R.length>0)c?.emit(`conceal:${p}`,R)},`sync-continuity:${p}:${o}:perspective:${a.resourceAtoms.key}`,n);x.push(l)}return x}function Rv({socket:n,store:i=on.STORE}){return function o(c){let p=n,x=c.key,a=ip(Yc,`socket::${p.id}`,i).userKeyOfSocket,m=An(i,a);if(!m)return i.logger.error("\u274C","continuity",x,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let f=ip(Yc,m,i).socketKeyOfUser,l=Si(f,({newValue:G})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${m} on new socket ${G}`),G===null){i.logger.warn("\u274C","continuity",x,`User (${m}) is not connected to a socket, waiting for them to reappear.`);return}let H=Tn(i,za,G);p=An(i,H);for(let k of $)p?.emit(`tx-new:${x}`,k)},`sync-continuity:${x}:${m}`,i),$=An(i,pp,m),v=[],T=Mv(i,c,m,p),F=Fv(i,c,m,p);v.push(...T,...F);let R=wv(i,c,m,n);p.off(`get:${x}`,R),p.on(`get:${x}`,R);let S=Av(i,c,m);p.off(`tx-run:${x}`,S),p.on(`tx-run:${x}`,S);let M=Sv(i,c,m,$);return p?.on(`ack:${x}`,M),()=>{for(let G of v)G();p?.off(`ack:${x}`,M),p?.off(`get:${x}`,R),p?.off(`tx-run:${x}`,S)}}}var o4=Af(Al(),1);var w=Symbol.for("drizzle:entityKind"),Fu=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,w))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(w in o&&o[w]===i[w])return!0;o=Object.getPrototypeOf(o)}return!1}class On{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[w]="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 Sl{static[w]="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 Fl{static[w]="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 G1(n,this)}}class G1{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[w]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:n,columns:i,foreignColumns:o}=this.reference(),c=i.map((a)=>a.name),p=o.map((a)=>a.name),x=[this.table[vo],...c,o[0].table[vo],...p];return n??`${x.join("_")}_fk`}}function Za(n,...i){return n(...i)}function Y1(n,i){return`${n[vo]}_${i.join("_")}_unique`}function z1(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 H1(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let x=n[c];if(x===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,x==="\\"){c+=2;continue}if(x==='"'){let[f,l]=z1(n,c+1,!0);o.push(f),c=l;continue}if(x==="}")return[o,c+1];if(x==="{"){let[f,l]=H1(n,c+1);o.push(f),c=l;continue}let[a,m]=z1(n,c,!1);o.push(a),c=m}return[o,c]}function Q1(n){let[i]=H1(n,1);return i}function Ml(n){return`{${n.map((i)=>{if(Array.isArray(i))return Ml(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class I extends Sl{foreignKeyConfigs=[];static[w]="PgColumnBuilder";array(n){return new E1(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 Za((p,x)=>{let a=new Fl(()=>{let m=p();return{columns:[n],foreignColumns:[m]}});if(x.onUpdate)a.onUpdate(x.onUpdate);if(x.onDelete)a.onDelete(x.onDelete);return a.build(i)},o,c)})}buildExtraConfigColumn(n){return new O1(n,this.config)}}class _ extends On{constructor(n,i){if(!i.uniqueName)i.uniqueName=Y1(n,[i.name]);super(n,i);this.table=n}static[w]="PgColumn"}class O1 extends _{static[w]="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 Hx{static[w]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class E1 extends I{static[w]="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 Rl(n,this.config,i)}}class Rl extends _{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[w]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=Q1(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:z(this.baseColumn,Rl)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return Ml(o)}}var Wl=Symbol.for("drizzle:isPgEnum");function U1(n){return!!n&&typeof n==="function"&&Wl in n&&n[Wl]===!0}class V1 extends I{static[w]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new _1(n,this.config)}}class _1 extends _{static[w]="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 qa(n,i){return VW(n,i,void 0)}function VW(n,i,o){let c=Object.assign((p)=>new V1(p??"",c),{enumName:n,enumValues:i,schema:o,[Wl]:!0});return c}class ci{static[w]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Qx extends ci{static[w]="WithSubquery"}var u1="0.37.0";var Kl,Xl,En={startActiveSpan(n,i){if(!Kl)return i();if(!Xl)Xl=Kl.trace.getTracer("drizzle-orm",u1);return Za((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(x){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:x instanceof Error?x.message:"Unknown error"}),x}finally{p.end()}}),Kl,Xl)}};var Bn=Symbol.for("drizzle:ViewBaseConfig");var Pa=Symbol.for("drizzle:Schema"),ta=Symbol.for("drizzle:Columns"),b1=Symbol.for("drizzle:ExtraConfigColumns"),Gl=Symbol.for("drizzle:OriginalName"),Yl=Symbol.for("drizzle:BaseName"),ra=Symbol.for("drizzle:IsAlias"),j1=Symbol.for("drizzle:ExtraConfigBuilder"),_W=Symbol.for("drizzle:IsDrizzleTable");class y{static[w]="Table";static Symbol={Name:vo,Schema:Pa,OriginalName:Gl,Columns:ta,ExtraConfigColumns:b1,BaseName:Yl,IsAlias:ra,ExtraConfigBuilder:j1};[vo];[Gl];[Pa];[ta];[b1];[Yl];[ra]=!1;[_W]=!0;[j1]=void 0;constructor(n,i,o){this[vo]=this[Gl]=n,this[Pa]=i,this[Yl]=o}}function di(n){return n[vo]}function Uc(n){return`${n[Pa]??"public"}.${n[vo]}`}function zl(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function uW(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[w]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new N([this])}}class N{constructor(n){this.queryChunks=n}static[w]="SQL";decoder=y1;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return En.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:x,prepareTyping:a,inlineParams:m,paramStartIndex:f}=o;return uW(n.map((l)=>{if(z(l,pi))return{sql:l.value.join(""),params:[]};if(z(l,ga))return{sql:p(l.value),params:[]};if(l===void 0)return{sql:"",params:[]};if(Array.isArray(l)){let $=[new pi("(")];for(let[v,T]of l.entries())if($.push(T),v<l.length-1)$.push(new pi(", "));return $.push(new pi(")")),this.buildQueryFromSourceParams($,o)}if(z(l,N))return this.buildQueryFromSourceParams(l.queryChunks,{...o,inlineParams:m||l.shouldInlineParams});if(z(l,y)){let $=l[y.Symbol.Schema],v=l[y.Symbol.Name];return{sql:$===void 0?p(v):p($)+"."+p(v),params:[]}}if(z(l,On)){let $=c.getColumnCasing(l);if(i.invokeSource==="indexes")return{sql:p($),params:[]};let v=l.table[y.Symbol.Schema];return{sql:l.table[ra]||v===void 0?p(l.table[y.Symbol.Name])+"."+p($):p(v)+"."+p(l.table[y.Symbol.Name])+"."+p($),params:[]}}if(z(l,ui)){let $=l[Bn].schema,v=l[Bn].name;return{sql:$===void 0?p(v):p($)+"."+p(v),params:[]}}if(z(l,Li)){if(z(l.value,xc))return{sql:x(f.value++,l),params:[l],typings:["none"]};let $=l.value===null?null:l.encoder.mapToDriverValue(l.value);if(z($,N))return this.buildQueryFromSourceParams([$],o);if(m)return{sql:this.mapInlineParam($,o),params:[]};let v=["none"];if(a)v=[a(l.encoder)];return{sql:x(f.value++,$),params:[$],typings:v}}if(z(l,xc))return{sql:x(f.value++,l),params:[l],typings:["none"]};if(z(l,N.Aliased)&&l.fieldAlias!==void 0)return{sql:p(l.fieldAlias),params:[]};if(z(l,ci)){if(l._.isWith)return{sql:p(l._.alias),params:[]};return this.buildQueryFromSourceParams([new pi("("),l._.sql,new pi(") "),new ga(l._.alias)],o)}if(U1(l)){if(l.schema)return{sql:p(l.schema)+"."+p(l.enumName),params:[]};return{sql:p(l.enumName),params:[]}}if(zl(l)){if(l.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([l.getSQL()],o);return this.buildQueryFromSourceParams([new pi("("),l.getSQL(),new pi(")")],o)}if(m)return{sql:this.mapInlineParam(l,o),params:[]};return{sql:x(f.value++,l),params:[l],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 N.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 ga{constructor(n){this.value=n}static[w]="Name";brand;getSQL(){return new N([this])}}function B1(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var y1={mapFromDriverValue:(n)=>n},L1={mapToDriverValue:(n)=>n},xb={...y1,...L1};class Li{constructor(n,i=L1){this.value=n,this.encoder=i}static[w]="Param";brand;getSQL(){return new N([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 N(o)}((n)=>{function i(){return new N([])}n.empty=i;function o(f){return new N(f)}n.fromList=o;function c(f){return new N([new pi(f)])}n.raw=c;function p(f,l){let $=[];for(let[v,T]of f.entries()){if(v>0&&l!==void 0)$.push(l);$.push(T)}return new N($)}n.join=p;function x(f){return new ga(f)}n.identifier=x;function a(f){return new xc(f)}n.placeholder=a;function m(f,l){return new Li(f,l)}n.param=m})(A||(A={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[w]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(N||(N={}));class xc{constructor(n){this.name=n}static[w]="Placeholder";getSQL(){return new N([this])}}function Hl(n,i){return n.map((o)=>{if(z(o,xc)){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,xc)){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 ui{static[w]="View";[Bn];constructor({name:n,schema:i,selectedFields:o,query:c}){this[Bn]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new N([this])}}On.prototype.getSQL=function(){return new N([this])};y.prototype.getSQL=function(){return new N([this])};ci.prototype.getSQL=function(){return new N([this])};class Fp{constructor(n){this.table=n}static[w]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class Ox{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[w]="TableAliasProxyHandler";get(n,i){if(i===y.Symbol.IsAlias)return!0;if(i===y.Symbol.Name)return this.alias;if(this.replaceOriginalName&&i===y.Symbol.OriginalName)return this.alias;if(i===Bn)return{...n[Bn],name:this.alias,isAlias:!0};if(i===y.Symbol.Columns){let c=n[y.Symbol.Columns];if(!c)return c;let p={};return Object.keys(c).map((x)=>{p[x]=new Proxy(c[x],new Fp(new Proxy(n,this)))}),p}let o=n[i];if(z(o,On))return new Proxy(o,new Fp(new Proxy(n,this)));return o}}function da(n,i){return new Proxy(n,new Ox(i,!1))}function Ho(n,i){return new Proxy(n,new Fp(new Proxy(n.table,new Ox(i,!1))))}function Ql(n,i){return new N.Aliased(Ex(n.sql,i),n.fieldAlias)}function Ex(n,i){return A.join(n.queryChunks.map((o)=>{if(z(o,On))return Ho(o,i);if(z(o,N))return Ex(o,i);if(z(o,N.Aliased))return Ql(o,i);return o}))}class ea extends Error{static[w]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Ol extends ea{static[w]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function bi(n,i){if(B1(i)&&!zl(n)&&!z(n,Li)&&!z(n,xc)&&!z(n,On)&&!z(n,y)&&!z(n,ui))return new Li(n,i);return n}var Qo=(n,i)=>{return A`${n} = ${bi(i,n)}`},N1=(n,i)=>{return A`${n} <> ${bi(i,n)}`};function Vc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new pi("("),A.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 N(i);return new N([new pi("("),A.join(i,new pi(" or ")),new pi(")")])}function C1(n){return A`not ${n}`}var nm=(n,i)=>{return A`${n} > ${bi(i,n)}`},h1=(n,i)=>{return A`${n} >= ${bi(i,n)}`},I1=(n,i)=>{return A`${n} < ${bi(i,n)}`},k1=(n,i)=>{return A`${n} <= ${bi(i,n)}`};function s1(n,i){if(Array.isArray(i)){if(i.length===0)return A`false`;return A`${n} in ${i.map((o)=>bi(o,n))}`}return A`${n} in ${bi(i,n)}`}function Z1(n,i){if(Array.isArray(i)){if(i.length===0)return A`true`;return A`${n} not in ${i.map((o)=>bi(o,n))}`}return A`${n} not in ${bi(i,n)}`}function q1(n){return A`${n} is null`}function P1(n){return A`${n} is not null`}function t1(n){return A`exists ${n}`}function r1(n){return A`not exists ${n}`}function g1(n,i,o){return A`${n} between ${bi(i,n)} and ${bi(o,n)}`}function d1(n,i,o){return A`${n} not between ${bi(i,n)} and ${bi(o,n)}`}function e1(n,i){return A`${n} like ${i}`}function nJ(n,i){return A`${n} not like ${i}`}function iJ(n,i){return A`${n} ilike ${i}`}function oJ(n,i){return A`${n} not ilike ${i}`}function cJ(n){return A`${n} asc`}function pJ(n){return A`${n} desc`}class xJ{static[w]="ConsoleLogWriter";write(n){console.log(n)}}class El{static[w]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new xJ}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 Ul{static[w]="NoopLogger";logQuery(){}}class Qi{static[w]="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 aJ(n,i,o){let c={},p=n.reduce((x,{path:a,field:m},f)=>{let l;if(z(m,On))l=m;else if(z(m,N))l=m.decoder;else l=m.sql.decoder;let $=x;for(let[v,T]of a.entries())if(v<a.length-1){if(!(T in $))$[T]={};$=$[T]}else{let F=i[f],R=$[T]=F===null?null:l.mapFromDriverValue(F);if(o&&z(m,On)&&a.length===2){let S=a[0];if(!(S in c))c[S]=R===null?di(m.table):!1;else if(typeof c[S]==="string"&&c[S]!==di(m.table))c[S]=!1}}return x},{});if(o&&Object.keys(c).length>0){for(let[x,a]of Object.entries(c))if(typeof a==="string"&&!o[a])p[x]=null}return p}function ei(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(z(p,On)||z(p,N)||z(p,N.Aliased))o.push({path:x,field:p});else if(z(p,y))o.push(...ei(p[y.Symbol.Columns],x));else o.push(...ei(p,x));return o},[])}function Ux(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,x]of o.entries())if(x!==c[p])return!1;return!0}function im(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(z(p,N)||z(p,On))return[c,p];else return[c,new Li(p,n[y.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function mJ(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 fJ(n){return n[y.Symbol.Columns]}function yo(n){return z(n,ci)?n._.alias:z(n,ui)?n[Bn].name:z(n,N)?void 0:n[y.Symbol.IsAlias]?n[y.Symbol.Name]:n[y.Symbol.BaseName]}function Jn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function lJ(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[w]="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 $J extends ac{static[w]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new vJ(n,this.config)}}class vJ extends _{static[w]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class TJ extends ac{static[w]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new JJ(n,this.config)}}class JJ extends _{static[w]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function wJ(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new $J(o);return new TJ(o)}class AJ extends I{static[w]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new SJ(n,this.config)}}class SJ extends _{static[w]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class FJ extends I{static[w]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new MJ(n,this.config)}}class MJ extends _{static[w]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function RJ(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new AJ(o);return new FJ(o)}class WJ extends I{static[w]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new KJ(n,this.config)}}class KJ extends _{static[w]="PgBoolean";getSQLType(){return"boolean"}}function Vx(n){return new WJ(n??"")}class XJ extends I{static[w]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new GJ(n,this.config)}}class GJ extends _{static[w]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function YJ(n,i={}){let{name:o,config:c}=Jn(n,i);return new XJ(o,c)}class zJ extends I{static[w]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new HJ(n,this.config)}}class HJ extends _{static[w]="PgCidr";getSQLType(){return"cidr"}}function QJ(n){return new zJ(n??"")}class OJ extends I{static[w]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new EJ(n,this.config)}}class EJ extends _{static[w]="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 UJ(n){return(i,o)=>{let{name:c,config:p}=Jn(i,o);return new OJ(c,p,n)}}class Lo extends I{static[w]="PgDateColumnBaseBuilder";defaultNow(){return this.default(A`now()`)}}class VJ extends Lo{static[w]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new om(n,this.config)}}class om extends _{static[w]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class _J extends Lo{static[w]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new cm(n,this.config)}}class cm extends _{static[w]="PgDateString";getSQLType(){return"date"}}function uJ(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new VJ(o);return new _J(o)}class bJ extends I{static[w]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new jJ(n,this.config)}}class jJ extends _{static[w]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function BJ(n){return new bJ(n??"")}class yJ extends I{static[w]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new LJ(n,this.config)}}class LJ extends _{static[w]="PgInet";getSQLType(){return"inet"}}function NJ(n){return new yJ(n??"")}class DJ extends ac{static[w]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new CJ(n,this.config)}}class CJ extends _{static[w]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function pm(n){return new DJ(n??"")}class hJ extends I{static[w]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new IJ(n,this.config)}}class IJ extends _{static[w]="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 kJ(n,i={}){let{name:o,config:c}=Jn(n,i);return new hJ(o,c)}class sJ extends I{static[w]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new xm(n,this.config)}}class xm extends _{static[w]="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 ZJ(n){return new sJ(n??"")}class qJ extends I{static[w]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new am(n,this.config)}}class am extends _{static[w]="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 PJ(n){return new qJ(n??"")}class tJ extends I{static[w]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new rJ(n,this.config)}}class rJ extends _{static[w]="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 gJ extends I{static[w]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new dJ(n,this.config)}}class dJ extends _{static[w]="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 eJ(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new tJ(o);return new gJ(o)}class nw extends I{static[w]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new iw(n,this.config)}}class iw extends _{static[w]="PgMacaddr";getSQLType(){return"macaddr"}}function ow(n){return new nw(n??"")}class cw extends I{static[w]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new pw(n,this.config)}}class pw extends _{static[w]="PgMacaddr8";getSQLType(){return"macaddr8"}}function xw(n){return new cw(n??"")}class aw extends I{static[w]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new mm(n,this.config)}}class mm extends _{static[w]="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 mw(n,i){let{name:o,config:c}=Jn(n,i);return new aw(o,c?.precision,c?.scale)}class fw extends I{static[w]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new lw(n,this.config)}}class lw extends _{static[w]="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 $w extends I{static[w]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new vw(n,this.config)}}class vw extends _{static[w]="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 Tw(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new fw(o);return new $w(o)}function bW(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 Jw(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 Vl(n){let i=bW(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),x=p.getUint32(o,c===1);o+=4;let a;if(x&536870912)a=p.getUint32(o,c===1),o+=4;if((x&65535)===1){let m=Jw(i,o);o+=8;let f=Jw(i,o);return o+=8,[m,f]}throw new Error("Unsupported geometry type")}class ww extends I{static[w]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new Aw(n,this.config)}}class Aw extends _{static[w]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return Vl(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class Sw extends I{static[w]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new Fw(n,this.config)}}class Fw extends _{static[w]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=Vl(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function Mw(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new ww(o);return new Sw(o)}class Rw extends I{static[w]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new Ww(n,this.config)}}class Ww extends _{static[w]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function Kw(n){return new Rw(n??"")}class Xw extends I{static[w]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new Gw(n,this.config)}}class Gw extends _{static[w]="PgSerial";getSQLType(){return"serial"}}function Yw(n){return new Xw(n??"")}class zw extends ac{static[w]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new Hw(n,this.config)}}class Hw extends _{static[w]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function Qw(n){return new zw(n??"")}class Ow extends I{static[w]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new Ew(n,this.config)}}class Ew extends _{static[w]="PgSmallSerial";getSQLType(){return"smallserial"}}function Uw(n){return new Ow(n??"")}class Vw extends I{static[w]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new _w(n,this.config)}}class _w extends _{static[w]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function uw(n,i={}){let{name:o,config:c}=Jn(n,i);return new Vw(o,c)}class bw extends Lo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[w]="PgTimeBuilder";build(n){return new fm(n,this.config)}}class fm extends _{static[w]="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 jw(n,i={}){let{name:o,config:c}=Jn(n,i);return new bw(o,c.withTimezone??!1,c.precision)}class Bw extends Lo{static[w]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new lm(n,this.config)}}class lm extends _{static[w]="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 yw extends Lo{static[w]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new $m(n,this.config)}}class $m extends _{static[w]="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}=Jn(n,i);if(c?.mode==="string")return new yw(o,c.withTimezone??!1,c.precision);return new Bw(o,c?.withTimezone??!1,c?.precision)}class Lw extends I{static[w]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(A`gen_random_uuid()`)}build(n){return new vm(n,this.config)}}class vm extends _{static[w]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new Lw(n??"")}class Nw extends I{static[w]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new Dw(n,this.config)}}class Dw extends _{static[w]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function li(n,i={}){let{name:o,config:c}=Jn(n,i);return new Nw(o,c)}class Cw extends I{static[w]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new hw(n,this.config)}}class hw extends _{static[w]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function Iw(n,i){let{name:o,config:c}=Jn(n,i);return new Cw(o,c)}class kw extends I{static[w]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new sw(n,this.config)}}class sw extends _{static[w]="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 Zw(n,i){let{name:o,config:c}=Jn(n,i);return new kw(o,c)}class qw extends I{static[w]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new Pw(n,this.config)}}class Pw extends _{static[w]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function tw(n,i){let{name:o,config:c}=Jn(n,i);return new qw(o,c)}class rw extends I{static[w]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new gw(n,this.config)}}class gw extends _{static[w]="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 dw(n,i){let{name:o,config:c}=Jn(n,i);return new rw(o,c)}function ew(){return{bigint:wJ,bigserial:RJ,boolean:Vx,char:YJ,cidr:QJ,customType:UJ,date:uJ,doublePrecision:BJ,inet:NJ,integer:pm,interval:kJ,json:ZJ,jsonb:PJ,line:eJ,macaddr:ow,macaddr8:xw,numeric:mw,point:Tw,geometry:Mw,real:Kw,serial:Yw,smallint:Qw,smallserial:Uw,text:uw,time:jw,timestamp:To,uuid:Ni,varchar:li,bit:Iw,halfvec:Zw,sparsevec:tw,vector:dw}}var _l=Symbol.for("drizzle:PgInlineForeignKeys"),nA=Symbol.for("drizzle:EnableRLS");class $i extends y{static[w]="PgTable";static Symbol=Object.assign({},y.Symbol,{InlineForeignKeys:_l,EnableRLS:nA});[_l]=[];[nA]=!1;[y.Symbol.ExtraConfigBuilder]=void 0}function jW(n,i,o,c,p=n){let x=new $i(n,c,p),a=typeof i==="function"?i(ew()):i,m=Object.fromEntries(Object.entries(a).map(([$,v])=>{let T=v;T.setName($);let F=T.build(x);return x[_l].push(...T.buildForeignKeys(F,x)),[$,F]})),f=Object.fromEntries(Object.entries(a).map(([$,v])=>{let T=v;T.setName($);let F=T.buildExtraConfigColumn(x);return[$,F]})),l=Object.assign(x,m);if(l[y.Symbol.Columns]=m,l[y.Symbol.ExtraConfigColumns]=f,o)l[$i.Symbol.ExtraConfigBuilder]=o;return Object.assign(l,{enableRLS:()=>{return l[$i.Symbol.EnableRLS]=!0,l}})}var mc=(n,i,o)=>{return jW(n,i,o,void 0)};function iA(...n){if(n[0].columns)return new _x(n[0].columns,n[0].name);return new _x(n)}class _x{static[w]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new oA(n,this.columns,this.name)}}class oA{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[w]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[$i.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class ul{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[y.Symbol.Name]}static[w]="Relation";referencedTableName;fieldName}class cA{constructor(n,i){this.table=n,this.config=i}static[w]="Relations"}class fc extends ul{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[w]="One";withFieldName(n){let i=new fc(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class ux extends ul{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[w]="Many";withFieldName(n){let i=new ux(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function pA(){return{and:Vc,between:g1,eq:Qo,exists:t1,gt:nm,gte:h1,ilike:iJ,inArray:s1,isNull:q1,isNotNull:P1,like:e1,lt:I1,lte:k1,ne:N1,not:C1,notBetween:d1,notExists:r1,notLike:nJ,notIlike:oJ,notInArray:Z1,or:D1,sql:A}}function xA(){return{sql:A,asc:cJ,desc:pJ}}function aA(n,i){if(Object.keys(n).length===1&&"default"in n&&!z(n.default,y))n=n.default;let o={},c={},p={};for(let[x,a]of Object.entries(n))if(z(a,y)){let m=Uc(a),f=c[m];o[m]=x,p[x]={tsName:x,dbName:a[y.Symbol.Name],schema:a[y.Symbol.Schema],columns:a[y.Symbol.Columns],relations:f?.relations??{},primaryKey:f?.primaryKey??[]};for(let $ of Object.values(a[y.Symbol.Columns]))if($.primary)p[x].primaryKey.push($);let l=a[y.Symbol.ExtraConfigBuilder]?.(a[y.Symbol.ExtraConfigColumns]);if(l){for(let $ of Object.values(l))if(z($,_x))p[x].primaryKey.push(...$.columns)}}else if(z(a,cA)){let m=Uc(a.table),f=o[m],l=a.config(i(a.table)),$;for(let[v,T]of Object.entries(l))if(f){let F=p[f];if(F.relations[v]=T,$)F.primaryKey.push(...$)}else{if(!(m in c))c[m]={relations:{},primaryKey:$};c[m].relations[v]=T}}return{tables:p,tableNamesMap:o}}function BW(n){return function i(o,c){return new fc(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function yW(n){return function i(o,c){return new ux(n,o,c)}}function mA(n,i,o){if(z(o,fc)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Uc(o.referencedTable)];if(!c)throw new Error(`Table "${o.referencedTable[y.Symbol.Name]}" not found in schema`);let p=n[c];if(!p)throw new Error(`Table "${c}" not found in schema`);let x=o.sourceTable,a=i[Uc(x)];if(!a)throw new Error(`Table "${x[y.Symbol.Name]}" not found in schema`);let m=[];for(let f of Object.values(p.relations))if(o.relationName&&o!==f&&f.relationName===o.relationName||!o.relationName&&f.referencedTable===o.sourceTable)m.push(f);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[y.Symbol.Name]}". Please specify relation name`);if(m[0]&&z(m[0],fc)&&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 "${a}.${o.fieldName}"`)}function fA(n){return{one:BW(n),many:yW(n)}}function Tm(n,i,o,c,p=(x)=>x){let x={};for(let[a,m]of c.entries())if(m.isJson){let f=i.relations[m.tsKey],l=o[a],$=typeof l==="string"?JSON.parse(l):l;x[m.tsKey]=z(f,fc)?$&&Tm(n,n[m.relationTableTsKey],$,m.selection,p):$.map((v)=>Tm(n,n[m.relationTableTsKey],v,m.selection,p))}else{let f=p(o[a]),l=m.field,$;if(z(l,On))$=l;else if(z(l,N))$=l.decoder;else $=l.sql.decoder;x[m.tsKey]=f===null?null:$.mapFromDriverValue(f)}return x}var tM=Af(PM(),1),{Server:rM,Namespace:aN,Socket:mN}=tM.default;import{readFileSync as $R}from"fs";import{resolve as u$}from"path";var Fn;(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 x={};for(let a of p)x[a]=a;return x},n.getValidEnumValues=(p)=>{let x=n.objectKeys(p).filter((m)=>typeof p[p[m]]!=="number"),a={};for(let m of x)a[m]=p[m];return n.objectValues(a)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(x){return p[x]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let x=[];for(let a in p)if(Object.prototype.hasOwnProperty.call(p,a))x.push(a);return x},n.find=(p,x)=>{for(let a of p)if(x(a))return a;return},n.isInteger=typeof Number.isInteger==="function"?(p)=>Number.isInteger(p):(p)=>typeof p==="number"&&isFinite(p)&&Math.floor(p)===p;function c(p,x=" | "){return p.map((a)=>typeof a==="string"?`'${a}'`:a).join(x)}n.joinValues=c,n.jsonStringifyReplacer=(p,x)=>{if(typeof x==="bigint")return x.toString();return x}})(Fn||(Fn={}));var E$;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(E$||(E$={}));var D=Fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jc=(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}},E=Fn.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"]),_5=(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 x of p.issues)if(x.code==="invalid_union")x.unionErrors.map(c);else if(x.code==="invalid_return_type")c(x.returnTypeError);else if(x.code==="invalid_arguments")c(x.argumentsError);else if(x.path.length===0)o._errors.push(i(x));else{let a=o,m=0;while(m<x.path.length){let f=x.path[m];if(m!==x.path.length-1)a[f]=a[f]||{_errors:[]};else a[f]=a[f]||{_errors:[]},a[f]._errors.push(i(x));a=a[f],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,Fn.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 Bp=(n,i)=>{let o;switch(n.code){case E.invalid_type:if(n.received===D.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case E.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Fn.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:o=`Unrecognized key(s) in object: ${Fn.joinValues(n.keys,", ")}`;break;case E.invalid_union:o="Invalid input";break;case E.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Fn.joinValues(n.options)}`;break;case E.invalid_enum_value:o=`Invalid enum value. Expected ${Fn.joinValues(n.options)}, received '${n.received}'`;break;case E.invalid_arguments:o="Invalid function arguments";break;case E.invalid_return_type:o="Invalid function return type";break;case E.invalid_date:o="Invalid date";break;case E.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 Fn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case E.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 E.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 E.custom:o="Invalid input";break;case E.invalid_intersection_types:o="Intersection results could not be merged";break;case E.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case E.not_finite:o="Number must be finite";break;default:o=i.defaultError,Fn.assertNever(n)}return{message:o}},eM=Bp;function u5(n){eM=n}function Lm(){return eM}var Nm=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,x=[...o,...p.path||[]],a={...p,path:x};if(p.message!==void 0)return{...p,path:x,message:p.message};let m="",f=c.filter((l)=>!!l).slice().reverse();for(let l of f)m=l(a,{data:i,defaultError:m}).message;return{...p,path:x,message:m}},b5=[];function L(n,i){let o=Lm(),c=Nm({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===Bp?void 0:Bp].filter((p)=>!!p)});n.common.issues.push(c)}class Gi{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,x=await c.value;o.push({key:p,value:x})}return Gi.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:x}=c;if(p.status==="aborted")return nn;if(x.status==="aborted")return nn;if(p.status==="dirty")n.dirty();if(x.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof x.value!=="undefined"||c.alwaysSet))o[p.value]=x.value}return{status:n.value,value:o}}}var nn=Object.freeze({status:"aborted"}),bp=(n)=>({status:"dirty",value:n}),Ei=(n)=>({status:"valid",value:n}),U$=(n)=>n.status==="aborted",V$=(n)=>n.status==="dirty",Ix=(n)=>n.status==="valid",kx=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function Dm(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 nR(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 Z;(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})(Z||(Z={}));var Cx,hx;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 gM=(n,i)=>{if(Ix(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 mn(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:(a,m)=>{var f,l;let{message:$}=n;if(a.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:m.defaultError};if(typeof m.data==="undefined")return{message:(f=$!==null&&$!==void 0?$:c)!==null&&f!==void 0?f:m.defaultError};if(a.code!=="invalid_type")return{message:m.defaultError};return{message:(l=$!==null&&$!==void 0?$:o)!==null&&l!==void 0?l:m.defaultError}},description:p}}class fn{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 Jc(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Jc(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Gi,ctx:{common:n.parent.common,data:n.data,parsedType:Jc(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(kx(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:Jc(n)},p=this._parseSync({data:n,path:c.path,parent:c});return gM(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:Jc(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(kx(c)?c:Promise.resolve(c));return gM(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 x=n(c),a=()=>p.addIssue({code:E.custom,...o(c)});if(typeof Promise!=="undefined"&&x instanceof Promise)return x.then((m)=>{if(!m)return a(),!1;else return!0});if(!x)return a(),!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:d.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}optional(){return Ro.create(this,this._def)}nullable(){return Io.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mo.create(this,this._def)}promise(){return Ic.create(this,this._def)}or(n){return Dp.create([this,n],this._def)}and(n){return Cp.create(this,n,this._def)}transform(n){return new oo({...mn(this._def),schema:this,typeName:d.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new sp({...mn(this._def),innerType:this,defaultValue:i,typeName:d.ZodDefault})}brand(){return new hm({typeName:d.ZodBranded,type:this,...mn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new Zp({...mn(this._def),innerType:this,catchValue:i,typeName:d.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return rx.create(this,n)}readonly(){return qp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var j5=/^c[^\s-]{8,}$/i,B5=/^[0-9a-z]+$/,y5=/^[0-9A-HJKMNP-TV-Z]{26}$/,L5=/^[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,N5=/^[a-z0-9_-]{21}$/i,D5=/^[-+]?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)?)??$/,C5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,h5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",O$,I5=/^(?:(?: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])$/,k5=/^(([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})))$/,s5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iR="((\\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])))",Z5=new RegExp(`^${iR}$`);function oR(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 q5(n){return new RegExp(`^${oR(n)}$`)}function cR(n){let i=`${iR}T${oR(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 P5(n,i){if((i==="v4"||!i)&&I5.test(n))return!0;if((i==="v6"||!i)&&k5.test(n))return!0;return!1}class Fo extends fn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==D.string){let p=this._getOrReturnCtx(n);return L(p,{code:E.invalid_type,expected:D.string,received:p.parsedType}),nn}let o=new Gi,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),L(c,{code:E.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),L(c,{code:E.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let x=n.data.length>p.value,a=n.data.length<p.value;if(x||a){if(c=this._getOrReturnCtx(n,c),x)L(c,{code:E.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(a)L(c,{code:E.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!C5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"email",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!O$)O$=new RegExp(h5,"u");if(!O$.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"emoji",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!L5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"uuid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!N5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"nanoid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!j5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!B5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid2",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!y5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"ulid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(x){c=this._getOrReturnCtx(n,c),L(c,{validation:"url",code:E.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),L(c,{validation:"regex",code:E.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),L(c,{code:E.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),L(c,{code:E.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),L(c,{code:E.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),L(c,{code:E.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!Z5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:E.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!q5(p).test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:E.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!D5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"duration",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!P5(n.data,p.version))c=this._getOrReturnCtx(n,c),L(c,{validation:"ip",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!s5.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"base64",code:E.invalid_string,message:p.message}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:E.invalid_string,...Z.errToObj(o)})}_addCheck(n){return new Fo({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...Z.errToObj(n)})}url(n){return this._addCheck({kind:"url",...Z.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...Z.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...Z.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...Z.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...Z.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...Z.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...Z.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...Z.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...Z.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,...Z.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,...Z.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...Z.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...Z.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...Z.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...Z.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...Z.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...Z.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...Z.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...Z.errToObj(i)})}nonempty(n){return this.min(1,Z.errToObj(n))}trim(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fo({...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}}Fo.create=(n)=>{var i;return new Fo({checks:[],typeName:d.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...mn(n)})};function t5(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,x=parseInt(n.toFixed(p).replace(".","")),a=parseInt(i.toFixed(p).replace(".",""));return x%a/Math.pow(10,p)}class Ac extends fn{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 L(p,{code:E.invalid_type,expected:D.number,received:p.parsedType}),nn}let o=void 0,c=new Gi;for(let p of this._def.checks)if(p.kind==="int"){if(!Fn.isInteger(n.data))o=this._getOrReturnCtx(n,o),L(o,{code:E.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),L(o,{code:E.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),L(o,{code:E.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(t5(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),L(o,{code:E.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),L(o,{code:E.not_finite,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,Z.toString(i))}gt(n,i){return this.setLimit("min",n,!1,Z.toString(i))}lte(n,i){return this.setLimit("max",n,!0,Z.toString(i))}lt(n,i){return this.setLimit("max",n,!1,Z.toString(i))}setLimit(n,i,o,c){return new Ac({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:Z.toString(c)}]})}_addCheck(n){return new Ac({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:Z.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:Z.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:Z.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.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"&&Fn.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)}}Ac.create=(n)=>{return new Ac({checks:[],typeName:d.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...mn(n)})};class Sc extends fn{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 L(p,{code:E.invalid_type,expected:D.bigint,received:p.parsedType}),nn}let o=void 0,c=new Gi;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),L(o,{code:E.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),L(o,{code:E.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),L(o,{code:E.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,Z.toString(i))}gt(n,i){return this.setLimit("min",n,!1,Z.toString(i))}lte(n,i){return this.setLimit("max",n,!0,Z.toString(i))}lt(n,i){return this.setLimit("max",n,!1,Z.toString(i))}setLimit(n,i,o,c){return new Sc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:Z.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:Z.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:Z.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:d.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...mn(n)})};class yp extends fn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==D.boolean){let o=this._getOrReturnCtx(n);return L(o,{code:E.invalid_type,expected:D.boolean,received:o.parsedType}),nn}return Ei(n.data)}}yp.create=(n)=>{return new yp({typeName:d.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...mn(n)})};class Dc extends fn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==D.date){let p=this._getOrReturnCtx(n);return L(p,{code:E.invalid_type,expected:D.date,received:p.parsedType}),nn}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return L(p,{code:E.invalid_date}),nn}let o=new Gi,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),L(c,{code:E.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),L(c,{code:E.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Dc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:Z.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:Z.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}}Dc.create=(n)=>{return new Dc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:d.ZodDate,...mn(n)})};class sx extends fn{_parse(n){if(this._getType(n)!==D.symbol){let o=this._getOrReturnCtx(n);return L(o,{code:E.invalid_type,expected:D.symbol,received:o.parsedType}),nn}return Ei(n.data)}}sx.create=(n)=>{return new sx({typeName:d.ZodSymbol,...mn(n)})};class Lp extends fn{_parse(n){if(this._getType(n)!==D.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:E.invalid_type,expected:D.undefined,received:o.parsedType}),nn}return Ei(n.data)}}Lp.create=(n)=>{return new Lp({typeName:d.ZodUndefined,...mn(n)})};class Np extends fn{_parse(n){if(this._getType(n)!==D.null){let o=this._getOrReturnCtx(n);return L(o,{code:E.invalid_type,expected:D.null,received:o.parsedType}),nn}return Ei(n.data)}}Np.create=(n)=>{return new Np({typeName:d.ZodNull,...mn(n)})};class Cc extends fn{constructor(){super(...arguments);this._any=!0}_parse(n){return Ei(n.data)}}Cc.create=(n)=>{return new Cc({typeName:d.ZodAny,...mn(n)})};class wc extends fn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Ei(n.data)}}wc.create=(n)=>{return new wc({typeName:d.ZodUnknown,...mn(n)})};class Eo extends fn{_parse(n){let i=this._getOrReturnCtx(n);return L(i,{code:E.invalid_type,expected:D.never,received:i.parsedType}),nn}}Eo.create=(n)=>{return new Eo({typeName:d.ZodNever,...mn(n)})};class Zx extends fn{_parse(n){if(this._getType(n)!==D.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:E.invalid_type,expected:D.void,received:o.parsedType}),nn}return Ei(n.data)}}Zx.create=(n)=>{return new Zx({typeName:d.ZodVoid,...mn(n)})};class Mo extends fn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==D.array)return L(i,{code:E.invalid_type,expected:D.array,received:i.parsedType}),nn;if(c.exactLength!==null){let x=i.data.length>c.exactLength.value,a=i.data.length<c.exactLength.value;if(x||a)L(i,{code:x?E.too_big:E.too_small,minimum:a?c.exactLength.value:void 0,maximum:x?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)L(i,{code:E.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)L(i,{code:E.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((x,a)=>{return c.type._parseAsync(new Wo(i,x,i.path,a))})).then((x)=>{return Gi.mergeArray(o,x)});let p=[...i.data].map((x,a)=>{return c.type._parseSync(new Wo(i,x,i.path,a))});return Gi.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Mo({...this._def,minLength:{value:n,message:Z.toString(i)}})}max(n,i){return new Mo({...this._def,maxLength:{value:n,message:Z.toString(i)}})}length(n,i){return new Mo({...this._def,exactLength:{value:n,message:Z.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:d.ZodArray,...mn(i)})};function up(n){if(n instanceof hn){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=Ro.create(up(c))}return new hn({...n._def,shape:()=>i})}else if(n instanceof Mo)return new Mo({...n._def,type:up(n.element)});else if(n instanceof Ro)return Ro.create(up(n.unwrap()));else if(n instanceof Io)return Io.create(up(n.unwrap()));else if(n instanceof Uo)return Uo.create(n.items.map((i)=>up(i)));else return n}class hn extends fn{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=Fn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==D.object){let f=this._getOrReturnCtx(n);return L(f,{code:E.invalid_type,expected:D.object,received:f.parsedType}),nn}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),a=[];if(!(this._def.catchall instanceof Eo&&this._def.unknownKeys==="strip")){for(let f in c.data)if(!x.includes(f))a.push(f)}let m=[];for(let f of x){let l=p[f],$=c.data[f];m.push({key:{status:"valid",value:f},value:l._parse(new Wo(c,$,c.path,f)),alwaysSet:f in c.data})}if(this._def.catchall instanceof Eo){let f=this._def.unknownKeys;if(f==="passthrough")for(let l of a)m.push({key:{status:"valid",value:l},value:{status:"valid",value:c.data[l]}});else if(f==="strict"){if(a.length>0)L(c,{code:E.unrecognized_keys,keys:a}),o.dirty()}else if(f==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let l of a){let $=c.data[l];m.push({key:{status:"valid",value:l},value:f._parse(new Wo(c,$,c.path,l)),alwaysSet:l in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let f=[];for(let l of m){let $=await l.key,v=await l.value;f.push({key:$,value:v,alwaysSet:l.alwaysSet})}return f}).then((f)=>{return Gi.mergeObjectSync(o,f)});else return Gi.mergeObjectSync(o,m)}get shape(){return this._def.shape()}strict(n){return Z.errToObj,new hn({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,a;let m=(x=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&x!==void 0?x:o.defaultError;if(i.code==="unrecognized_keys")return{message:(a=Z.errToObj(n).message)!==null&&a!==void 0?a:m};return{message:m}}}:{}})}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:d.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new hn({...this._def,catchall:n})}pick(n){let i={};return Fn.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 Fn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new hn({...this._def,shape:()=>i})}deepPartial(){return up(this)}partial(n){let i={};return Fn.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 Fn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof Ro)p=p._def.innerType;i[o]=p}}),new hn({...this._def,shape:()=>i})}keyof(){return pR(Fn.objectKeys(this.shape))}}hn.create=(n,i)=>{return new hn({shape:()=>n,unknownKeys:"strip",catchall:Eo.create(),typeName:d.ZodObject,...mn(i)})};hn.strictCreate=(n,i)=>{return new hn({shape:()=>n,unknownKeys:"strict",catchall:Eo.create(),typeName:d.ZodObject,...mn(i)})};hn.lazycreate=(n,i)=>{return new hn({shape:n,unknownKeys:"strip",catchall:Eo.create(),typeName:d.ZodObject,...mn(i)})};class Dp extends fn{_parse(n){let{ctx:i}=this._processInputParams(n),o=this._def.options;function c(p){for(let a of p)if(a.result.status==="valid")return a.result;for(let a of p)if(a.result.status==="dirty")return i.common.issues.push(...a.ctx.common.issues),a.result;let x=p.map((a)=>new Ii(a.ctx.common.issues));return L(i,{code:E.invalid_union,unionErrors:x}),nn}if(i.common.async)return Promise.all(o.map(async(p)=>{let x={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:x}),ctx:x}})).then(c);else{let p=void 0,x=[];for(let m of o){let f={...i,common:{...i.common,issues:[]},parent:null},l=m._parseSync({data:i.data,path:i.path,parent:f});if(l.status==="valid")return l;else if(l.status==="dirty"&&!p)p={result:l,ctx:f};if(f.common.issues.length)x.push(f.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let a=x.map((m)=>new Ii(m));return L(i,{code:E.invalid_union,unionErrors:a}),nn}}get options(){return this._def.options}}Dp.create=(n,i)=>{return new Dp({options:n,typeName:d.ZodUnion,...mn(i)})};var ho=(n)=>{if(n instanceof hp)return ho(n.schema);else if(n instanceof oo)return ho(n.innerType());else if(n instanceof Ip)return[n.value];else if(n instanceof Fc)return n.options;else if(n instanceof kp)return Fn.objectValues(n.enum);else if(n instanceof sp)return ho(n._def.innerType);else if(n instanceof Lp)return[void 0];else if(n instanceof Np)return[null];else if(n instanceof Ro)return[void 0,...ho(n.unwrap())];else if(n instanceof Io)return[null,...ho(n.unwrap())];else if(n instanceof hm)return ho(n.unwrap());else if(n instanceof qp)return ho(n.unwrap());else if(n instanceof Zp)return ho(n._def.innerType);else return[]};class Cm extends fn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.object)return L(i,{code:E.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 L(i,{code:E.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 x=ho(p.shape[n]);if(!x.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let a of x){if(c.has(a))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(a)}`);c.set(a,p)}}return new Cm({typeName:d.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...mn(o)})}}function _$(n,i){let o=Jc(n),c=Jc(i);if(n===i)return{valid:!0,data:n};else if(o===D.object&&c===D.object){let p=Fn.objectKeys(i),x=Fn.objectKeys(n).filter((m)=>p.indexOf(m)!==-1),a={...n,...i};for(let m of x){let f=_$(n[m],i[m]);if(!f.valid)return{valid:!1};a[m]=f.data}return{valid:!0,data:a}}else if(o===D.array&&c===D.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let x=0;x<n.length;x++){let a=n[x],m=i[x],f=_$(a,m);if(!f.valid)return{valid:!1};p.push(f.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 Cp extends fn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,x)=>{if(U$(p)||U$(x))return nn;let a=_$(p.value,x.value);if(!a.valid)return L(o,{code:E.invalid_intersection_types}),nn;if(V$(p)||V$(x))i.dirty();return{status:i.value,value:a.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,x])=>c(p,x));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}))}}Cp.create=(n,i,o)=>{return new Cp({left:n,right:i,typeName:d.ZodIntersection,...mn(o)})};class Uo extends fn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.array)return L(o,{code:E.invalid_type,expected:D.array,received:o.parsedType}),nn;if(o.data.length<this._def.items.length)return L(o,{code:E.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)L(o,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((x,a)=>{let m=this._def.items[a]||this._def.rest;if(!m)return null;return m._parse(new Wo(o,x,o.path,a))}).filter((x)=>!!x);if(o.common.async)return Promise.all(p).then((x)=>{return Gi.mergeArray(i,x)});else return Gi.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new Uo({...this._def,rest:n})}}Uo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Uo({items:n,typeName:d.ZodTuple,rest:null,...mn(i)})};class qx extends fn{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 L(o,{code:E.invalid_type,expected:D.object,received:o.parsedType}),nn;let c=[],p=this._def.keyType,x=this._def.valueType;for(let a in o.data)c.push({key:p._parse(new Wo(o,a,o.path,a)),value:x._parse(new Wo(o,o.data[a],o.path,a)),alwaysSet:a in o.data});if(o.common.async)return Gi.mergeObjectAsync(i,c);else return Gi.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof fn)return new qx({keyType:n,valueType:i,typeName:d.ZodRecord,...mn(o)});return new qx({keyType:Fo.create(),valueType:n,typeName:d.ZodRecord,...mn(i)})}}class Px extends fn{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 L(o,{code:E.invalid_type,expected:D.map,received:o.parsedType}),nn;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([a,m],f)=>{return{key:c._parse(new Wo(o,a,o.path,[f,"key"])),value:p._parse(new Wo(o,m,o.path,[f,"value"]))}});if(o.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let m of x){let f=await m.key,l=await m.value;if(f.status==="aborted"||l.status==="aborted")return nn;if(f.status==="dirty"||l.status==="dirty")i.dirty();a.set(f.value,l.value)}return{status:i.value,value:a}})}else{let a=new Map;for(let m of x){let{key:f,value:l}=m;if(f.status==="aborted"||l.status==="aborted")return nn;if(f.status==="dirty"||l.status==="dirty")i.dirty();a.set(f.value,l.value)}return{status:i.value,value:a}}}}Px.create=(n,i,o)=>{return new Px({valueType:i,keyType:n,typeName:d.ZodMap,...mn(o)})};class hc extends fn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.set)return L(o,{code:E.invalid_type,expected:D.set,received:o.parsedType}),nn;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)L(o,{code:E.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)L(o,{code:E.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function x(m){let f=new Set;for(let l of m){if(l.status==="aborted")return nn;if(l.status==="dirty")i.dirty();f.add(l.value)}return{status:i.value,value:f}}let a=[...o.data.values()].map((m,f)=>p._parse(new Wo(o,m,o.path,f)));if(o.common.async)return Promise.all(a).then((m)=>x(m));else return x(a)}min(n,i){return new hc({...this._def,minSize:{value:n,message:Z.toString(i)}})}max(n,i){return new hc({...this._def,maxSize:{value:n,message:Z.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}hc.create=(n,i)=>{return new hc({valueType:n,minSize:null,maxSize:null,typeName:d.ZodSet,...mn(i)})};class jp extends fn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.function)return L(i,{code:E.invalid_type,expected:D.function,received:i.parsedType}),nn;function o(a,m){return Nm({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Lm(),Bp].filter((f)=>!!f),issueData:{code:E.invalid_arguments,argumentsError:m}})}function c(a,m){return Nm({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Lm(),Bp].filter((f)=>!!f),issueData:{code:E.invalid_return_type,returnTypeError:m}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof Ic){let a=this;return Ei(async function(...m){let f=new Ii([]),l=await a._def.args.parseAsync(m,p).catch((T)=>{throw f.addIssue(o(m,T)),f}),$=await Reflect.apply(x,this,l);return await a._def.returns._def.type.parseAsync($,p).catch((T)=>{throw f.addIssue(c($,T)),f})})}else{let a=this;return Ei(function(...m){let f=a._def.args.safeParse(m,p);if(!f.success)throw new Ii([o(m,f.error)]);let l=Reflect.apply(x,this,f.data),$=a._def.returns.safeParse(l,p);if(!$.success)throw new Ii([c(l,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new jp({...this._def,args:Uo.create(n).rest(wc.create())})}returns(n){return new jp({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new jp({args:n?n:Uo.create([]).rest(wc.create()),returns:i||wc.create(),typeName:d.ZodFunction,...mn(o)})}}class hp extends fn{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})}}hp.create=(n,i)=>{return new hp({getter:n,typeName:d.ZodLazy,...mn(i)})};class Ip extends fn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return L(i,{received:i.data,code:E.invalid_literal,expected:this._def.value}),nn}return{status:"valid",value:n.data}}get value(){return this._def.value}}Ip.create=(n,i)=>{return new Ip({value:n,typeName:d.ZodLiteral,...mn(i)})};function pR(n,i){return new Fc({values:n,typeName:d.ZodEnum,...mn(i)})}class Fc extends fn{constructor(){super(...arguments);Cx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return L(i,{expected:Fn.joinValues(o),received:i.parsedType,code:E.invalid_type}),nn}if(!Dm(this,Cx,"f"))nR(this,Cx,new Set(this._def.values),"f");if(!Dm(this,Cx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return L(i,{received:i.data,code:E.invalid_enum_value,options:o}),nn}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 Fc.create(n,{...this._def,...i})}exclude(n,i=this._def){return Fc.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}Cx=new WeakMap;Fc.create=pR;class kp extends fn{constructor(){super(...arguments);hx.set(this,void 0)}_parse(n){let i=Fn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==D.string&&o.parsedType!==D.number){let c=Fn.objectValues(i);return L(o,{expected:Fn.joinValues(c),received:o.parsedType,code:E.invalid_type}),nn}if(!Dm(this,hx,"f"))nR(this,hx,new Set(Fn.getValidEnumValues(this._def.values)),"f");if(!Dm(this,hx,"f").has(n.data)){let c=Fn.objectValues(i);return L(o,{received:o.data,code:E.invalid_enum_value,options:c}),nn}return Ei(n.data)}get enum(){return this._def.values}}hx=new WeakMap;kp.create=(n,i)=>{return new kp({values:n,typeName:d.ZodNativeEnum,...mn(i)})};class Ic extends fn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.promise&&i.common.async===!1)return L(i,{code:E.invalid_type,expected:D.promise,received:i.parsedType}),nn;let o=i.parsedType===D.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})}))}}Ic.create=(n,i)=>{return new Ic({type:n,typeName:d.ZodPromise,...mn(i)})};class oo extends fn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===d.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:(x)=>{if(L(o,x),x.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let x=c.transform(o.data,p);if(o.common.async)return Promise.resolve(x).then(async(a)=>{if(i.value==="aborted")return nn;let m=await this._def.schema._parseAsync({data:a,path:o.path,parent:o});if(m.status==="aborted")return nn;if(m.status==="dirty")return bp(m.value);if(i.value==="dirty")return bp(m.value);return m});else{if(i.value==="aborted")return nn;let a=this._def.schema._parseSync({data:x,path:o.path,parent:o});if(a.status==="aborted")return nn;if(a.status==="dirty")return bp(a.value);if(i.value==="dirty")return bp(a.value);return a}}if(c.type==="refinement"){let x=(a)=>{let m=c.refinement(a,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 a};if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(a.status==="aborted")return nn;if(a.status==="dirty")i.dirty();return x(a.value),{status:i.value,value:a.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((a)=>{if(a.status==="aborted")return nn;if(a.status==="dirty")i.dirty();return x(a.value).then(()=>{return{status:i.value,value:a.value}})})}if(c.type==="transform")if(o.common.async===!1){let x=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Ix(x))return x;let a=c.transform(x.value,p);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:a}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((x)=>{if(!Ix(x))return x;return Promise.resolve(c.transform(x.value,p)).then((a)=>({status:i.value,value:a}))});Fn.assertNever(c)}}oo.create=(n,i,o)=>{return new oo({schema:n,typeName:d.ZodEffects,effect:i,...mn(o)})};oo.createWithPreprocess=(n,i,o)=>{return new oo({schema:i,effect:{type:"preprocess",transform:n},typeName:d.ZodEffects,...mn(o)})};class Ro extends fn{_parse(n){if(this._getType(n)===D.undefined)return Ei(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ro.create=(n,i)=>{return new Ro({innerType:n,typeName:d.ZodOptional,...mn(i)})};class Io extends fn{_parse(n){if(this._getType(n)===D.null)return Ei(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Io.create=(n,i)=>{return new Io({innerType:n,typeName:d.ZodNullable,...mn(i)})};class sp extends fn{_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}}sp.create=(n,i)=>{return new sp({innerType:n,typeName:d.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...mn(i)})};class Zp extends fn{_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(kx(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}}Zp.create=(n,i)=>{return new Zp({innerType:n,typeName:d.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...mn(i)})};class tx extends fn{_parse(n){if(this._getType(n)!==D.nan){let o=this._getOrReturnCtx(n);return L(o,{code:E.invalid_type,expected:D.nan,received:o.parsedType}),nn}return{status:"valid",value:n.data}}}tx.create=(n)=>{return new tx({typeName:d.ZodNaN,...mn(n)})};var r5=Symbol("zod_brand");class hm extends fn{_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 rx extends fn{_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(),bp(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 rx({in:n,out:i,typeName:d.ZodPipeline})}}class qp extends fn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Ix(c))c.value=Object.freeze(c.value);return c};return kx(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}qp.create=(n,i)=>{return new qp({innerType:n,typeName:d.ZodReadonly,...mn(i)})};function xR(n,i={},o){if(n)return Cc.create().superRefine((c,p)=>{var x,a;if(!n(c)){let m=typeof i==="function"?i(c):typeof i==="string"?{message:i}:i,f=(a=(x=m.fatal)!==null&&x!==void 0?x:o)!==null&&a!==void 0?a:!0,l=typeof m==="string"?{message:m}:m;p.addIssue({code:"custom",...l,fatal:f})}});return Cc.create()}var g5={object:hn.lazycreate},d;(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"})(d||(d={}));var d5=(n,i={message:`Input not instance of ${n.name}`})=>xR((o)=>o instanceof n,i),aR=Fo.create,mR=Ac.create,e5=tx.create,n9=Sc.create,fR=yp.create,i9=Dc.create,o9=sx.create,c9=Lp.create,p9=Np.create,x9=Cc.create,a9=wc.create,m9=Eo.create,f9=Zx.create,l9=Mo.create,gx=hn.create,$9=hn.strictCreate,v9=Dp.create,T9=Cm.create,J9=Cp.create,w9=Uo.create,A9=qx.create,S9=Px.create,F9=hc.create,M9=jp.create,R9=hp.create,W9=Ip.create,K9=Fc.create,X9=kp.create,G9=Ic.create,dM=oo.create,Y9=Ro.create,z9=Io.create,H9=oo.createWithPreprocess,Q9=rx.create,O9=()=>aR().optional(),E9=()=>mR().optional(),U9=()=>fR().optional(),V9={string:(n)=>Fo.create({...n,coerce:!0}),number:(n)=>Ac.create({...n,coerce:!0}),boolean:(n)=>yp.create({...n,coerce:!0}),bigint:(n)=>Sc.create({...n,coerce:!0}),date:(n)=>Dc.create({...n,coerce:!0})},_9=nn,Kn=Object.freeze({__proto__:null,defaultErrorMap:Bp,setErrorMap:u5,getErrorMap:Lm,makeIssue:Nm,EMPTY_PATH:b5,addIssueToContext:L,ParseStatus:Gi,INVALID:nn,DIRTY:bp,OK:Ei,isAborted:U$,isDirty:V$,isValid:Ix,isAsync:kx,get util(){return Fn},get objectUtil(){return E$},ZodParsedType:D,getParsedType:Jc,ZodType:fn,datetimeRegex:cR,ZodString:Fo,ZodNumber:Ac,ZodBigInt:Sc,ZodBoolean:yp,ZodDate:Dc,ZodSymbol:sx,ZodUndefined:Lp,ZodNull:Np,ZodAny:Cc,ZodUnknown:wc,ZodNever:Eo,ZodVoid:Zx,ZodArray:Mo,ZodObject:hn,ZodUnion:Dp,ZodDiscriminatedUnion:Cm,ZodIntersection:Cp,ZodTuple:Uo,ZodRecord:qx,ZodMap:Px,ZodSet:hc,ZodFunction:jp,ZodLazy:hp,ZodLiteral:Ip,ZodEnum:Fc,ZodNativeEnum:kp,ZodPromise:Ic,ZodEffects:oo,ZodTransformer:oo,ZodOptional:Ro,ZodNullable:Io,ZodDefault:sp,ZodCatch:Zp,ZodNaN:tx,BRAND:r5,ZodBranded:hm,ZodPipeline:rx,ZodReadonly:qp,custom:xR,Schema:fn,ZodSchema:fn,late:g5,get ZodFirstPartyTypeKind(){return d},coerce:V9,any:x9,array:l9,bigint:n9,boolean:fR,date:i9,discriminatedUnion:T9,effect:dM,enum:K9,function:M9,instanceof:d5,intersection:J9,lazy:R9,literal:W9,map:S9,nan:e5,nativeEnum:X9,never:m9,null:p9,nullable:z9,number:mR,object:gx,oboolean:U9,onumber:E9,optional:Y9,ostring:O9,pipeline:Q9,preprocess:H9,promise:G9,record:A9,set:F9,strictObject:$9,string:aR,symbol:o9,transformer:dM,tuple:w9,undefined:c9,union:v9,unknown:a9,void:f9,NEVER:_9,ZodIssueCode:E,quotelessJson:_5,ZodError:Ii});function lR(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[K,Q]of Object.entries(i))if(Q==="")delete i[K]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},x=typeof n.server==="object"?n.server:{},a=typeof n.shared==="object"?n.shared:{},m=gx(p),f=gx(x),l=gx(a),$=n.isServer??(typeof window==="undefined"||("Deno"in window)),v=m.merge(l),T=f.merge(l).merge(m),F=$?T.safeParse(i):v.safeParse(i),R=n.onValidationError??((K)=>{throw console.error("\u274C Invalid environment variables:",K.flatten().fieldErrors),new Error("Invalid environment variables")}),S=n.onInvalidAccess??((K)=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(F.success===!1)return R(F.error);let M=(K)=>{if(!n.clientPrefix)return!0;return!K.startsWith(n.clientPrefix)&&!(K in l.shape)},G=(K)=>{return $||!M(K)},H=(K)=>{return K==="__esModule"||K==="$$typeof"},B=(n.extends??[]).reduce((K,Q)=>{return Object.assign(K,Q)},{}),k=Object.assign(F.data,B);return new Proxy(k,{get(K,Q){if(typeof Q!=="string")return;if(H(Q))return;if(!G(Q))return S(Q);return Reflect.get(K,Q)}})}var u9="__vite_start_time"in globalThis,b9=typeof window!=="undefined",wN="vitest"in globalThis,tn=lR({isServer:!u9&&!b9,server:{CI:Kn.string().transform((n)=>!0).optional(),POSTGRES_USER:Kn.string(),POSTGRES_PASSWORD:Kn.string(),POSTGRES_DATABASE:Kn.string(),POSTGRES_HOST:Kn.string(),POSTGRES_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Kn.string().transform((n)=>JSON.parse(n)).pipe(Kn.array(Kn.string())),OPENAI_API_KEY:Kn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Kn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var vR=u$(import.meta.dirname,"../dev"),b$=tn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:$R(u$(vR,"./cert.pem"),"utf-8"),key:$R(u$(vR,"./key.pem"),"utf-8")}:void 0;var Mc=new Bf,$n=tn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:Mc.logger;on.STORE.loggers[0]=new Kc("warn",void 0,$n);if($n!==console)Object.assign(console,$n,{log:$n.info});import{spawn as j9}from"child_process";import{resolve as B9}from"path";function j$(n,i,o=n.logger){let c=tn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",a=[B9(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")a.push("--experimental-strip-types");let m=j9(p,a);return new Ax(m,i,o)}var TR=Af(Al(),1);var y9=604800000,Im=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new TR.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[x,a]of c.entries())if(p-a>y9)c.delete(x);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),$n.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import EG from"path";import mG from"os";import fG from"fs";var km=new Map,B$=new Map,y$=Symbol("OriginError"),Pp={};class co extends Promise{constructor(n,i,o,c,p={}){let x,a;super((m,f)=>{x=m,a=f});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,x(m)),this.reject=(m)=>(this.active=!1,a(m)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[y$]=this.handler.debug?new Error:this.tagged&&L9(this.strings)}get origin(){return(this.handler.debug?this[y$].stack:this.tagged&&B$.has(this.strings)?B$.get(this.strings):B$.set(this.strings,this[y$].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,x)=>{this.cursorFn=(a)=>{return p({value:a,done:!1}),new Promise((m)=>o=m)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(a)=>(this.active=!1,x(a))});return this.execute(),c},return(){return o&&o(Pp),{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 L9(n){if(km.has(n))return km.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,km.set(n,new Error),Error.stackTraceLimit=i,km.get(n)}class tp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var dn={connection:JR,postgres:wR,generic:AR,notSupported:SR};function JR(n,i,o){let{host:c,port:p}=o||i,x=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(x,JR),x}function wR(n){let i=new tp(n);return Error.captureStackTrace(i,wR),i}function AR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,AR),o}function SR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,SR),i}var N9={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 qm{then(){L$()}catch(){L$()}finally(){L$()}}class ia extends qm{constructor(n){super();this.value=rm(n)}}class Vo extends qm{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class Pm extends qm{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=D9.map(([x,a])=>({fn:a,i:n.search(x)})).sort((x,a)=>x.i-a.i).pop();return p.i===-1?I$(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function tm(n,i,o,c){let p=n instanceof Vo?n.value:n;if(p===void 0){if(n instanceof Vo?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 Vo?(i.push(n.value),n.array?n.array[n.type||Zm(n.value)]||n.type||WR(n.value):n.type):(i.push(n),Zm(n)))}var MR=XR(N9);function C$(n,i,o,c,p,x){for(let a=1;a<n.strings.length;a++)i+=h$(i,o,c,p,x)+n.strings[a],o=n.args[a];return i}function h$(n,i,o,c,p){return i instanceof Pm?i.build(n,o,c,p):i instanceof co?D$(i,o,c,p):i instanceof ia?i.value:i&&i[0]instanceof co?i.reduce((x,a)=>x+" "+D$(a,o,c,p),""):tm(i,o,c,p)}function D$(n,i,o,c){return n.fragment=!0,C$(n,n.strings[0],n.args[0],i,o,c)}function RR(n,i,o,c,p){return n.map((x)=>"("+c.map((a)=>h$("values",x[a],i,o,p)).join(",")+")").join(",")}function FR(n,i,o,c,p){let x=Array.isArray(n[0]),a=i.length?i.flat():Object.keys(x?n[0]:n);return RR(x?n:[n],o,c,a,p)}function sm(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return I$(n,p);let x;return(i.length?i.flat():Object.keys(n)).map((m)=>{return x=n[m],(x instanceof co?D$(x,o,c,p):x instanceof ia?x.value:tm(x,o,c,p))+" as "+rm(p.transform.column.to?p.transform.column.to(m):m)}).join(",")}var D9=Object.entries({values:FR,in:(...n)=>{let i=FR(...n);return i==="()"?"(null)":i},select:sm,as:sm,returning:sm,"\\(":sm,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>rm(p.transform.column.to?p.transform.column.to(x):x)+"="+h$("values",n[x],o,c,p))},insert(n,i,o,c,p){let x=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+I$(x,p)+")values"+RR(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function L$(){throw dn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:C9,parsers:h9}=MR;function WR(n){if(Array.isArray(n))return WR(n[0]);return typeof n==="string"?1009:0}var KR=function(n){let i=XR(n||{});return{serializers:Object.assign({},C9,i.serializers),parsers:Object.assign({},h9,i.parsers)}};function XR(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 I$(n,{transform:{column:i}}){return n.map((o)=>rm(i.to?i.to(o):o)).join(",")}var rm=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},Zm=function n(i){return i instanceof Vo?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},I9=/\\/g,k9=/"/g;function s9(n){return n.replace(I9,"\\\\").replace(k9,"\\\"")}var GR=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let x=i[0],a=p===1020?";":",";if(Array.isArray(x)&&!x.type)return"{"+i.map((m)=>n(m,o,c,p)).join(a)+"}";return"{"+i.map((m)=>{if(m===void 0){if(m=c.transform.undefined,m===void 0)throw dn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return m===null?"null":'"'+s9(o?o(m.type?m.value:m):""+m)+'"'}).join(a)+"}"},N$={i:0,char:null,str:"",quoted:!1,last:0},YR=function n(i,o,c){return N$.i=N$.last=0,zR(N$,i,o,c)};function zR(n,i,o,c){let p=[],x=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(zR(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===x&&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 kc=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},sc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Zc=(n)=>n.replace(/_/g,"-"),dx=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),ex=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),na=(n)=>n.replace(/-/g,"_");function k$(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,[x,a])=>Object.assign(p,{[n(x)]:i(a,c)}),{}):o}}kc.column={from:kc};kc.value={from:k$(kc)};dx.column={to:dx};var s$={...kc};s$.column.to=dx;sc.column={from:sc};sc.value={from:k$(sc)};ex.column={to:ex};var Z$={...sc};Z$.column.to=ex;Zc.column={from:Zc};Zc.value={from:k$(Zc)};na.column={to:na};var q$={...Zc};q$.column.to=na;import HR from"net";import t9 from"tls";import oa from"crypto";import P$ from"stream";import{performance as QR}from"perf_hooks";class qc 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=Z9;function Z9(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 Yi=Buffer.allocUnsafe(256),q9="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return Yi[0]=o,Qn.i=5,Qn},n},{}),Qn=Object.assign(P9,q9,{N:String.fromCharCode(0),i:0,inc(n){return Qn.i+=n,Qn},str(n){let i=Buffer.byteLength(n);return gm(i),Qn.i+=Yi.write(n,Qn.i,i,"utf8"),Qn},i16(n){return gm(2),Yi.writeUInt16BE(n,Qn.i),Qn.i+=2,Qn},i32(n,i){if(i||i===0)return Yi.writeUInt32BE(n,i),Qn;return gm(4),Yi.writeUInt32BE(n,Qn.i),Qn.i+=4,Qn},z(n){return gm(n),Yi.fill(0,Qn.i,Qn.i+n),Qn.i+=n,Qn},raw(n){return Yi=Buffer.concat([Yi.subarray(0,Qn.i),n]),Qn.i=Yi.length,Qn},end(n=1){Yi.writeUInt32BE(Qn.i-n,n);let i=Yi.subarray(0,Qn.i);return Qn.i=0,Yi=Buffer.allocUnsafe(256),i}}),t=Qn;function gm(n){if(Yi.length-Qn.i<n){let i=Yi,o=i.length;Yi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(Yi)}}function P9(){return Qn.i=0,Qn}var g$=UR,r9=1,Rc=t().S().end(),OR=t().H().end(),g9=t().i32(8).i32(80877103).end(8),d9=Buffer.concat([t().E().str(t.N).i32(0).end(),Rc]),e9=t().D().str("S").str(t.N).end(),rp=()=>{},nG=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),iG={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 UR(n,i={},{onopen:o=rp,onend:c=rp,onclose:p=rp}={}){let{ssl:x,max:a,user:m,host:f,port:l,database:$,parsers:v,transform:T,onnotice:F,onnotify:R,onparameter:S,max_pipeline:M,keep_alive:G,backoff:H,target_session_attrs:B}=n,k=ki(),Y=r9++,K={pid:null,secret:null},Q=r$(Tf,n.idle_timeout),u=r$(Tf,n.max_lifetime),V=r$(l4,n.connect_timeout),X=null,s,C=new qc,q=Buffer.alloc(0),Xn=n.fetch_types,Un={},Vi={},_o=Math.random().toString(36).slice(2),O=1,P=0,Mn=0,yn=0,en=0,vn=0,Vn=0,rn=0,Dn=null,un=null,Ti=!1,_n=null,po=null,Ji=null,ko=null,ni=null,bn=null,xo=null,Xo=null,b=null,ix=null,wi={queue:i.closed,idleTimer:Q,connect(J){Ji=J||!0,Y0()},terminate:cx,execute:ox,cancel:x4,end:Tf,count:0,id:Y};return i.closed&&i.closed.push(wi),wi;async function p4(){let J;try{J=n.socket?await Promise.resolve(n.socket(n)):new HR.Socket}catch(W){gc(W);return}return J.on("error",gc),J.on("close",z0),J.on("drain",X0),J}async function x4({pid:J,secret:W},r,Rn){try{s=t().i32(16).i32(80877102).i32(J).i32(W).end(16),await G0(),X.once("error",Rn),X.once("close",r)}catch(In){Rn(In)}}function ox(J){if(Ti)return la(J,dn.connection("CONNECTION_DESTROYED",n));if(J.cancelled)return;try{return J.state=K,b?k.push(J):(b=J,b.active=!0),f4(J),mi(a4(J))&&!J.describeFirst&&!J.cursorFn&&k.length<M&&(!J.options.onexecute||J.options.onexecute(wi))}catch(W){return k.length===0&&mi(Rc),Go(W),!0}}function a4(J){if(J.parameters.length>=65534)throw dn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return J.options.simple?t().Q().str(J.statement.string+t.N).end():J.describeFirst?Buffer.concat([R0(J),OR]):J.prepare?J.prepared?fa(J):Buffer.concat([R0(J),fa(J)]):m4(J)}function R0(J){return Buffer.concat([Q0(J.statement.string,J.parameters,J.statement.types,J.statement.name),q4("S",J.statement.name)])}function fa(J){return Buffer.concat([Z4(J.parameters,J.statement.types,J.statement.name,J.cursorName),J.cursorFn?O0("",J.cursorRows):d9])}function m4(J){return Buffer.concat([Q0(J.statement.string,J.parameters,J.statement.types),e9,fa(J)])}function f4(J){let W=[],r=[],Rn=C$(J,J.strings[0],J.args[0],W,r,n);!J.tagged&&J.args.forEach((In)=>tm(In,W,r,n)),J.prepare=n.prepare&&("prepare"in J.options?J.options.prepare:!0),J.string=Rn,J.signature=J.prepare&&r+Rn,J.onlyDescribe&&delete Vi[J.signature],J.parameters=J.parameters||W,J.prepared=J.prepare&&J.signature in Vi,J.describeFirst=J.onlyDescribe||W.length&&!J.prepared,J.statement=J.prepared?Vi[J.signature]:{string:Rn,types:r,name:J.prepare?_o+O++:""},typeof n.debug==="function"&&n.debug(Y,Rn,W,r)}function mi(J,W){if(bn=bn?Buffer.concat([bn,J]):Buffer.from(J),W||bn.length>=1024)return W0(W);return un===null&&(un=setImmediate(W0)),!0}function W0(J){let W=X.write(bn,J);return un!==null&&clearImmediate(un),bn=un=null,W}function l4(){Go(dn.connection("CONNECT_TIMEOUT",n,X)),X.destroy()}async function K0(){if(mi(g9),!await new Promise((W)=>X.once("data",(r)=>W(r[0]===83)))&&x==="prefer")return rc();X.removeAllListeners(),X=t9.connect({socket:X,servername:HR.isIP(X.host)?void 0:X.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),X.on("secureConnect",rc),X.on("error",gc),X.on("close",z0),X.on("drain",X0)}function X0(){!b&&o(wi)}function vf(J){if(_n){if(_n.push(J),Mn-=J.length,Mn>=0)return}q=_n?Buffer.concat(_n,vn-Mn):q.length===0?J:Buffer.concat([q,J],q.length+J.length);while(q.length>4){if(vn=q.readUInt32BE(1),vn>=q.length){Mn=vn-q.length,_n=[q];break}try{$4(q.subarray(0,vn+1))}catch(W){b&&(b.cursorFn||b.describeFirst)&&mi(Rc),Go(W)}q=q.subarray(vn+1),Mn=0,_n=null}}async function G0(){if(Ti=!1,Un={},X||(X=await p4()),!X)return;if(V.start(),n.socket)return x?K0():rc();if(X.on("connect",x?K0:rc),n.path)return X.connect(n.path);X.ssl=x,X.connect(l[yn],f[yn]),X.host=f[yn],X.port=l[yn],yn=(yn+1)%l.length}function Y0(){setTimeout(G0,P?P+Vn-QR.now():0)}function rc(){try{Vi={},Xn=n.fetch_types,_o=Math.random().toString(36).slice(2),O=1,u.start(),X.on("data",vf),G&&X.setKeepAlive&&X.setKeepAlive(!0,1000*G);let J=t4();mi(J)}catch(J){gc(J)}}function gc(J){if(wi.queue===i.connecting&&n.host[en+1])return;Go(J);while(k.length)la(k.shift(),J)}function Go(J){ni&&(ni.destroy(J),ni=null),b&&la(b,J),Ji&&(la(Ji,J),Ji=null)}function la(J,W){"query"in W||"parameters"in W||Object.defineProperties(W,{stack:{value:W.stack+J.origin.replace(/.*\n/,`
54
- `),enumerable:n.debug},query:{value:J.string,enumerable:n.debug},parameters:{value:J.parameters,enumerable:n.debug},args:{value:J.args,enumerable:n.debug},types:{value:J.statement&&J.statement.types,enumerable:n.debug}}),J.reject(W)}function Tf(){return ko||(!wi.reserved&&c(wi),!wi.reserved&&!Ji&&!b&&k.length===0?(cx(),new Promise((J)=>X&&X.readyState!=="closed"?X.once("close",J):J())):ko=new Promise((J)=>xo=J))}function cx(){if(Ti=!0,ni||b||Ji||k.length)gc(dn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(un),X)X.removeListener("data",vf),X.removeListener("connect",rc),X.readyState==="open"&&X.end(t().X().end());xo&&(xo(),ko=xo=null)}async function z0(J){if(q=Buffer.alloc(0),Mn=0,_n=null,clearImmediate(un),X.removeListener("data",vf),X.removeListener("connect",rc),Q.cancel(),u.cancel(),V.cancel(),X.removeAllListeners(),X=null,Ji)return Y0();!J&&(b||k.length)&&gc(dn.connection("CONNECTION_CLOSED",n,X)),P=QR.now(),J&&n.shared.retries++,Vn=(typeof H==="function"?H(n.shared.retries):H)*1000,p(wi,dn.connection("CONNECTION_CLOSED",n,X))}function $4(J,W=J[0]){(W===68?v4:W===100?L4:W===65?_4:W===83?T4:W===90?J4:W===67?w4:W===50?H0:W===49?A4:W===116?S4:W===84?F4:W===82?M4:W===110?Y4:W===75?z4:W===69?U4:W===115?u4:W===51?b4:W===71?j4:W===78?D4:W===72?B4:W===99?N4:W===73?C4:W===86?h4:W===118?I4:W===87?y4:k4)(J)}function v4(J){let W=7,r,Rn,In,Ai=b.isRaw?new Array(b.statement.columns.length):{};for(let zi=0;zi<b.statement.columns.length;zi++)Rn=b.statement.columns[zi],r=J.readInt32BE(W),W+=4,In=r===-1?null:b.isRaw===!0?J.subarray(W,W+=r):Rn.parser===void 0?J.toString("utf8",W,W+=r):Rn.parser.array===!0?Rn.parser(J.toString("utf8",W+1,W+=r)):Rn.parser(J.toString("utf8",W,W+=r)),b.isRaw?Ai[zi]=b.isRaw===!0?In:T.value.from?T.value.from(In,Rn):In:Ai[Rn.name]=T.value.from?T.value.from(In,Rn):In;b.forEachFn?b.forEachFn(T.row.from?T.row.from(Ai):Ai,C):C[rn++]=T.row.from?T.row.from(Ai):Ai}function T4(J){let[W,r]=J.toString("utf8",5,J.length-1).split(t.N);if(Un[W]=r,n.parameters[W]!==r)n.parameters[W]=r,S&&S(W,r)}function J4(J){if(b&&b.options.simple&&b.resolve(po||C),b=po=null,C=new qc,V.cancel(),Ji){if(B){if(!Un.in_hot_standby||!Un.default_transaction_read_only)return E4();else if(O4(B,Un))return cx()}if(Xn)return Ji===!0&&(Ji=null),H4();Ji!==!0&&ox(Ji),n.shared.retries=en=0,Ji=null;return}while(k.length&&(b=k.shift())&&(b.active=!0,b.cancelled))UR(n).cancel(b.state,b.cancelled.resolve,b.cancelled.reject);if(b)return;wi.reserved?!wi.reserved.release&&J[5]===73?ko?cx():(wi.reserved=null,o(wi)):wi.reserved():ko?cx():o(wi)}function w4(J){rn=0;for(let W=J.length-1;W>0;W--){if(J[W]===32&&J[W+1]<58&&C.count===null)C.count=+J.toString("utf8",W+1,J.length-1);if(J[W-1]>=65){C.command=J.toString("utf8",5,W),C.state=K;break}}if(ix&&(ix(),ix=null),C.command==="BEGIN"&&a!==1&&!wi.reserved)return Go(dn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(b.options.simple)return H0();if(b.cursorFn)C.count&&b.cursorFn(C),mi(Rc);b.resolve(C)}function A4(){b.parsing=!1}function H0(){!C.statement&&(C.statement=b.statement),C.columns=b.statement.columns}function S4(J){let W=J.readUInt16BE(5);for(let r=0;r<W;++r)!b.statement.types[r]&&(b.statement.types[r]=J.readUInt32BE(7+r*4));b.prepare&&(Vi[b.signature]=b.statement),b.describeFirst&&!b.onlyDescribe&&(mi(fa(b)),b.describeFirst=!1)}function F4(J){if(C.command)po=po||[C],po.push(C=new qc),C.count=null,b.statement.columns=null;let W=J.readUInt16BE(5),r=7,Rn;b.statement.columns=Array(W);for(let In=0;In<W;++In){Rn=r;while(J[r++]!==0);let Ai=J.readUInt32BE(r),zi=J.readUInt16BE(r+4),so=J.readUInt32BE(r+6);b.statement.columns[In]={name:T.column.from?T.column.from(J.toString("utf8",Rn,r-1)):J.toString("utf8",Rn,r-1),parser:v[so],table:Ai,number:zi,type:so},r+=18}if(C.statement=b.statement,b.onlyDescribe)return b.resolve(b.statement),mi(Rc)}async function M4(J,W=J.readUInt32BE(5)){(W===3?R4:W===5?W4:W===10?K4:W===11?X4:W===12?G4:W!==0?s4:rp)(J,W)}async function R4(){let J=await Jf();mi(t().p().str(J).z(1).end())}async function W4(J){let W="md5"+await ER(Buffer.concat([Buffer.from(await ER(await Jf()+m)),J.subarray(9)]));mi(t().p().str(W).z(1).end())}async function K4(){Xo=(await oa.randomBytes(18)).toString("base64"),t().p().str("SCRAM-SHA-256"+t.N);let J=t.i;mi(t.inc(4).str("n,,n=*,r="+Xo).i32(t.i-J-4,J).end())}async function X4(J){let W=J.toString("utf8",9).split(",").reduce((zi,so)=>(zi[so[0]]=so.slice(2),zi),{}),r=await oa.pbkdf2Sync(await Jf(),Buffer.from(W.s,"base64"),parseInt(W.i),32,"sha256"),Rn=await dm(r,"Client Key"),In="n=*,r="+Xo+",r="+W.r+",s="+W.s+",i="+W.i+",c=biws,r="+W.r;Dn=(await dm(await dm(r,"Server Key"),In)).toString("base64");let Ai="c=biws,r="+W.r+",p="+cG(Rn,Buffer.from(await dm(await oG(Rn),In))).toString("base64");mi(t().p().str(Ai).end())}function G4(J){if(J.toString("utf8",9).split(t.N,1)[0].slice(2)===Dn)return;Go(dn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),X.destroy()}function Jf(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function Y4(){if(C.statement=b.statement,C.statement.columns=[],b.onlyDescribe)return b.resolve(b.statement),mi(Rc)}function z4(J){K.pid=J.readUInt32BE(5),K.secret=J.readUInt32BE(9)}async function H4(){Xn=!1,(await new co([`
53
+ `);n.disposalTraces.add({key:o.key,trace:x})}}var Rm=(n,i)=>U(i).atoms.has(n),m8=(n,i)=>U(i).selectors.has(n),a8=(n,i)=>U(i).readonlySelectors.has(n),mv=(n,i)=>Rm(n,i)||m8(n,i)||a8(n,i);var Wm=(n,i)=>{return U(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>mv(c,i))};var Vf=(n,i,o)=>{let c=[],p=Wm(n,o);while(p.length>0){let x=p.shift();if(i.has(x))continue;if(i.add(x),!Rm(x,o))p.push(...Wm(x,o));else if(!c.includes(x))c.push(x)}return c},av=(n,i)=>{let o=n.key,c=Wm(o,i),p=new Set;return c.flatMap((x)=>Rm(x,i)?x:Vf(x,p,i))};var fv=(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 x=Vf(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${x.map((m)=>`"${m}"`).join(", ")} ]`);for(let m of x)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:m})}o.add(i.key)};var Km=(n,i,o)=>({get:(...c)=>{let p=U(o),x;if(c.length===2){let[f,l]=c;switch(f.type){case"molecule_family":return An(o,f,l);default:if(o.config.lifespan==="ephemeral")x=Tn(o,f,l);else{let $=jn(o,f,l);if($)x=$;else throw new _i(f,l,o)}}}else[x]=c;if(x.type==="molecule")return An(o,x);let m=e(x,o),a=go(m,o);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,a,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),fv(n,x,i,o),a},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let f=c[0],l=c[1];x=c[2];let $=o.config.lifespan==="ephemeral"?Tn(o,f,l):jn(o,f,l);if(!$)throw new _i(f,l,o);p=$}let m=U(o),a=e(p,m);vm(a,x,m)},find:(c,p)=>Tn(o,c,p),seek:(c,p)=>jn(o,c,p),json:(c)=>sn(o,c)});var fx=(n,i,o)=>{let c=U(n),p=new mn,x=new Set,{get:m,find:a,seek:f,json:l}=Km(i.key,x,c),$=()=>{let R=i.get({get:m,find:a,seek:f,json:l});return Zi(i.key,R,p,U(n)),x.clear(),R},v={...i,subject:p,install:(R)=>fx(R,i,o),get:$,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,v);let T=$();n.logger.info("\u2728",v.type,v.key,"=",T);let F={key:i.key,type:"readonly_selector"};if(o)F.family=o;return F};var Jx=(n,i,o)=>{let c=U(n),p=new mn,x=new Set,m=Km(i.key,x,c),{find:a,get:f,seek:l,json:$}=m,v={find:a,get:f,seek:l,json:$},T=(G=i.get,H=U(n))=>{let y=G(v);return Zi(i.key,y,p,H),x.clear(),y},R={...i,subject:p,install:(G)=>Jx(G,i,o),get:T,set:(G)=>{let H=U(n),y=T(i.get,H),k=$m(G)(y);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",y,"->",k,")"),Zi(i.key,k,p,H),ip(H,i.key),Zn(H))p.next({newValue:k,oldValue:y});i.set(m,k)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,R);let S=T();n.logger.info("\u2728",R.type,R.key,"=",S);let M={key:i.key,type:"selector"};if(o)M.family=o;return M};function mx(n,i){if("set"in i){let p=Jx(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=fx(n,i,void 0);return n.on.selectorCreation.next(c),c}function xv(n,i){let o=U(i),{key:c}=n,p=e(n,o);if(!p.family)i.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{let x=o.molecules.get(p.family.subKey);if(x)x.tokens.delete(c);switch(n.type){case"selector":o.selectors.delete(c),e({key:p.family.key,type:"selector_family"},i).subject.next({type:"state_disposal",token:n});break;case"readonly_selector":o.readonlySelectors.delete(c),e({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"),wn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.selectorDisposal.next(n)}}function lx(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new mn,a=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F=Jx(T,{key:v,get:i.get(f),set:i.set(f)},$);return x.next({type:"state_creation",token:F}),F},c,{internalRoles:o,subject:x,install:(f)=>lx(f,i),default:(f)=>{return i.get(f)({get:(...$)=>An(n,...$),find:($,v)=>Tn(n,$,v),seek:($,v)=>jn(n,$,v),json:($)=>sn(n,$)})}});return n.families.set(i.key,a),c}function lv(n,i,o=on.STORE){let c=lx(o,{key:`${n.key}:JSON`,get:(x)=>({seek:m,get:a})=>{let f=m(n,x);if(f)return i.toJson(a(f));let l=g(x),$=o.molecules.get(l);if($){let T=fo($,n,o);return i.toJson(a(T))}if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${l}"`);let v=uo(o,n,x);return i.toJson(a(v))},set:(x)=>({seek:m,set:a},f)=>{let l=m(n,x);if(l)a(l,i.fromJson(f));else{let $=g(x),v=o.molecules.get($);if(v){let T=fo(v,n,o);a(T,i.fromJson(f))}else{if(o.config.lifespan==="immortal")throw new Error(`No molecule found for key "${$}"`);a(uo(o,n,x),i.fromJson(f))}}}},["mutable","json"]);return e(n,o).subject.subscribe(`store=${o.config.name}::json-selector-family`,(x)=>{if(x.token.family)jn(o,c,ii(x.token.family.subKey))}),c}var ii=(n)=>JSON.parse(n),g=(n)=>JSON.stringify(n),DO=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var $v=(n,i)=>{let o=U(i);if(o.operation.open)return o.operation.prev.get(n.key);return o.valueMap.get(n.key)};var bf=(n,i)=>{let o=U(i);return av(n,i).map((p)=>{let x=o.atoms.get(p);if(x===void 0)throw new Error(`Atom "${p}", a dependency of selector "${n.key}", not found in store "${i.config.name}".`);return x.subject.subscribe(`${n.type}:${n.key}`,(m)=>{i.logger.info("\uD83D\uDCE2",n.type,n.key,"root",p,"went",m.oldValue,"->",m.newValue);let a=$v(n,o),f=go(n,o);i.logger.info("\u2728",n.type,n.key,"went",a,"->",f),n.subject.next({newValue:f,oldValue:a})})})};function Fi(n,i,o,c){function p(v){if(c.operation.open){let T=c.on.operationClose.subscribe(`state subscription ${o}`,()=>{T(),i(v)})}else i(v)}let x=e(n,c);c.logger.info("\uD83D\uDC40",x.type,x.key,`Adding subscription "${o}"`);let m=x.type==="selector"||x.type==="readonly_selector",a=null,f=p;if(m)a=bf(x,c),f=(v)=>{if(a)a.length=0,a.push(...bf(x,c));p(v)};let l=x.subject.subscribe(o,f);return()=>{if(c.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),l(),a)for(let v of a)v()}}var _f=(n,i,o,c)=>{let p=e(n,c);c.logger.info("\uD83D\uDC40","timeline",n.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","timeline",n.key,`Removing subscription "${o}" from timeline`),x()}};var uf=(n,i,o,c)=>{let p=e(n,c);c.logger.info("\uD83D\uDC40","transaction",n.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","transaction",n.key,`Removing subscription "${o}"`),x()}};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=Po(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let x=i.parent.valueMap.get(o);i.valueMap.set(o,x)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${wn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=An(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{Yn(o,i,x)}),this.unsubscribeFromState=Fi(n,(x)=>{if(x.newValue!==x.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=x.newValue.subscribe(c,(m)=>{Yn(o,i,m)})},c,o)}updateCore(n,i,o){let c=`tracker:${o.config.name}:${wn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Fi(i,({newValue:p,oldValue:x})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let l=_f({key:m,type:"timeline"},($)=>{l(),Yn(o,n,(v)=>{if($==="redo"&&p)v.do(p);else if($==="undo"&&x)v.undo(x);return v})},c,o);return}}let a=o.on.operationClose.subscribe(c,()=>{a();let f=An(o,n),l=p===null?-1:f.getUpdateNumber(p),$=l-f.cacheUpdateNumber;if(p&&$===1)Yn(o,n,(v)=>(v.do(p),v));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${f.cacheUpdateNumber+1}, but got ${l}`)})},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 wx(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 x=new mn,m={...i,type:"mutable_atom",install:(l)=>{return l.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${l.config.name}"`),wx(l,i,o)},subject:x};if(o)m.family=o;let a=i.default();c.atoms.set(m.key,m),Xm(i.key,n),Zi(i.key,a,x,c);let f=si(m);if(i.effects){let l=0,$=[];for(let v of i.effects){let T=v({setSelf:(F)=>{Yn(n,f,F)},onSet:(F)=>Fi(f,F,`effect[${l}]`,n)});if(T)$.push(T);++l}m.cleanup=()=>{for(let v of $)v()}}if(new eo(f,n),!o)_0(f,i,n);return f}class jf{Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=qo(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=e(o,i),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=ii(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=ii(c.token.family.subKey),x=jn(i,this.mutableAtoms,p);if(x)new eo(x,i)}})}}function ax(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 ${ao(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new mn,a=Object.assign((f)=>{let l=g(f),$={key:i.key,subKey:l},v=`${i.key}(${l})`,T=U(n),F={key:v,default:()=>i.default(f),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)F.effects=i.effects(f);let R=wx(T,F,$);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(f)=>ax(f,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,a),lv(a,i,n),new jf(a,n),c}var Xf=(n,i)=>{let o=U(i),c=`${n.key}:JSON`;return o.families.get(c)};var sn=(n,i)=>{if(i.family){let c=U(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},m=e(x,c),a=JSON.parse(i.family.subKey);return Tn(n,m,a)}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 I0(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function $x(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 x=n.toJson(c),m=n.fromJson(x);return o.valueMap.set(n.key,m),new eo(n,i),m}return p}function Zi(n,i,o,c){let p=c.valueMap.get(n);if(p instanceof xx)p.use(i);if(i instanceof Promise){let x=new xx(i);return c.valueMap.set(n,x),x.then((m)=>{Zi(n,m,o,c),o.next({newValue:m,oldValue:x})}).catch((m)=>{c.logger.error("\uD83D\uDCA5","state",n,"rejected:",m)}),x}return c.valueMap.set(n,i),i}var B0=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&wn(i)){let{parent:c}=i;o=$x(n,c,i)}return o},C0=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof xx){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 s0=(n,i)=>{return U(i).atomsThatAreDefault.has(n)},Xm=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(n)},Z0=(n,i)=>{let o=U(i);o.atomsThatAreDefault=new Set(U(i).atomsThatAreDefault),o.atomsThatAreDefault.delete(n)};function Po(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 x=new mn,m={...i,type:"atom",install:(l)=>{return l.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${l.config.name}"`),Po(l,i,o)},subject:x};if(o)m.family=o;let a=i.default;if(i.default instanceof Function)a=i.default();c.atoms.set(m.key,m),Xm(i.key,n),Zi(i.key,a,x,c);let f=si(m);if(i.effects){let l=0,$=[];for(let v of i.effects){let T=v({setSelf:(F)=>{Yn(n,f,F)},onSet:(F)=>Fi(f,F,`effect[${l}]`,n)});if(T)$.push(T);++l}m.cleanup=()=>{for(let v of $)v()}}return f}function vv(n,i){if("mutable"in i){let p=wx(n,i,void 0);return n.on.atomCreation.next(p),p}let c=Po(n,i,void 0);return n.on.atomCreation.next(c),c}function Uf(n,i){let o=U(i),{key:c}=n,p=e(n,o);if(!p.family)i.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{p.cleanup?.();let x=i.valueMap.get(p.key);e({key:p.family.key,type:"atom_family"},i).subject.next({type:"state_disposal",token:n,value:x});let a=o.molecules.get(p.family.subKey);if(a)a.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 f=jo(n);Uf(f,i),i.trackers.delete(c)}if(i.logger.info("\uD83D\uDD25","atom",c,"deleted"),wn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",token:n});else i.on.atomDisposal.next(n)}}var FV=Symbol("provenance");function Yf(n,i,o){let c=g(o);try{let p=[],x;if(i==="root")p.push(n.molecules.get('"root"')),x="all";else if(typeof i==="string"&&i.startsWith(f8)){x="any";let $=g(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$--")){x="all";for(let v of i){let T=g(v),F=n.molecules.get(T);if(!F)throw new Error(`Molecule ${T} not found in store "${n.config.name}"`);p.push(F)}}else{x="any";let v=g(i),T=n.molecules.get(v);if(!T)throw new Error(`Molecule ${v} not found in store "${n.config.name}"`);p.push(T)}let m=new cp(p,o);m._dependsOn=x,n.molecules.set(c,m);for(let $ of p)$.below.set(m.stringKey,m);let a={type:"molecule_creation",subType:"modern",key:m.key,provenance:i},f=U(n);if(wn(f)&&f.transactionMeta.phase==="building")f.transactionMeta.update.updates.push(a);else f.on.moleculeCreationStart.next(a)}catch(p){if(p instanceof Error)n.logger.error("\u274C","molecule",c,"allocation failed:",p.message)}return o}function Tx(n,i){let o=g(i),c=n.molecules.get(o);if(!c)throw new Error(`Molecule ${o} not found in store "${n.config.name}"`);for(let l of c.joins.values())l.relations.delete(c.key),l.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:l})=>l);let x=[];for(let l of c.tokens.values()){let $=l.family;x.push([$.key,n.valueMap.get(l.key)])}for(let l of c.tokens.values())Hi(n,l);for(let l of c.below.values())if(l.dependsOn==="all")Tx(n,l.key);else if(l.above.delete(c.stringKey),l.above.size===0)Tx(n,l.key);c.below.clear();let m={type:"molecule_disposal",subType:"modern",key:c.key,values:x,provenance:p},a=U(n);if(wn(a)&&a.transactionMeta.phase==="building")a.transactionMeta.update.updates.push(m);else a.on.moleculeDisposal.next(m);a.molecules.delete(c.stringKey);for(let l of c.above.values())l.below.delete(c.stringKey)}var f8="T$";function nc(n){return vv(on.STORE,n)}function Xc(n){return b0(on.STORE,n)}var Bf=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},l8={error:Bf("error"),info:Bf("info"),warn:Bf("warn")};class Kc{logLevel;filter;logger;constructor(n,i,o=l8){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 Gm(n){return Rf(on.STORE,n)}function Gc(n){return Ef(n,on.STORE)}class Tv 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 Ym{key;type="continuity";globals=[];actions=[];perspectives=[];constructor(n){this.key=n}static existing=new Tv;static create(n,i){let o=new Ym(n),{type:c,globals:p,actions:x,perspectives:m}=i(o),a={type:c,key:n,globals:p,actions:x,perspectives:m};return Ym.existing.set(n,a),a}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 Jv(n){let{key:i,config:o}=n,c=Ym.create(i,o),{actions:p}=c;for(let x of p)iv(i,x.key,on.STORE);return d0(i,-1,on.STORE),c}var VV=nc({key:"usersInRoomIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),yf=nc({key:"roomIndex",default:()=>new oi,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),$8={enteredAtEpoch:0},Ax=wm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},$8),_V=Gm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=t0(Ax);return[i(o,n)]}});import{spawn as v8}from"child_process";class pp{emit;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 Sx extends pp{incompleteData="";unprocessedEvents=[];incompleteLog="";unprocessedLogs=[];id="#####";process;key;logger;handleLog(n){if(Array.isArray(n)){let[i,...o]=n;switch(i){case"i":this.logger.info(...o);break;case"w":this.logger.warn(...o);break;case"e":this.logger.error(...o);break}}}constructor(n,i,o){super((c,...p)=>{let x=JSON.stringify([c,...p])+"\x03",m=(a)=>{if(a.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(x),this});if(this.process=n,this.key=i,this.logger=o??{info:(...c)=>{console.info(this.id,this.key,...c)},warn:(...c)=>{console.warn(this.id,this.key,...c)},error:(...c)=>{console.error(this.id,this.key,...c)}},this.process.stdout.on("data",(c)=>{let p=c.toString();if(p==="ALIVE")return;this.unprocessedEvents.push(...p.split("\x03"));let x=this.unprocessedEvents.shift();this.incompleteData+=x??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let m=ii(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let a=this.unprocessedEvents.shift();if(a){if(this.unprocessedEvents.length===0)this.incompleteData=a;m=ii(a),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 x=this.unprocessedLogs.shift();this.incompleteLog+=x??"";try{let m=ii(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=ii(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 wv extends pp{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 Lf extends pp{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(g(n.map((i)=>i instanceof oi?`{ ${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=ii(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 x=ii(p);this.handleEvent(...x)}}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 wv(`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("ALIVE")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}var Nf=Xc({key:"roomArguments",default:["echo",["Hello World!"]]}),Av=Gm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Nf,n),p=i(c),[x,m]=p,a=await new Promise((f)=>{let l=v8(x,m,{env:process.env}),$=(v)=>{if(v.toString()==="ALIVE")l.stdout.off("data",$),f(l)};l.stdout.on("data",$)});return new Sx(a,n)}});var m_=Gc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let m=x?[p,x]:[p],a=o(Nf,c);i(a,m),i(yf,($)=>$.add(c));let f=o(Av,c);return n(f)}}),a_=Gc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return Wc(Ax,(x)=>{x.set({room:i,user:o},p)},n.env().store),p}}),f_=Gc({key:"leaveRoom",do:(n,i,o)=>{Wc(Ax,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),l_=Gc({key:"destroyRoom",do:(n,i)=>{Wc(Ax,(o)=>{o.delete({room:i})},n.env().store),n.set(yf,(o)=>(o.delete(i),o))}});function Df(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Df(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 T_=Xc({key:"redactor",default:{occlude:(n)=>n}}),xp=Xc({key:"unacknowledgedUpdates",default:()=>[]});var zm=Xc({key:"sockets",default:null}),Cf=nc({key:"socketsIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),hf=nc({key:"usersIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Yc=wm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function Sv(n,i,o,c){let p=i.key;return function x(){let m=[];for(let f of i.globals){let l=f.type==="mutable_atom"?sn(n,f):f,$=An(n,l);m.push(l,$)}for(let f of i.perspectives){let{viewAtoms:l,resourceAtoms:$}=f,v=Tn(n,l,o),T=An(n,v);n.logger.info("\uD83D\uDC41","atom",$.key,`${o} can see`,{viewAtoms:l,resourceAtoms:$,userView:T});for(let F of T){let R=F.type==="mutable_atom"?sn(n,F):F,S=An(n,R);m.push(R,S)}}let a=Zn(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,a,m)}}function Fv(n,i,o){let c=i.key;return function p(x){n.logger.info("\uD83D\uDECE\uFE0F","continuity",c,"received",x);let{key:m,id:a}=x,f=`tx-run:${m}:${a}`,l=`${f}:start`,$=`${f}:end`;performance.mark(l);try{ro({type:"transaction",key:m},a,n)(...x.params)}catch(T){if(T instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${m} from ${o} with update ${a}`,T.message)}performance.mark($);let v=performance.measure(f,l,$);n?.logger.info("\uD83D\uDE80","transaction",m,a,o,v.duration)}}function Mv(n,i,o,c){let p=i.key;return function x(m){if(n.logger.info("\uD83D\uDC4D","continuity",p,`${o} acknowledged epoch ${m}`),c[0]?.epoch===m)Yn(n,xp,o,(f)=>{return f.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,f.length,"items"),f})}}function Rv(n,i,o,c){let p=i.key,x=[];for(let m of i.actions){let a=uf(m,(f)=>{try{let l=i.globals.map((T)=>{if(T.type==="atom")return T.key;return jo(T).key}).concat(i.perspectives.flatMap((T)=>{let{viewAtoms:F}=T,R=Tn(n,F,o);return An(n,R).map((M)=>{return M.type==="mutable_atom"?"*"+M.key:M.key})})),$=Df(l,f.updates),v={...f,updates:$};Yn(n,xp,o,(T)=>{if(v)T.push(v),T.sort((F,R)=>F.epoch-R.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,T.length,"items");return T}),c?.emit(`tx-new:${p}`,v)}catch(l){if(l instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${m.key} to ${o}`,l.message)}},`sync-continuity:${p}:${o}`,n);x.push(a)}return x}function Wv(n,i,o,c){let p=i.key,x=[];for(let m of i.perspectives){let{viewAtoms:a}=m,f=Tn(n,a,o),l=Fi(f,({oldValue:$,newValue:v})=>{let T=$.map((M)=>M.key),F=v.map((M)=>M.key),R=$.filter((M)=>!F.includes(M.key)),S=v.filter((M)=>!T.includes(M.key)).flatMap((M)=>{let G=M.type==="mutable_atom"?sn(n,M):M,H=An(n,G);return[G,H]});if(n.logger.info("\uD83D\uDC41","atom",m.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:T,newKeys:F,revealed:S,concealed:R}),S.length>0)c?.emit(`reveal:${p}`,S);if(R.length>0)c?.emit(`conceal:${p}`,R)},`sync-continuity:${p}:${o}:perspective:${m.resourceAtoms.key}`,n);x.push(l)}return x}function Kv({socket:n,store:i=on.STORE}){return function o(c){let p=n,x=c.key,m=op(Yc,`socket::${p.id}`,i).userKeyOfSocket,a=An(i,m);if(!a)return i.logger.error("\u274C","continuity",x,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let f=op(Yc,a,i).socketKeyOfUser,l=Fi(f,({newValue:G})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${a} on new socket ${G}`),G===null){i.logger.warn("\u274C","continuity",x,`User (${a}) is not connected to a socket, waiting for them to reappear.`);return}let H=Tn(i,zm,G);p=An(i,H);for(let k of $)p?.emit(`tx-new:${x}`,k)},`sync-continuity:${x}:${a}`,i),$=An(i,xp,a),v=[],T=Wv(i,c,a,p),F=Rv(i,c,a,p);v.push(...T,...F);let R=Sv(i,c,a,n);p.off(`get:${x}`,R),p.on(`get:${x}`,R);let S=Fv(i,c,a);p.off(`tx-run:${x}`,S),p.on(`tx-run:${x}`,S);let M=Mv(i,c,a,$);return p?.on(`ack:${x}`,M),()=>{for(let G of v)G();p?.off(`ack:${x}`,M),p?.off(`get:${x}`,R),p?.off(`tx-run:${x}`,S)}}}var c4=Ff(Fl(),1);var w=Symbol.for("drizzle:entityKind"),Hu=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,w))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(w in o&&o[w]===i[w])return!0;o=Object.getPrototypeOf(o)}return!1}class On{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[w]="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 Ml{static[w]="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 Rl{static[w]="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 GT(n,this)}}class GT{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[w]="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),x=[this.table[To],...c,o[0].table[To],...p];return n??`${x.join("_")}_fk`}}function qm(n,...i){return n(...i)}function YT(n,i){return`${n[To]}_${i.join("_")}_unique`}function zT(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 HT(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let x=n[c];if(x===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,x==="\\"){c+=2;continue}if(x==='"'){let[f,l]=zT(n,c+1,!0);o.push(f),c=l;continue}if(x==="}")return[o,c+1];if(x==="{"){let[f,l]=HT(n,c+1);o.push(f),c=l;continue}let[m,a]=zT(n,c,!1);o.push(m),c=a}return[o,c]}function QT(n){let[i]=HT(n,1);return i}function Wl(n){return`{${n.map((i)=>{if(Array.isArray(i))return Wl(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class I extends Ml{foreignKeyConfigs=[];static[w]="PgColumnBuilder";array(n){return new ET(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 qm((p,x)=>{let m=new Rl(()=>{let a=p();return{columns:[n],foreignColumns:[a]}});if(x.onUpdate)m.onUpdate(x.onUpdate);if(x.onDelete)m.onDelete(x.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new OT(n,this.config)}}class _ extends On{constructor(n,i){if(!i.uniqueName)i.uniqueName=YT(n,[i.name]);super(n,i);this.table=n}static[w]="PgColumn"}class OT extends _{static[w]="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 Qx{static[w]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class ET extends I{static[w]="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 Kl(n,this.config,i)}}class Kl extends _{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[w]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=QT(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:z(this.baseColumn,Kl)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return Wl(o)}}var Xl=Symbol.for("drizzle:isPgEnum");function UT(n){return!!n&&typeof n==="function"&&Xl in n&&n[Xl]===!0}class VT extends I{static[w]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new _T(n,this.config)}}class _T extends _{static[w]="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 Pm(n,i){return _W(n,i,void 0)}function _W(n,i,o){let c=Object.assign((p)=>new VT(p??"",c),{enumName:n,enumValues:i,schema:o,[Xl]:!0});return c}class ci{static[w]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Ox extends ci{static[w]="WithSubquery"}var uT="0.38.3";var Gl,Yl,En={startActiveSpan(n,i){if(!Gl)return i();if(!Yl)Yl=Gl.trace.getTracer("drizzle-orm",uT);return qm((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(x){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:x instanceof Error?x.message:"Unknown error"}),x}finally{p.end()}}),Gl,Yl)}};var Bn=Symbol.for("drizzle:ViewBaseConfig");var tm=Symbol.for("drizzle:Schema"),rm=Symbol.for("drizzle:Columns"),bT=Symbol.for("drizzle:ExtraConfigColumns"),zl=Symbol.for("drizzle:OriginalName"),Hl=Symbol.for("drizzle:BaseName"),gm=Symbol.for("drizzle:IsAlias"),jT=Symbol.for("drizzle:ExtraConfigBuilder"),uW=Symbol.for("drizzle:IsDrizzleTable");class L{static[w]="Table";static Symbol={Name:To,Schema:tm,OriginalName:zl,Columns:rm,ExtraConfigColumns:bT,BaseName:Hl,IsAlias:gm,ExtraConfigBuilder:jT};[To];[zl];[tm];[rm];[bT];[Hl];[gm]=!1;[uW]=!0;[jT]=void 0;constructor(n,i,o){this[To]=this[zl]=n,this[tm]=i,this[Hl]=o}}function di(n){return n[To]}function Uc(n){return`${n[tm]??"public"}.${n[To]}`}function Ql(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function bW(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[w]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new N([this])}}class N{constructor(n){this.queryChunks=n}static[w]="SQL";decoder=yT;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return En.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:x,prepareTyping:m,inlineParams:a,paramStartIndex:f}=o;return bW(n.map((l)=>{if(z(l,pi))return{sql:l.value.join(""),params:[]};if(z(l,dm))return{sql:p(l.value),params:[]};if(l===void 0)return{sql:"",params:[]};if(Array.isArray(l)){let $=[new pi("(")];for(let[v,T]of l.entries())if($.push(T),v<l.length-1)$.push(new pi(", "));return $.push(new pi(")")),this.buildQueryFromSourceParams($,o)}if(z(l,N))return this.buildQueryFromSourceParams(l.queryChunks,{...o,inlineParams:a||l.shouldInlineParams});if(z(l,L)){let $=l[L.Symbol.Schema],v=l[L.Symbol.Name];return{sql:$===void 0?p(v):p($)+"."+p(v),params:[]}}if(z(l,On)){let $=c.getColumnCasing(l);if(i.invokeSource==="indexes")return{sql:p($),params:[]};let v=l.table[L.Symbol.Schema];return{sql:l.table[gm]||v===void 0?p(l.table[L.Symbol.Name])+"."+p($):p(v)+"."+p(l.table[L.Symbol.Name])+"."+p($),params:[]}}if(z(l,ui)){let $=l[Bn].schema,v=l[Bn].name;return{sql:$===void 0?p(v):p($)+"."+p(v),params:[]}}if(z(l,Li)){if(z(l.value,mc))return{sql:x(f.value++,l),params:[l],typings:["none"]};let $=l.value===null?null:l.encoder.mapToDriverValue(l.value);if(z($,N))return this.buildQueryFromSourceParams([$],o);if(a)return{sql:this.mapInlineParam($,o),params:[]};let v=["none"];if(m)v=[m(l.encoder)];return{sql:x(f.value++,$),params:[$],typings:v}}if(z(l,mc))return{sql:x(f.value++,l),params:[l],typings:["none"]};if(z(l,N.Aliased)&&l.fieldAlias!==void 0)return{sql:p(l.fieldAlias),params:[]};if(z(l,ci)){if(l._.isWith)return{sql:p(l._.alias),params:[]};return this.buildQueryFromSourceParams([new pi("("),l._.sql,new pi(") "),new dm(l._.alias)],o)}if(UT(l)){if(l.schema)return{sql:p(l.schema)+"."+p(l.enumName),params:[]};return{sql:p(l.enumName),params:[]}}if(Ql(l)){if(l.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([l.getSQL()],o);return this.buildQueryFromSourceParams([new pi("("),l.getSQL(),new pi(")")],o)}if(a)return{sql:this.mapInlineParam(l,o),params:[]};return{sql:x(f.value++,l),params:[l],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 N.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[w]="Name";brand;getSQL(){return new N([this])}}function BT(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var yT={mapFromDriverValue:(n)=>n},LT={mapToDriverValue:(n)=>n},wb={...yT,...LT};class Li{constructor(n,i=LT){this.value=n,this.encoder=i}static[w]="Param";brand;getSQL(){return new N([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 N(o)}((n)=>{function i(){return new N([])}n.empty=i;function o(f){return new N(f)}n.fromList=o;function c(f){return new N([new pi(f)])}n.raw=c;function p(f,l){let $=[];for(let[v,T]of f.entries()){if(v>0&&l!==void 0)$.push(l);$.push(T)}return new N($)}n.join=p;function x(f){return new dm(f)}n.identifier=x;function m(f){return new mc(f)}n.placeholder=m;function a(f,l){return new Li(f,l)}n.param=a})(A||(A={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[w]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(N||(N={}));class mc{constructor(n){this.name=n}static[w]="Placeholder";getSQL(){return new N([this])}}function Ol(n,i){return n.map((o)=>{if(z(o,mc)){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,mc)){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})}var jW=Symbol.for("drizzle:IsDrizzleView");class ui{static[w]="View";[Bn];[jW]=!0;constructor({name:n,schema:i,selectedFields:o,query:c}){this[Bn]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new N([this])}}On.prototype.getSQL=function(){return new N([this])};L.prototype.getSQL=function(){return new N([this])};ci.prototype.getSQL=function(){return new N([this])};class Rp{constructor(n){this.table=n}static[w]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class Ex{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[w]="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===Bn)return{...n[Bn],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((x)=>{p[x]=new Proxy(c[x],new Rp(new Proxy(n,this)))}),p}let o=n[i];if(z(o,On))return new Proxy(o,new Rp(new Proxy(n,this)));return o}}function em(n,i){return new Proxy(n,new Ex(i,!1))}function Ho(n,i){return new Proxy(n,new Rp(new Proxy(n.table,new Ex(i,!1))))}function El(n,i){return new N.Aliased(Ux(n.sql,i),n.fieldAlias)}function Ux(n,i){return A.join(n.queryChunks.map((o)=>{if(z(o,On))return Ho(o,i);if(z(o,N))return Ux(o,i);if(z(o,N.Aliased))return El(o,i);return o}))}class na extends Error{static[w]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Ul extends na{static[w]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function bi(n,i){if(BT(i)&&!Ql(n)&&!z(n,Li)&&!z(n,mc)&&!z(n,On)&&!z(n,L)&&!z(n,ui))return new Li(n,i);return n}var Qo=(n,i)=>{return A`${n} = ${bi(i,n)}`},NT=(n,i)=>{return A`${n} <> ${bi(i,n)}`};function Vc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new pi("("),A.join(i,new pi(" and ")),new pi(")")])}function DT(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new pi("("),A.join(i,new pi(" or ")),new pi(")")])}function CT(n){return A`not ${n}`}var ia=(n,i)=>{return A`${n} > ${bi(i,n)}`},hT=(n,i)=>{return A`${n} >= ${bi(i,n)}`},IT=(n,i)=>{return A`${n} < ${bi(i,n)}`},kT=(n,i)=>{return A`${n} <= ${bi(i,n)}`};function sT(n,i){if(Array.isArray(i)){if(i.length===0)return A`false`;return A`${n} in ${i.map((o)=>bi(o,n))}`}return A`${n} in ${bi(i,n)}`}function ZT(n,i){if(Array.isArray(i)){if(i.length===0)return A`true`;return A`${n} not in ${i.map((o)=>bi(o,n))}`}return A`${n} not in ${bi(i,n)}`}function qT(n){return A`${n} is null`}function PT(n){return A`${n} is not null`}function tT(n){return A`exists ${n}`}function rT(n){return A`not exists ${n}`}function gT(n,i,o){return A`${n} between ${bi(i,n)} and ${bi(o,n)}`}function dT(n,i,o){return A`${n} not between ${bi(i,n)} and ${bi(o,n)}`}function eT(n,i){return A`${n} like ${i}`}function nJ(n,i){return A`${n} not like ${i}`}function iJ(n,i){return A`${n} ilike ${i}`}function oJ(n,i){return A`${n} not ilike ${i}`}function cJ(n){return A`${n} asc`}function pJ(n){return A`${n} desc`}class xJ{static[w]="ConsoleLogWriter";write(n){console.log(n)}}class Vl{static[w]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new xJ}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 _l{static[w]="NoopLogger";logQuery(){}}class Qi{static[w]="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 mJ(n,i,o){let c={},p=n.reduce((x,{path:m,field:a},f)=>{let l;if(z(a,On))l=a;else if(z(a,N))l=a.decoder;else l=a.sql.decoder;let $=x;for(let[v,T]of m.entries())if(v<m.length-1){if(!(T in $))$[T]={};$=$[T]}else{let F=i[f],R=$[T]=F===null?null:l.mapFromDriverValue(F);if(o&&z(a,On)&&m.length===2){let S=m[0];if(!(S in c))c[S]=R===null?di(a.table):!1;else if(typeof c[S]==="string"&&c[S]!==di(a.table))c[S]=!1}}return x},{});if(o&&Object.keys(c).length>0){for(let[x,m]of Object.entries(c))if(typeof m==="string"&&!o[m])p[x]=null}return p}function ei(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(z(p,On)||z(p,N)||z(p,N.Aliased))o.push({path:x,field:p});else if(z(p,L))o.push(...ei(p[L.Symbol.Columns],x));else o.push(...ei(p,x));return o},[])}function Vx(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,x]of o.entries())if(x!==c[p])return!1;return!0}function oa(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(z(p,N)||z(p,On))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 aJ(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 fJ(n){return n[L.Symbol.Columns]}function yo(n){return z(n,ci)?n._.alias:z(n,ui)?n[Bn].name:z(n,N)?void 0:n[L.Symbol.IsAlias]?n[L.Symbol.Name]:n[L.Symbol.BaseName]}function Jn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function lJ(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[w]="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 $J extends ac{static[w]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new vJ(n,this.config)}}class vJ extends _{static[w]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class TJ extends ac{static[w]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new JJ(n,this.config)}}class JJ extends _{static[w]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function wJ(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new $J(o);return new TJ(o)}class AJ extends I{static[w]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new SJ(n,this.config)}}class SJ extends _{static[w]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class FJ extends I{static[w]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new MJ(n,this.config)}}class MJ extends _{static[w]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function RJ(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new AJ(o);return new FJ(o)}class WJ extends I{static[w]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new KJ(n,this.config)}}class KJ extends _{static[w]="PgBoolean";getSQLType(){return"boolean"}}function _x(n){return new WJ(n??"")}class XJ extends I{static[w]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new GJ(n,this.config)}}class GJ extends _{static[w]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function YJ(n,i={}){let{name:o,config:c}=Jn(n,i);return new XJ(o,c)}class zJ extends I{static[w]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new HJ(n,this.config)}}class HJ extends _{static[w]="PgCidr";getSQLType(){return"cidr"}}function QJ(n){return new zJ(n??"")}class OJ extends I{static[w]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new EJ(n,this.config)}}class EJ extends _{static[w]="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 UJ(n){return(i,o)=>{let{name:c,config:p}=Jn(i,o);return new OJ(c,p,n)}}class Lo extends I{static[w]="PgDateColumnBaseBuilder";defaultNow(){return this.default(A`now()`)}}class VJ extends Lo{static[w]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new ca(n,this.config)}}class ca extends _{static[w]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class _J extends Lo{static[w]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new pa(n,this.config)}}class pa extends _{static[w]="PgDateString";getSQLType(){return"date"}}function uJ(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new VJ(o);return new _J(o)}class bJ extends I{static[w]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new jJ(n,this.config)}}class jJ extends _{static[w]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function BJ(n){return new bJ(n??"")}class yJ extends I{static[w]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new LJ(n,this.config)}}class LJ extends _{static[w]="PgInet";getSQLType(){return"inet"}}function NJ(n){return new yJ(n??"")}class DJ extends ac{static[w]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new CJ(n,this.config)}}class CJ extends _{static[w]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function xa(n){return new DJ(n??"")}class hJ extends I{static[w]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new IJ(n,this.config)}}class IJ extends _{static[w]="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 kJ(n,i={}){let{name:o,config:c}=Jn(n,i);return new hJ(o,c)}class sJ extends I{static[w]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new ma(n,this.config)}}class ma extends _{static[w]="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 ZJ(n){return new sJ(n??"")}class qJ extends I{static[w]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new aa(n,this.config)}}class aa extends _{static[w]="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 PJ(n){return new qJ(n??"")}class tJ extends I{static[w]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new rJ(n,this.config)}}class rJ extends _{static[w]="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 gJ extends I{static[w]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new dJ(n,this.config)}}class dJ extends _{static[w]="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 eJ(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new tJ(o);return new gJ(o)}class nw extends I{static[w]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new iw(n,this.config)}}class iw extends _{static[w]="PgMacaddr";getSQLType(){return"macaddr"}}function ow(n){return new nw(n??"")}class cw extends I{static[w]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new pw(n,this.config)}}class pw extends _{static[w]="PgMacaddr8";getSQLType(){return"macaddr8"}}function xw(n){return new cw(n??"")}class mw extends I{static[w]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new fa(n,this.config)}}class fa extends _{static[w]="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 aw(n,i){let{name:o,config:c}=Jn(n,i);return new mw(o,c?.precision,c?.scale)}class fw extends I{static[w]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new lw(n,this.config)}}class lw extends _{static[w]="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 $w extends I{static[w]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new vw(n,this.config)}}class vw extends _{static[w]="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 Tw(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new fw(o);return new $w(o)}function BW(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 Jw(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 ul(n){let i=BW(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),x=p.getUint32(o,c===1);o+=4;let m;if(x&536870912)m=p.getUint32(o,c===1),o+=4;if((x&65535)===1){let a=Jw(i,o);o+=8;let f=Jw(i,o);return o+=8,[a,f]}throw new Error("Unsupported geometry type")}class ww extends I{static[w]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new Aw(n,this.config)}}class Aw extends _{static[w]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return ul(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class Sw extends I{static[w]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new Fw(n,this.config)}}class Fw extends _{static[w]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=ul(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function Mw(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new ww(o);return new Sw(o)}class Rw extends I{static[w]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new Ww(n,this.config)}}class Ww extends _{static[w]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function Kw(n){return new Rw(n??"")}class Xw extends I{static[w]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new Gw(n,this.config)}}class Gw extends _{static[w]="PgSerial";getSQLType(){return"serial"}}function Yw(n){return new Xw(n??"")}class zw extends ac{static[w]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new Hw(n,this.config)}}class Hw extends _{static[w]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function Qw(n){return new zw(n??"")}class Ow extends I{static[w]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new Ew(n,this.config)}}class Ew extends _{static[w]="PgSmallSerial";getSQLType(){return"smallserial"}}function Uw(n){return new Ow(n??"")}class Vw extends I{static[w]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new _w(n,this.config)}}class _w extends _{static[w]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function uw(n,i={}){let{name:o,config:c}=Jn(n,i);return new Vw(o,c)}class bw extends Lo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[w]="PgTimeBuilder";build(n){return new la(n,this.config)}}class la extends _{static[w]="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 jw(n,i={}){let{name:o,config:c}=Jn(n,i);return new bw(o,c.withTimezone??!1,c.precision)}class Bw extends Lo{static[w]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new $a(n,this.config)}}class $a extends _{static[w]="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 yw extends Lo{static[w]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new va(n,this.config)}}class va extends _{static[w]="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 Jo(n,i={}){let{name:o,config:c}=Jn(n,i);if(c?.mode==="string")return new yw(o,c.withTimezone??!1,c.precision);return new Bw(o,c?.withTimezone??!1,c?.precision)}class Lw extends I{static[w]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(A`gen_random_uuid()`)}build(n){return new Ta(n,this.config)}}class Ta extends _{static[w]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new Lw(n??"")}class Nw extends I{static[w]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new Dw(n,this.config)}}class Dw extends _{static[w]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function $i(n,i={}){let{name:o,config:c}=Jn(n,i);return new Nw(o,c)}class Cw extends I{static[w]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new hw(n,this.config)}}class hw extends _{static[w]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function Iw(n,i){let{name:o,config:c}=Jn(n,i);return new Cw(o,c)}class kw extends I{static[w]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new sw(n,this.config)}}class sw extends _{static[w]="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 Zw(n,i){let{name:o,config:c}=Jn(n,i);return new kw(o,c)}class qw extends I{static[w]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new Pw(n,this.config)}}class Pw extends _{static[w]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function tw(n,i){let{name:o,config:c}=Jn(n,i);return new qw(o,c)}class rw extends I{static[w]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new gw(n,this.config)}}class gw extends _{static[w]="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 dw(n,i){let{name:o,config:c}=Jn(n,i);return new rw(o,c)}function ew(){return{bigint:wJ,bigserial:RJ,boolean:_x,char:YJ,cidr:QJ,customType:UJ,date:uJ,doublePrecision:BJ,inet:NJ,integer:xa,interval:kJ,json:ZJ,jsonb:PJ,line:eJ,macaddr:ow,macaddr8:xw,numeric:aw,point:Tw,geometry:Mw,real:Kw,serial:Yw,smallint:Qw,smallserial:Uw,text:uw,time:jw,timestamp:Jo,uuid:Ni,varchar:$i,bit:Iw,halfvec:Zw,sparsevec:tw,vector:dw}}var bl=Symbol.for("drizzle:PgInlineForeignKeys"),nA=Symbol.for("drizzle:EnableRLS");class vi extends L{static[w]="PgTable";static Symbol=Object.assign({},L.Symbol,{InlineForeignKeys:bl,EnableRLS:nA});[bl]=[];[nA]=!1;[L.Symbol.ExtraConfigBuilder]=void 0}function yW(n,i,o,c,p=n){let x=new vi(n,c,p),m=typeof i==="function"?i(ew()):i,a=Object.fromEntries(Object.entries(m).map(([$,v])=>{let T=v;T.setName($);let F=T.build(x);return x[bl].push(...T.buildForeignKeys(F,x)),[$,F]})),f=Object.fromEntries(Object.entries(m).map(([$,v])=>{let T=v;T.setName($);let F=T.buildExtraConfigColumn(x);return[$,F]})),l=Object.assign(x,a);if(l[L.Symbol.Columns]=a,l[L.Symbol.ExtraConfigColumns]=f,o)l[vi.Symbol.ExtraConfigBuilder]=o;return Object.assign(l,{enableRLS:()=>{return l[vi.Symbol.EnableRLS]=!0,l}})}var fc=(n,i,o)=>{return yW(n,i,o,void 0)};function iA(...n){if(n[0].columns)return new ux(n[0].columns,n[0].name);return new ux(n)}class ux{static[w]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new oA(n,this.columns,this.name)}}class oA{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[w]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[vi.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class jl{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[L.Symbol.Name]}static[w]="Relation";referencedTableName;fieldName}class cA{constructor(n,i){this.table=n,this.config=i}static[w]="Relations"}class lc extends jl{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[w]="One";withFieldName(n){let i=new lc(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class bx extends jl{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[w]="Many";withFieldName(n){let i=new bx(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function pA(){return{and:Vc,between:gT,eq:Qo,exists:tT,gt:ia,gte:hT,ilike:iJ,inArray:sT,isNull:qT,isNotNull:PT,like:eT,lt:IT,lte:kT,ne:NT,not:CT,notBetween:dT,notExists:rT,notLike:nJ,notIlike:oJ,notInArray:ZT,or:DT,sql:A}}function xA(){return{sql:A,asc:cJ,desc:pJ}}function mA(n,i){if(Object.keys(n).length===1&&"default"in n&&!z(n.default,L))n=n.default;let o={},c={},p={};for(let[x,m]of Object.entries(n))if(z(m,L)){let a=Uc(m),f=c[a];o[a]=x,p[x]={tsName:x,dbName:m[L.Symbol.Name],schema:m[L.Symbol.Schema],columns:m[L.Symbol.Columns],relations:f?.relations??{},primaryKey:f?.primaryKey??[]};for(let $ of Object.values(m[L.Symbol.Columns]))if($.primary)p[x].primaryKey.push($);let l=m[L.Symbol.ExtraConfigBuilder]?.(m[L.Symbol.ExtraConfigColumns]);if(l){for(let $ of Object.values(l))if(z($,ux))p[x].primaryKey.push(...$.columns)}}else if(z(m,cA)){let a=Uc(m.table),f=o[a],l=m.config(i(m.table)),$;for(let[v,T]of Object.entries(l))if(f){let F=p[f];if(F.relations[v]=T,$)F.primaryKey.push(...$)}else{if(!(a in c))c[a]={relations:{},primaryKey:$};c[a].relations[v]=T}}return{tables:p,tableNamesMap:o}}function LW(n){return function i(o,c){return new lc(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function NW(n){return function i(o,c){return new bx(n,o,c)}}function aA(n,i,o){if(z(o,lc)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Uc(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 x=o.sourceTable,m=i[Uc(x)];if(!m)throw new Error(`Table "${x[L.Symbol.Name]}" not found in schema`);let a=[];for(let f of Object.values(p.relations))if(o.relationName&&o!==f&&f.relationName===o.relationName||!o.relationName&&f.referencedTable===o.sourceTable)a.push(f);if(a.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(a[0]&&z(a[0],lc)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function fA(n){return{one:LW(n),many:NW(n)}}function Ja(n,i,o,c,p=(x)=>x){let x={};for(let[m,a]of c.entries())if(a.isJson){let f=i.relations[a.tsKey],l=o[m],$=typeof l==="string"?JSON.parse(l):l;x[a.tsKey]=z(f,lc)?$&&Ja(n,n[a.relationTableTsKey],$,a.selection,p):$.map((v)=>Ja(n,n[a.relationTableTsKey],v,a.selection,p))}else{let f=p(o[m]),l=a.field,$;if(z(l,On))$=l;else if(z(l,N))$=l.decoder;else $=l.sql.decoder;x[a.tsKey]=f===null?null:$.mapFromDriverValue(f)}return x}var rM=Ff(tM(),1),{Server:gM,Namespace:AN,Socket:SN}=rM.default;import{readFileSync as vR}from"fs";import{resolve as j$}from"path";var Fn;(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 x={};for(let m of p)x[m]=m;return x},n.getValidEnumValues=(p)=>{let x=n.objectKeys(p).filter((a)=>typeof p[p[a]]!=="number"),m={};for(let a of x)m[a]=p[a];return n.objectValues(m)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(x){return p[x]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let x=[];for(let m in p)if(Object.prototype.hasOwnProperty.call(p,m))x.push(m);return x},n.find=(p,x)=>{for(let m of p)if(x(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,x=" | "){return p.map((m)=>typeof m==="string"?`'${m}'`:m).join(x)}n.joinValues=c,n.jsonStringifyReplacer=(p,x)=>{if(typeof x==="bigint")return x.toString();return x}})(Fn||(Fn={}));var V$;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(V$||(V$={}));var D=Fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Io=(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}},E=Fn.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"]),j5=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class Ii extends Error{get errors(){return this.issues}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}format(n){let i=n||function(p){return p.message},o={_errors:[]},c=(p)=>{for(let x of p.issues)if(x.code==="invalid_union")x.unionErrors.map(c);else if(x.code==="invalid_return_type")c(x.returnTypeError);else if(x.code==="invalid_arguments")c(x.argumentsError);else if(x.path.length===0)o._errors.push(i(x));else{let m=o,a=0;while(a<x.path.length){let f=x.path[a];if(a!==x.path.length-1)m[f]=m[f]||{_errors:[]};else m[f]=m[f]||{_errors:[]},m[f]._errors.push(i(x));m=m[f],a++}}};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,Fn.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 yp=(n,i)=>{let o;switch(n.code){case E.invalid_type:if(n.received===D.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case E.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Fn.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:o=`Unrecognized key(s) in object: ${Fn.joinValues(n.keys,", ")}`;break;case E.invalid_union:o="Invalid input";break;case E.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Fn.joinValues(n.options)}`;break;case E.invalid_enum_value:o=`Invalid enum value. Expected ${Fn.joinValues(n.options)}, received '${n.received}'`;break;case E.invalid_arguments:o="Invalid function arguments";break;case E.invalid_return_type:o="Invalid function return type";break;case E.invalid_date:o="Invalid date";break;case E.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 Fn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case E.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 E.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 E.custom:o="Invalid input";break;case E.invalid_intersection_types:o="Intersection results could not be merged";break;case E.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case E.not_finite:o="Number must be finite";break;default:o=i.defaultError,Fn.assertNever(n)}return{message:o}},nR=yp;function B5(n){nR=n}function Da(){return nR}var Ca=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,x=[...o,...p.path||[]],m={...p,path:x};if(p.message!==void 0)return{...p,path:x,message:p.message};let a="",f=c.filter((l)=>!!l).slice().reverse();for(let l of f)a=l(m,{data:i,defaultError:a}).message;return{...p,path:x,message:a}},y5=[];function B(n,i){let o=Da(),c=Ca({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===yp?void 0:yp].filter((p)=>!!p)});n.common.issues.push(c)}class Gi{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,x=await c.value;o.push({key:p,value:x})}return Gi.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:x}=c;if(p.status==="aborted")return nn;if(x.status==="aborted")return nn;if(p.status==="dirty")n.dirty();if(x.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof x.value!=="undefined"||c.alwaysSet))o[p.value]=x.value}return{status:n.value,value:o}}}var nn=Object.freeze({status:"aborted"}),jp=(n)=>({status:"dirty",value:n}),Ei=(n)=>({status:"valid",value:n}),_$=(n)=>n.status==="aborted",u$=(n)=>n.status==="dirty",Dc=(n)=>n.status==="valid",kx=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function ha(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 iR(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 Z;(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})(Z||(Z={}));var hx,Ix;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 dM=(n,i)=>{if(Dc(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 an(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,a)=>{var f,l;let{message:$}=n;if(m.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:a.defaultError};if(typeof a.data==="undefined")return{message:(f=$!==null&&$!==void 0?$:c)!==null&&f!==void 0?f:a.defaultError};if(m.code!=="invalid_type")return{message:a.defaultError};return{message:(l=$!==null&&$!==void 0?$:o)!==null&&l!==void 0?l:a.defaultError}},description:p}}class fn{get description(){return this._def.description}_getType(n){return Io(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Io(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Gi,ctx:{common:n.parent.common,data:n.data,parsedType:Io(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(kx(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:Io(n)},p=this._parseSync({data:n,path:c.path,parent:c});return dM(c,p)}"~validate"(n){var i,o;let c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Io(n)};if(!this["~standard"].async)try{let p=this._parseSync({data:n,path:[],parent:c});return Dc(p)?{value:p.value}:{issues:c.common.issues}}catch(p){if((o=(i=p===null||p===void 0?void 0:p.message)===null||i===void 0?void 0:i.toLowerCase())===null||o===void 0?void 0:o.includes("encountered"))this["~standard"].async=!0;c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then((p)=>Dc(p)?{value:p.value}:{issues:c.common.issues})}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:Io(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(kx(c)?c:Promise.resolve(c));return dM(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 x=n(c),m=()=>p.addIssue({code:E.custom,...o(c)});if(typeof Promise!=="undefined"&&x instanceof Promise)return x.then((a)=>{if(!a)return m(),!1;else return!0});if(!x)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 co({schema:this,typeName:d.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(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),this["~standard"]={version:1,vendor:"zod",validate:(i)=>this["~validate"](i)}}optional(){return Ro.create(this,this._def)}nullable(){return ko.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mo.create(this)}promise(){return kc.create(this,this._def)}or(n){return Cp.create([this,n],this._def)}and(n){return hp.create(this,n,this._def)}transform(n){return new co({...an(this._def),schema:this,typeName:d.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new Zp({...an(this._def),innerType:this,defaultValue:i,typeName:d.ZodDefault})}brand(){return new ka({typeName:d.ZodBranded,type:this,...an(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new qp({...an(this._def),innerType:this,catchValue:i,typeName:d.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return rx.create(this,n)}readonly(){return Pp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var L5=/^c[^\s-]{8,}$/i,N5=/^[0-9a-z]+$/,D5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C5=/^[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,h5=/^[a-z0-9_-]{21}$/i,I5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,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)?)??$/,s5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Z5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",U$,q5=/^(?:(?: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])$/,P5=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,t5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,g5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,d5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,oR="((\\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])))",e5=new RegExp(`^${oR}$`);function cR(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 n9(n){return new RegExp(`^${cR(n)}$`)}function pR(n){let i=`${oR}T${cR(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 i9(n,i){if((i==="v4"||!i)&&q5.test(n))return!0;if((i==="v6"||!i)&&t5.test(n))return!0;return!1}function o9(n,i){if(!I5.test(n))return!1;try{let[o]=n.split("."),c=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),p=JSON.parse(atob(c));if(typeof p!=="object"||p===null)return!1;if(!p.typ||!p.alg)return!1;if(i&&p.alg!==i)return!1;return!0}catch(o){return!1}}function c9(n,i){if((i==="v4"||!i)&&P5.test(n))return!0;if((i==="v6"||!i)&&r5.test(n))return!0;return!1}class Fo extends fn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==D.string){let p=this._getOrReturnCtx(n);return B(p,{code:E.invalid_type,expected:D.string,received:p.parsedType}),nn}let o=new Gi,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:E.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:E.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let x=n.data.length>p.value,m=n.data.length<p.value;if(x||m){if(c=this._getOrReturnCtx(n,c),x)B(c,{code:E.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)B(c,{code:E.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!s5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"email",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!U$)U$=new RegExp(Z5,"u");if(!U$.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"emoji",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!C5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"uuid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!h5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"nanoid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!L5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!N5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid2",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!D5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"ulid",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(x){c=this._getOrReturnCtx(n,c),B(c,{validation:"url",code:E.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:E.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:E.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:E.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:E.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!pR(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:E.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!e5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:E.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!n9(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:E.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!k5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"duration",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!i9(n.data,p.version))c=this._getOrReturnCtx(n,c),B(c,{validation:"ip",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="jwt"){if(!o9(n.data,p.alg))c=this._getOrReturnCtx(n,c),B(c,{validation:"jwt",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cidr"){if(!c9(n.data,p.version))c=this._getOrReturnCtx(n,c),B(c,{validation:"cidr",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!g5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"base64",code:E.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64url"){if(!d5.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"base64url",code:E.invalid_string,message:p.message}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:E.invalid_string,...Z.errToObj(o)})}_addCheck(n){return new Fo({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...Z.errToObj(n)})}url(n){return this._addCheck({kind:"url",...Z.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...Z.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...Z.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...Z.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...Z.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...Z.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...Z.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...Z.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...Z.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...Z.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...Z.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...Z.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,...Z.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,...Z.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...Z.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...Z.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...Z.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...Z.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...Z.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...Z.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...Z.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...Z.errToObj(i)})}nonempty(n){return this.min(1,Z.errToObj(n))}trim(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fo({...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 isCIDR(){return!!this._def.checks.find((n)=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find((n)=>n.kind==="base64url")}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}}Fo.create=(n)=>{var i;return new Fo({checks:[],typeName:d.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...an(n)})};function p9(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,x=parseInt(n.toFixed(p).replace(".","")),m=parseInt(i.toFixed(p).replace(".",""));return x%m/Math.pow(10,p)}class Ac extends fn{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 B(p,{code:E.invalid_type,expected:D.number,received:p.parsedType}),nn}let o=void 0,c=new Gi;for(let p of this._def.checks)if(p.kind==="int"){if(!Fn.isInteger(n.data))o=this._getOrReturnCtx(n,o),B(o,{code:E.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:E.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:E.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(p9(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),B(o,{code:E.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:E.not_finite,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,Z.toString(i))}gt(n,i){return this.setLimit("min",n,!1,Z.toString(i))}lte(n,i){return this.setLimit("max",n,!0,Z.toString(i))}lt(n,i){return this.setLimit("max",n,!1,Z.toString(i))}setLimit(n,i,o,c){return new Ac({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:Z.toString(c)}]})}_addCheck(n){return new Ac({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:Z.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:Z.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:Z.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.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"&&Fn.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)}}Ac.create=(n)=>{return new Ac({checks:[],typeName:d.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...an(n)})};class Sc extends fn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch(p){return this._getInvalidInput(n)}if(this._getType(n)!==D.bigint)return this._getInvalidInput(n);let o=void 0,c=new Gi;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:E.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:E.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:E.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}_getInvalidInput(n){let i=this._getOrReturnCtx(n);return B(i,{code:E.invalid_type,expected:D.bigint,received:i.parsedType}),nn}gte(n,i){return this.setLimit("min",n,!0,Z.toString(i))}gt(n,i){return this.setLimit("min",n,!1,Z.toString(i))}lte(n,i){return this.setLimit("max",n,!0,Z.toString(i))}lt(n,i){return this.setLimit("max",n,!1,Z.toString(i))}setLimit(n,i,o,c){return new Sc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:Z.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:Z.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:Z.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:d.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...an(n)})};class Lp extends fn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==D.boolean){let o=this._getOrReturnCtx(n);return B(o,{code:E.invalid_type,expected:D.boolean,received:o.parsedType}),nn}return Ei(n.data)}}Lp.create=(n)=>{return new Lp({typeName:d.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...an(n)})};class Cc extends fn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==D.date){let p=this._getOrReturnCtx(n);return B(p,{code:E.invalid_type,expected:D.date,received:p.parsedType}),nn}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return B(p,{code:E.invalid_date}),nn}let o=new Gi,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:E.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:E.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Cc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:Z.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:Z.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}}Cc.create=(n)=>{return new Cc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:d.ZodDate,...an(n)})};class sx extends fn{_parse(n){if(this._getType(n)!==D.symbol){let o=this._getOrReturnCtx(n);return B(o,{code:E.invalid_type,expected:D.symbol,received:o.parsedType}),nn}return Ei(n.data)}}sx.create=(n)=>{return new sx({typeName:d.ZodSymbol,...an(n)})};class Np extends fn{_parse(n){if(this._getType(n)!==D.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:E.invalid_type,expected:D.undefined,received:o.parsedType}),nn}return Ei(n.data)}}Np.create=(n)=>{return new Np({typeName:d.ZodUndefined,...an(n)})};class Dp extends fn{_parse(n){if(this._getType(n)!==D.null){let o=this._getOrReturnCtx(n);return B(o,{code:E.invalid_type,expected:D.null,received:o.parsedType}),nn}return Ei(n.data)}}Dp.create=(n)=>{return new Dp({typeName:d.ZodNull,...an(n)})};class hc extends fn{constructor(){super(...arguments);this._any=!0}_parse(n){return Ei(n.data)}}hc.create=(n)=>{return new hc({typeName:d.ZodAny,...an(n)})};class wc extends fn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Ei(n.data)}}wc.create=(n)=>{return new wc({typeName:d.ZodUnknown,...an(n)})};class Eo extends fn{_parse(n){let i=this._getOrReturnCtx(n);return B(i,{code:E.invalid_type,expected:D.never,received:i.parsedType}),nn}}Eo.create=(n)=>{return new Eo({typeName:d.ZodNever,...an(n)})};class Zx extends fn{_parse(n){if(this._getType(n)!==D.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:E.invalid_type,expected:D.void,received:o.parsedType}),nn}return Ei(n.data)}}Zx.create=(n)=>{return new Zx({typeName:d.ZodVoid,...an(n)})};class Mo extends fn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==D.array)return B(i,{code:E.invalid_type,expected:D.array,received:i.parsedType}),nn;if(c.exactLength!==null){let x=i.data.length>c.exactLength.value,m=i.data.length<c.exactLength.value;if(x||m)B(i,{code:x?E.too_big:E.too_small,minimum:m?c.exactLength.value:void 0,maximum:x?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:E.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:E.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((x,m)=>{return c.type._parseAsync(new Wo(i,x,i.path,m))})).then((x)=>{return Gi.mergeArray(o,x)});let p=[...i.data].map((x,m)=>{return c.type._parseSync(new Wo(i,x,i.path,m))});return Gi.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Mo({...this._def,minLength:{value:n,message:Z.toString(i)}})}max(n,i){return new Mo({...this._def,maxLength:{value:n,message:Z.toString(i)}})}length(n,i){return new Mo({...this._def,exactLength:{value:n,message:Z.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:d.ZodArray,...an(i)})};function bp(n){if(n instanceof hn){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=Ro.create(bp(c))}return new hn({...n._def,shape:()=>i})}else if(n instanceof Mo)return new Mo({...n._def,type:bp(n.element)});else if(n instanceof Ro)return Ro.create(bp(n.unwrap()));else if(n instanceof ko)return ko.create(bp(n.unwrap()));else if(n instanceof Uo)return Uo.create(n.items.map((i)=>bp(i)));else return n}class hn extends fn{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=Fn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==D.object){let f=this._getOrReturnCtx(n);return B(f,{code:E.invalid_type,expected:D.object,received:f.parsedType}),nn}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),m=[];if(!(this._def.catchall instanceof Eo&&this._def.unknownKeys==="strip")){for(let f in c.data)if(!x.includes(f))m.push(f)}let a=[];for(let f of x){let l=p[f],$=c.data[f];a.push({key:{status:"valid",value:f},value:l._parse(new Wo(c,$,c.path,f)),alwaysSet:f in c.data})}if(this._def.catchall instanceof Eo){let f=this._def.unknownKeys;if(f==="passthrough")for(let l of m)a.push({key:{status:"valid",value:l},value:{status:"valid",value:c.data[l]}});else if(f==="strict"){if(m.length>0)B(c,{code:E.unrecognized_keys,keys:m}),o.dirty()}else if(f==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let l of m){let $=c.data[l];a.push({key:{status:"valid",value:l},value:f._parse(new Wo(c,$,c.path,l)),alwaysSet:l in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let f=[];for(let l of a){let $=await l.key,v=await l.value;f.push({key:$,value:v,alwaysSet:l.alwaysSet})}return f}).then((f)=>{return Gi.mergeObjectSync(o,f)});else return Gi.mergeObjectSync(o,a)}get shape(){return this._def.shape()}strict(n){return Z.errToObj,new hn({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,m;let a=(x=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&x!==void 0?x:o.defaultError;if(i.code==="unrecognized_keys")return{message:(m=Z.errToObj(n).message)!==null&&m!==void 0?m:a};return{message:a}}}:{}})}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:d.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new hn({...this._def,catchall:n})}pick(n){let i={};return Fn.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 Fn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new hn({...this._def,shape:()=>i})}deepPartial(){return bp(this)}partial(n){let i={};return Fn.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 Fn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof Ro)p=p._def.innerType;i[o]=p}}),new hn({...this._def,shape:()=>i})}keyof(){return xR(Fn.objectKeys(this.shape))}}hn.create=(n,i)=>{return new hn({shape:()=>n,unknownKeys:"strip",catchall:Eo.create(),typeName:d.ZodObject,...an(i)})};hn.strictCreate=(n,i)=>{return new hn({shape:()=>n,unknownKeys:"strict",catchall:Eo.create(),typeName:d.ZodObject,...an(i)})};hn.lazycreate=(n,i)=>{return new hn({shape:n,unknownKeys:"strip",catchall:Eo.create(),typeName:d.ZodObject,...an(i)})};class Cp extends fn{_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 x=p.map((m)=>new Ii(m.ctx.common.issues));return B(i,{code:E.invalid_union,unionErrors:x}),nn}if(i.common.async)return Promise.all(o.map(async(p)=>{let x={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:x}),ctx:x}})).then(c);else{let p=void 0,x=[];for(let a of o){let f={...i,common:{...i.common,issues:[]},parent:null},l=a._parseSync({data:i.data,path:i.path,parent:f});if(l.status==="valid")return l;else if(l.status==="dirty"&&!p)p={result:l,ctx:f};if(f.common.issues.length)x.push(f.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=x.map((a)=>new Ii(a));return B(i,{code:E.invalid_union,unionErrors:m}),nn}}get options(){return this._def.options}}Cp.create=(n,i)=>{return new Cp({options:n,typeName:d.ZodUnion,...an(i)})};var ho=(n)=>{if(n instanceof Ip)return ho(n.schema);else if(n instanceof co)return ho(n.innerType());else if(n instanceof kp)return[n.value];else if(n instanceof Fc)return n.options;else if(n instanceof sp)return Fn.objectValues(n.enum);else if(n instanceof Zp)return ho(n._def.innerType);else if(n instanceof Np)return[void 0];else if(n instanceof Dp)return[null];else if(n instanceof Ro)return[void 0,...ho(n.unwrap())];else if(n instanceof ko)return[null,...ho(n.unwrap())];else if(n instanceof ka)return ho(n.unwrap());else if(n instanceof Pp)return ho(n.unwrap());else if(n instanceof qp)return ho(n._def.innerType);else return[]};class Ia extends fn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.object)return B(i,{code:E.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 B(i,{code:E.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 x=ho(p.shape[n]);if(!x.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let m of x){if(c.has(m))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(m)}`);c.set(m,p)}}return new Ia({typeName:d.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...an(o)})}}function b$(n,i){let o=Io(n),c=Io(i);if(n===i)return{valid:!0,data:n};else if(o===D.object&&c===D.object){let p=Fn.objectKeys(i),x=Fn.objectKeys(n).filter((a)=>p.indexOf(a)!==-1),m={...n,...i};for(let a of x){let f=b$(n[a],i[a]);if(!f.valid)return{valid:!1};m[a]=f.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 x=0;x<n.length;x++){let m=n[x],a=i[x],f=b$(m,a);if(!f.valid)return{valid:!1};p.push(f.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 hp extends fn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,x)=>{if(_$(p)||_$(x))return nn;let m=b$(p.value,x.value);if(!m.valid)return B(o,{code:E.invalid_intersection_types}),nn;if(u$(p)||u$(x))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,x])=>c(p,x));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}))}}hp.create=(n,i,o)=>{return new hp({left:n,right:i,typeName:d.ZodIntersection,...an(o)})};class Uo extends fn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.array)return B(o,{code:E.invalid_type,expected:D.array,received:o.parsedType}),nn;if(o.data.length<this._def.items.length)return B(o,{code:E.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)B(o,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((x,m)=>{let a=this._def.items[m]||this._def.rest;if(!a)return null;return a._parse(new Wo(o,x,o.path,m))}).filter((x)=>!!x);if(o.common.async)return Promise.all(p).then((x)=>{return Gi.mergeArray(i,x)});else return Gi.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new Uo({...this._def,rest:n})}}Uo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Uo({items:n,typeName:d.ZodTuple,rest:null,...an(i)})};class qx extends fn{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 B(o,{code:E.invalid_type,expected:D.object,received:o.parsedType}),nn;let c=[],p=this._def.keyType,x=this._def.valueType;for(let m in o.data)c.push({key:p._parse(new Wo(o,m,o.path,m)),value:x._parse(new Wo(o,o.data[m],o.path,m)),alwaysSet:m in o.data});if(o.common.async)return Gi.mergeObjectAsync(i,c);else return Gi.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof fn)return new qx({keyType:n,valueType:i,typeName:d.ZodRecord,...an(o)});return new qx({keyType:Fo.create(),valueType:n,typeName:d.ZodRecord,...an(i)})}}class Px extends fn{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 B(o,{code:E.invalid_type,expected:D.map,received:o.parsedType}),nn;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([m,a],f)=>{return{key:c._parse(new Wo(o,m,o.path,[f,"key"])),value:p._parse(new Wo(o,a,o.path,[f,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let a of x){let f=await a.key,l=await a.value;if(f.status==="aborted"||l.status==="aborted")return nn;if(f.status==="dirty"||l.status==="dirty")i.dirty();m.set(f.value,l.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let a of x){let{key:f,value:l}=a;if(f.status==="aborted"||l.status==="aborted")return nn;if(f.status==="dirty"||l.status==="dirty")i.dirty();m.set(f.value,l.value)}return{status:i.value,value:m}}}}Px.create=(n,i,o)=>{return new Px({valueType:i,keyType:n,typeName:d.ZodMap,...an(o)})};class Ic extends fn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==D.set)return B(o,{code:E.invalid_type,expected:D.set,received:o.parsedType}),nn;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)B(o,{code:E.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:E.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function x(a){let f=new Set;for(let l of a){if(l.status==="aborted")return nn;if(l.status==="dirty")i.dirty();f.add(l.value)}return{status:i.value,value:f}}let m=[...o.data.values()].map((a,f)=>p._parse(new Wo(o,a,o.path,f)));if(o.common.async)return Promise.all(m).then((a)=>x(a));else return x(m)}min(n,i){return new Ic({...this._def,minSize:{value:n,message:Z.toString(i)}})}max(n,i){return new Ic({...this._def,maxSize:{value:n,message:Z.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Ic.create=(n,i)=>{return new Ic({valueType:n,minSize:null,maxSize:null,typeName:d.ZodSet,...an(i)})};class Bp extends fn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.function)return B(i,{code:E.invalid_type,expected:D.function,received:i.parsedType}),nn;function o(m,a){return Ca({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Da(),yp].filter((f)=>!!f),issueData:{code:E.invalid_arguments,argumentsError:a}})}function c(m,a){return Ca({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Da(),yp].filter((f)=>!!f),issueData:{code:E.invalid_return_type,returnTypeError:a}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof kc){let m=this;return Ei(async function(...a){let f=new Ii([]),l=await m._def.args.parseAsync(a,p).catch((T)=>{throw f.addIssue(o(a,T)),f}),$=await Reflect.apply(x,this,l);return await m._def.returns._def.type.parseAsync($,p).catch((T)=>{throw f.addIssue(c($,T)),f})})}else{let m=this;return Ei(function(...a){let f=m._def.args.safeParse(a,p);if(!f.success)throw new Ii([o(a,f.error)]);let l=Reflect.apply(x,this,f.data),$=m._def.returns.safeParse(l,p);if(!$.success)throw new Ii([c(l,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new Bp({...this._def,args:Uo.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:Uo.create([]).rest(wc.create()),returns:i||wc.create(),typeName:d.ZodFunction,...an(o)})}}class Ip extends fn{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})}}Ip.create=(n,i)=>{return new Ip({getter:n,typeName:d.ZodLazy,...an(i)})};class kp extends fn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return B(i,{received:i.data,code:E.invalid_literal,expected:this._def.value}),nn}return{status:"valid",value:n.data}}get value(){return this._def.value}}kp.create=(n,i)=>{return new kp({value:n,typeName:d.ZodLiteral,...an(i)})};function xR(n,i){return new Fc({values:n,typeName:d.ZodEnum,...an(i)})}class Fc extends fn{constructor(){super(...arguments);hx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{expected:Fn.joinValues(o),received:i.parsedType,code:E.invalid_type}),nn}if(!ha(this,hx,"f"))iR(this,hx,new Set(this._def.values),"f");if(!ha(this,hx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{received:i.data,code:E.invalid_enum_value,options:o}),nn}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 Fc.create(n,{...this._def,...i})}exclude(n,i=this._def){return Fc.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}hx=new WeakMap;Fc.create=xR;class sp extends fn{constructor(){super(...arguments);Ix.set(this,void 0)}_parse(n){let i=Fn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==D.string&&o.parsedType!==D.number){let c=Fn.objectValues(i);return B(o,{expected:Fn.joinValues(c),received:o.parsedType,code:E.invalid_type}),nn}if(!ha(this,Ix,"f"))iR(this,Ix,new Set(Fn.getValidEnumValues(this._def.values)),"f");if(!ha(this,Ix,"f").has(n.data)){let c=Fn.objectValues(i);return B(o,{received:o.data,code:E.invalid_enum_value,options:c}),nn}return Ei(n.data)}get enum(){return this._def.values}}Ix=new WeakMap;sp.create=(n,i)=>{return new sp({values:n,typeName:d.ZodNativeEnum,...an(i)})};class kc extends fn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==D.promise&&i.common.async===!1)return B(i,{code:E.invalid_type,expected:D.promise,received:i.parsedType}),nn;let o=i.parsedType===D.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})}))}}kc.create=(n,i)=>{return new kc({type:n,typeName:d.ZodPromise,...an(i)})};class co extends fn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===d.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:(x)=>{if(B(o,x),x.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let x=c.transform(o.data,p);if(o.common.async)return Promise.resolve(x).then(async(m)=>{if(i.value==="aborted")return nn;let a=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(a.status==="aborted")return nn;if(a.status==="dirty")return jp(a.value);if(i.value==="dirty")return jp(a.value);return a});else{if(i.value==="aborted")return nn;let m=this._def.schema._parseSync({data:x,path:o.path,parent:o});if(m.status==="aborted")return nn;if(m.status==="dirty")return jp(m.value);if(i.value==="dirty")return jp(m.value);return m}}if(c.type==="refinement"){let x=(m)=>{let a=c.refinement(m,p);if(o.common.async)return Promise.resolve(a);if(a 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 x(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 x(m.value).then(()=>{return{status:i.value,value:m.value}})})}if(c.type==="transform")if(o.common.async===!1){let x=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Dc(x))return x;let m=c.transform(x.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((x)=>{if(!Dc(x))return x;return Promise.resolve(c.transform(x.value,p)).then((m)=>({status:i.value,value:m}))});Fn.assertNever(c)}}co.create=(n,i,o)=>{return new co({schema:n,typeName:d.ZodEffects,effect:i,...an(o)})};co.createWithPreprocess=(n,i,o)=>{return new co({schema:i,effect:{type:"preprocess",transform:n},typeName:d.ZodEffects,...an(o)})};class Ro extends fn{_parse(n){if(this._getType(n)===D.undefined)return Ei(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ro.create=(n,i)=>{return new Ro({innerType:n,typeName:d.ZodOptional,...an(i)})};class ko extends fn{_parse(n){if(this._getType(n)===D.null)return Ei(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ko.create=(n,i)=>{return new ko({innerType:n,typeName:d.ZodNullable,...an(i)})};class Zp extends fn{_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}}Zp.create=(n,i)=>{return new Zp({innerType:n,typeName:d.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...an(i)})};class qp extends fn{_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(kx(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}}qp.create=(n,i)=>{return new qp({innerType:n,typeName:d.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...an(i)})};class tx extends fn{_parse(n){if(this._getType(n)!==D.nan){let o=this._getOrReturnCtx(n);return B(o,{code:E.invalid_type,expected:D.nan,received:o.parsedType}),nn}return{status:"valid",value:n.data}}}tx.create=(n)=>{return new tx({typeName:d.ZodNaN,...an(n)})};var x9=Symbol("zod_brand");class ka extends fn{_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 rx extends fn{_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(),jp(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 rx({in:n,out:i,typeName:d.ZodPipeline})}}class Pp extends fn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Dc(c))c.value=Object.freeze(c.value);return c};return kx(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}Pp.create=(n,i)=>{return new Pp({innerType:n,typeName:d.ZodReadonly,...an(i)})};function mR(n,i={},o){if(n)return hc.create().superRefine((c,p)=>{var x,m;if(!n(c)){let a=typeof i==="function"?i(c):typeof i==="string"?{message:i}:i,f=(m=(x=a.fatal)!==null&&x!==void 0?x:o)!==null&&m!==void 0?m:!0,l=typeof a==="string"?{message:a}:a;p.addIssue({code:"custom",...l,fatal:f})}});return hc.create()}var m9={object:hn.lazycreate},d;(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"})(d||(d={}));var a9=(n,i={message:`Input not instance of ${n.name}`})=>mR((o)=>o instanceof n,i),aR=Fo.create,fR=Ac.create,f9=tx.create,l9=Sc.create,lR=Lp.create,$9=Cc.create,v9=sx.create,T9=Np.create,J9=Dp.create,w9=hc.create,A9=wc.create,S9=Eo.create,F9=Zx.create,M9=Mo.create,gx=hn.create,R9=hn.strictCreate,W9=Cp.create,K9=Ia.create,X9=hp.create,G9=Uo.create,Y9=qx.create,z9=Px.create,H9=Ic.create,Q9=Bp.create,O9=Ip.create,E9=kp.create,U9=Fc.create,V9=sp.create,_9=kc.create,eM=co.create,u9=Ro.create,b9=ko.create,j9=co.createWithPreprocess,B9=rx.create,y9=()=>aR().optional(),L9=()=>fR().optional(),N9=()=>lR().optional(),D9={string:(n)=>Fo.create({...n,coerce:!0}),number:(n)=>Ac.create({...n,coerce:!0}),boolean:(n)=>Lp.create({...n,coerce:!0}),bigint:(n)=>Sc.create({...n,coerce:!0}),date:(n)=>Cc.create({...n,coerce:!0})},C9=nn,Kn=Object.freeze({__proto__:null,defaultErrorMap:yp,setErrorMap:B5,getErrorMap:Da,makeIssue:Ca,EMPTY_PATH:y5,addIssueToContext:B,ParseStatus:Gi,INVALID:nn,DIRTY:jp,OK:Ei,isAborted:_$,isDirty:u$,isValid:Dc,isAsync:kx,get util(){return Fn},get objectUtil(){return V$},ZodParsedType:D,getParsedType:Io,ZodType:fn,datetimeRegex:pR,ZodString:Fo,ZodNumber:Ac,ZodBigInt:Sc,ZodBoolean:Lp,ZodDate:Cc,ZodSymbol:sx,ZodUndefined:Np,ZodNull:Dp,ZodAny:hc,ZodUnknown:wc,ZodNever:Eo,ZodVoid:Zx,ZodArray:Mo,ZodObject:hn,ZodUnion:Cp,ZodDiscriminatedUnion:Ia,ZodIntersection:hp,ZodTuple:Uo,ZodRecord:qx,ZodMap:Px,ZodSet:Ic,ZodFunction:Bp,ZodLazy:Ip,ZodLiteral:kp,ZodEnum:Fc,ZodNativeEnum:sp,ZodPromise:kc,ZodEffects:co,ZodTransformer:co,ZodOptional:Ro,ZodNullable:ko,ZodDefault:Zp,ZodCatch:qp,ZodNaN:tx,BRAND:x9,ZodBranded:ka,ZodPipeline:rx,ZodReadonly:Pp,custom:mR,Schema:fn,ZodSchema:fn,late:m9,get ZodFirstPartyTypeKind(){return d},coerce:D9,any:w9,array:M9,bigint:l9,boolean:lR,date:$9,discriminatedUnion:K9,effect:eM,enum:U9,function:Q9,instanceof:a9,intersection:X9,lazy:O9,literal:E9,map:z9,nan:f9,nativeEnum:V9,never:S9,null:J9,nullable:b9,number:fR,object:gx,oboolean:N9,onumber:L9,optional:u9,ostring:y9,pipeline:B9,preprocess:j9,promise:_9,record:Y9,set:H9,strictObject:R9,string:aR,symbol:v9,transformer:eM,tuple:G9,undefined:T9,union:W9,unknown:A9,void:F9,NEVER:C9,ZodIssueCode:E,quotelessJson:j5,ZodError:Ii});function $R(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[K,Q]of Object.entries(i))if(Q==="")delete i[K]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},x=typeof n.server==="object"?n.server:{},m=typeof n.shared==="object"?n.shared:{},a=gx(p),f=gx(x),l=gx(m),$=n.isServer??(typeof window==="undefined"||("Deno"in window)),v=a.merge(l),T=f.merge(l).merge(a),F=$?T.safeParse(i):v.safeParse(i),R=n.onValidationError??((K)=>{throw console.error("\u274C Invalid environment variables:",K.flatten().fieldErrors),new Error("Invalid environment variables")}),S=n.onInvalidAccess??((K)=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(F.success===!1)return R(F.error);let M=(K)=>{if(!n.clientPrefix)return!0;return!K.startsWith(n.clientPrefix)&&!(K in l.shape)},G=(K)=>{return $||!M(K)},H=(K)=>{return K==="__esModule"||K==="$$typeof"},y=(n.extends??[]).reduce((K,Q)=>{return Object.assign(K,Q)},{}),k=Object.assign(F.data,y);return new Proxy(k,{get(K,Q){if(typeof Q!=="string")return;if(H(Q))return;if(!G(Q))return S(Q);return Reflect.get(K,Q)}})}var h9="__vite_start_time"in globalThis,I9=typeof window!=="undefined",GN="vitest"in globalThis,tn=$R({isServer:!h9&&!I9,server:{CI:Kn.string().transform((n)=>!0).optional(),POSTGRES_USER:Kn.string(),POSTGRES_PASSWORD:Kn.string(),POSTGRES_DATABASE:Kn.string(),POSTGRES_HOST:Kn.string(),POSTGRES_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Kn.string().transform((n)=>JSON.parse(n)).pipe(Kn.array(Kn.string())),OPENAI_API_KEY:Kn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Kn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var TR=j$(import.meta.dirname,"../dev"),B$=tn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:vR(j$(TR,"./cert.pem"),"utf-8"),key:vR(j$(TR,"./key.pem"),"utf-8")}:void 0;var Mc=new Lf,$n=tn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:Mc.logger;on.STORE.loggers[0]=new Kc("warn",void 0,$n);if($n!==console)Object.assign(console,$n,{log:$n.info});import{spawn as k9}from"child_process";import{resolve as s9}from"path";function y$(n,i,o=n.logger){let c=tn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[s9(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let a=k9(p,m);return new Sx(a,i,o)}var JR=Ff(Fl(),1);var Z9=604800000,sa=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new JR.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[x,m]of c.entries())if(p-m>Z9)c.delete(x);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),$n.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import LG from"path";import SG from"os";import FG from"fs";var Za=new Map,L$=new Map,N$=Symbol("OriginError"),tp={};class po extends Promise{constructor(n,i,o,c,p={}){let x,m;super((a,f)=>{x=a,m=f});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=(a)=>(this.active=!1,x(a)),this.reject=(a)=>(this.active=!1,m(a)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[N$]=this.handler.debug?new Error:this.tagged&&q9(this.strings)}get origin(){return(this.handler.debug?this[N$].stack:this.tagged&&L$.has(this.strings)?L$.get(this.strings):L$.set(this.strings,this[N$].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,x)=>{this.cursorFn=(m)=>{return p({value:m,done:!1}),new Promise((a)=>o=a)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,x(m))});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 q9(n){if(Za.has(n))return Za.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,Za.set(n,new Error),Error.stackTraceLimit=i,Za.get(n)}class rp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var dn={connection:wR,postgres:AR,generic:SR,notSupported:FR};function wR(n,i,o){let{host:c,port:p}=o||i,x=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(x,wR),x}function AR(n){let i=new rp(n);return Error.captureStackTrace(i,AR),i}function SR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,SR),o}function FR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,FR),i}var P9={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 ta{then(){D$()}catch(){D$()}finally(){D$()}}class im extends ta{constructor(n){super();this.value=da(n)}}class Vo extends ta{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class ra extends ta{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=t9.map(([x,m])=>({fn:m,i:n.search(x)})).sort((x,m)=>x.i-m.i).pop();return p.i===-1?s$(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function ga(n,i,o,c){let p=n instanceof Vo?n.value:n;if(p===void 0){if(n instanceof Vo?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 Vo?(i.push(n.value),n.array?n.array[n.type||Pa(n.value)]||n.type||KR(n.value):n.type):(i.push(n),Pa(n)))}var RR=GR(P9);function I$(n,i,o,c,p,x){for(let m=1;m<n.strings.length;m++)i+=k$(i,o,c,p,x)+n.strings[m],o=n.args[m];return i}function k$(n,i,o,c,p){return i instanceof ra?i.build(n,o,c,p):i instanceof po?h$(i,o,c,p):i instanceof im?i.value:i&&i[0]instanceof po?i.reduce((x,m)=>x+" "+h$(m,o,c,p),""):ga(i,o,c,p)}function h$(n,i,o,c){return n.fragment=!0,I$(n,n.strings[0],n.args[0],i,o,c)}function WR(n,i,o,c,p){return n.map((x)=>"("+c.map((m)=>k$("values",x[m],i,o,p)).join(",")+")").join(",")}function MR(n,i,o,c,p){let x=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(x?n[0]:n);return WR(x?n:[n],o,c,m,p)}function qa(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return s$(n,p);let x;return(i.length?i.flat():Object.keys(n)).map((a)=>{return x=n[a],(x instanceof po?h$(x,o,c,p):x instanceof im?x.value:ga(x,o,c,p))+" as "+da(p.transform.column.to?p.transform.column.to(a):a)}).join(",")}var t9=Object.entries({values:MR,in:(...n)=>{let i=MR(...n);return i==="()"?"(null)":i},select:qa,as:qa,returning:qa,"\\(":qa,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>da(p.transform.column.to?p.transform.column.to(x):x)+"="+k$("values",n[x],o,c,p))},insert(n,i,o,c,p){let x=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+s$(x,p)+")values"+WR(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function D$(){throw dn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:r9,parsers:g9}=RR;function KR(n){if(Array.isArray(n))return KR(n[0]);return typeof n==="string"?1009:0}var XR=function(n){let i=GR(n||{});return{serializers:Object.assign({},r9,i.serializers),parsers:Object.assign({},g9,i.parsers)}};function GR(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 s$(n,{transform:{column:i}}){return n.map((o)=>da(i.to?i.to(o):o)).join(",")}var da=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},Pa=function n(i){return i instanceof Vo?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},d9=/\\/g,e9=/"/g;function nG(n){return n.replace(d9,"\\\\").replace(e9,"\\\"")}var YR=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let x=i[0],m=p===1020?";":",";if(Array.isArray(x)&&!x.type)return"{"+i.map((a)=>n(a,o,c,p)).join(m)+"}";return"{"+i.map((a)=>{if(a===void 0){if(a=c.transform.undefined,a===void 0)throw dn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return a===null?"null":'"'+nG(o?o(a.type?a.value:a):""+a)+'"'}).join(m)+"}"},C$={i:0,char:null,str:"",quoted:!1,last:0},zR=function n(i,o,c){return C$.i=C$.last=0,HR(C$,i,o,c)};function HR(n,i,o,c){let p=[],x=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(HR(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===x&&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 sc=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Zc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},qc=(n)=>n.replace(/_/g,"-"),dx=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),ex=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),nm=(n)=>n.replace(/-/g,"_");function Z$(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,[x,m])=>Object.assign(p,{[n(x)]:i(m,c)}),{}):o}}sc.column={from:sc};sc.value={from:Z$(sc)};dx.column={to:dx};var q$={...sc};q$.column.to=dx;Zc.column={from:Zc};Zc.value={from:Z$(Zc)};ex.column={to:ex};var P$={...Zc};P$.column.to=ex;qc.column={from:qc};qc.value={from:Z$(qc)};nm.column={to:nm};var t$={...qc};t$.column.to=nm;import QR from"net";import pG from"tls";import om from"crypto";import r$ from"stream";import{performance as OR}from"perf_hooks";class Pc 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=iG;function iG(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 Yi=Buffer.allocUnsafe(256),oG="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return Yi[0]=o,Qn.i=5,Qn},n},{}),Qn=Object.assign(cG,oG,{N:String.fromCharCode(0),i:0,inc(n){return Qn.i+=n,Qn},str(n){let i=Buffer.byteLength(n);return ea(i),Qn.i+=Yi.write(n,Qn.i,i,"utf8"),Qn},i16(n){return ea(2),Yi.writeUInt16BE(n,Qn.i),Qn.i+=2,Qn},i32(n,i){if(i||i===0)return Yi.writeUInt32BE(n,i),Qn;return ea(4),Yi.writeUInt32BE(n,Qn.i),Qn.i+=4,Qn},z(n){return ea(n),Yi.fill(0,Qn.i,Qn.i+n),Qn.i+=n,Qn},raw(n){return Yi=Buffer.concat([Yi.subarray(0,Qn.i),n]),Qn.i=Yi.length,Qn},end(n=1){Yi.writeUInt32BE(Qn.i-n,n);let i=Yi.subarray(0,Qn.i);return Qn.i=0,Yi=Buffer.allocUnsafe(256),i}}),t=Qn;function ea(n){if(Yi.length-Qn.i<n){let i=Yi,o=i.length;Yi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(Yi)}}function cG(){return Qn.i=0,Qn}var e$=VR,xG=1,Rc=t().S().end(),ER=t().H().end(),mG=t().i32(8).i32(80877103).end(8),aG=Buffer.concat([t().E().str(t.N).i32(0).end(),Rc]),fG=t().D().str("S").str(t.N).end(),gp=()=>{},lG=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 VR(n,i={},{onopen:o=gp,onend:c=gp,onclose:p=gp}={}){let{ssl:x,max:m,user:a,host:f,port:l,database:$,parsers:v,transform:T,onnotice:F,onnotify:R,onparameter:S,max_pipeline:M,keep_alive:G,backoff:H,target_session_attrs:y}=n,k=ki(),Y=xG++,K={pid:null,secret:null},Q=d$(wf,n.idle_timeout),u=d$(wf,n.max_lifetime),V=d$($4,n.connect_timeout),X=null,s,C=new Pc,q=Buffer.alloc(0),Xn=n.fetch_types,Un={},Vi={},_o=Math.random().toString(36).slice(2),O=1,P=0,Mn=0,yn=0,en=0,vn=0,Vn=0,rn=0,Dn=null,un=null,Ji=!1,_n=null,xo=null,wi=null,so=null,ni=null,bn=null,mo=null,Xo=null,b=null,ox=null,Ai={queue:i.closed,idleTimer:Q,connect(J){wi=J||!0,H0()},terminate:px,execute:cx,cancel:m4,end:wf,count:0,id:Y};return i.closed&&i.closed.push(Ai),Ai;async function x4(){let J;try{J=n.socket?await Promise.resolve(n.socket(n)):new QR.Socket}catch(W){dc(W);return}return J.on("error",dc),J.on("close",Q0),J.on("drain",Y0),J}async function m4({pid:J,secret:W},r,Rn){try{s=t().i32(16).i32(80877102).i32(J).i32(W).end(16),await z0(),X.once("error",Rn),X.once("close",r)}catch(In){Rn(In)}}function cx(J){if(Ji)return lm(J,dn.connection("CONNECTION_DESTROYED",n));if(J.cancelled)return;try{return J.state=K,b?k.push(J):(b=J,b.active=!0),l4(J),fi(a4(J))&&!J.describeFirst&&!J.cursorFn&&k.length<M&&(!J.options.onexecute||J.options.onexecute(Ai))}catch(W){return k.length===0&&fi(Rc),Go(W),!0}}function a4(J){if(J.parameters.length>=65534)throw dn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return J.options.simple?t().Q().str(J.statement.string+t.N).end():J.describeFirst?Buffer.concat([K0(J),ER]):J.prepare?J.prepared?fm(J):Buffer.concat([K0(J),fm(J)]):f4(J)}function K0(J){return Buffer.concat([E0(J.statement.string,J.parameters,J.statement.types,J.statement.name),P4("S",J.statement.name)])}function fm(J){return Buffer.concat([q4(J.parameters,J.statement.types,J.statement.name,J.cursorName),J.cursorFn?U0("",J.cursorRows):aG])}function f4(J){return Buffer.concat([E0(J.statement.string,J.parameters,J.statement.types),fG,fm(J)])}function l4(J){let W=[],r=[],Rn=I$(J,J.strings[0],J.args[0],W,r,n);!J.tagged&&J.args.forEach((In)=>ga(In,W,r,n)),J.prepare=n.prepare&&("prepare"in J.options?J.options.prepare:!0),J.string=Rn,J.signature=J.prepare&&r+Rn,J.onlyDescribe&&delete Vi[J.signature],J.parameters=J.parameters||W,J.prepared=J.prepare&&J.signature in Vi,J.describeFirst=J.onlyDescribe||W.length&&!J.prepared,J.statement=J.prepared?Vi[J.signature]:{string:Rn,types:r,name:J.prepare?_o+O++:""},typeof n.debug==="function"&&n.debug(Y,Rn,W,r)}function fi(J,W){if(bn=bn?Buffer.concat([bn,J]):Buffer.from(J),W||bn.length>=1024)return X0(W);return un===null&&(un=setImmediate(X0)),!0}function X0(J){let W=X.write(bn,J);return un!==null&&clearImmediate(un),bn=un=null,W}function $4(){Go(dn.connection("CONNECT_TIMEOUT",n,X)),X.destroy()}async function G0(){if(fi(mG),!await new Promise((W)=>X.once("data",(r)=>W(r[0]===83)))&&x==="prefer")return gc();X.removeAllListeners(),X=pG.connect({socket:X,servername:QR.isIP(X.host)?void 0:X.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),X.on("secureConnect",gc),X.on("error",dc),X.on("close",Q0),X.on("drain",Y0)}function Y0(){!b&&o(Ai)}function Jf(J){if(_n){if(_n.push(J),Mn-=J.length,Mn>=0)return}q=_n?Buffer.concat(_n,vn-Mn):q.length===0?J:Buffer.concat([q,J],q.length+J.length);while(q.length>4){if(vn=q.readUInt32BE(1),vn>=q.length){Mn=vn-q.length,_n=[q];break}try{v4(q.subarray(0,vn+1))}catch(W){b&&(b.cursorFn||b.describeFirst)&&fi(Rc),Go(W)}q=q.subarray(vn+1),Mn=0,_n=null}}async function z0(){if(Ji=!1,Un={},X||(X=await x4()),!X)return;if(V.start(),n.socket)return x?G0():gc();if(X.on("connect",x?G0:gc),n.path)return X.connect(n.path);X.ssl=x,X.connect(l[yn],f[yn]),X.host=f[yn],X.port=l[yn],yn=(yn+1)%l.length}function H0(){setTimeout(z0,P?P+Vn-OR.now():0)}function gc(){try{Vi={},Xn=n.fetch_types,_o=Math.random().toString(36).slice(2),O=1,u.start(),X.on("data",Jf),G&&X.setKeepAlive&&X.setKeepAlive(!0,1000*G);let J=r4();fi(J)}catch(J){dc(J)}}function dc(J){if(Ai.queue===i.connecting&&n.host[en+1])return;Go(J);while(k.length)lm(k.shift(),J)}function Go(J){ni&&(ni.destroy(J),ni=null),b&&lm(b,J),wi&&(lm(wi,J),wi=null)}function lm(J,W){"query"in W||"parameters"in W||Object.defineProperties(W,{stack:{value:W.stack+J.origin.replace(/.*\n/,`
54
+ `),enumerable:n.debug},query:{value:J.string,enumerable:n.debug},parameters:{value:J.parameters,enumerable:n.debug},args:{value:J.args,enumerable:n.debug},types:{value:J.statement&&J.statement.types,enumerable:n.debug}}),J.reject(W)}function wf(){return so||(!Ai.reserved&&c(Ai),!Ai.reserved&&!wi&&!b&&k.length===0?(px(),new Promise((J)=>X&&X.readyState!=="closed"?X.once("close",J):J())):so=new Promise((J)=>mo=J))}function px(){if(Ji=!0,ni||b||wi||k.length)dc(dn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(un),X)X.removeListener("data",Jf),X.removeListener("connect",gc),X.readyState==="open"&&X.end(t().X().end());mo&&(mo(),so=mo=null)}async function Q0(J){if(q=Buffer.alloc(0),Mn=0,_n=null,clearImmediate(un),X.removeListener("data",Jf),X.removeListener("connect",gc),Q.cancel(),u.cancel(),V.cancel(),X.removeAllListeners(),X=null,wi)return H0();!J&&(b||k.length)&&dc(dn.connection("CONNECTION_CLOSED",n,X)),P=OR.now(),J&&n.shared.retries++,Vn=(typeof H==="function"?H(n.shared.retries):H)*1000,p(Ai,dn.connection("CONNECTION_CLOSED",n,X))}function v4(J,W=J[0]){(W===68?T4:W===100?N4:W===65?u4:W===83?J4:W===90?w4:W===67?A4:W===50?O0:W===49?S4:W===116?F4:W===84?M4:W===82?R4:W===110?z4:W===75?H4:W===69?V4:W===115?b4:W===51?j4:W===71?B4:W===78?C4:W===72?y4:W===99?D4:W===73?h4:W===86?I4:W===118?k4:W===87?L4:s4)(J)}function T4(J){let W=7,r,Rn,In,Si=b.isRaw?new Array(b.statement.columns.length):{};for(let zi=0;zi<b.statement.columns.length;zi++)Rn=b.statement.columns[zi],r=J.readInt32BE(W),W+=4,In=r===-1?null:b.isRaw===!0?J.subarray(W,W+=r):Rn.parser===void 0?J.toString("utf8",W,W+=r):Rn.parser.array===!0?Rn.parser(J.toString("utf8",W+1,W+=r)):Rn.parser(J.toString("utf8",W,W+=r)),b.isRaw?Si[zi]=b.isRaw===!0?In:T.value.from?T.value.from(In,Rn):In:Si[Rn.name]=T.value.from?T.value.from(In,Rn):In;b.forEachFn?b.forEachFn(T.row.from?T.row.from(Si):Si,C):C[rn++]=T.row.from?T.row.from(Si):Si}function J4(J){let[W,r]=J.toString("utf8",5,J.length-1).split(t.N);if(Un[W]=r,n.parameters[W]!==r)n.parameters[W]=r,S&&S(W,r)}function w4(J){if(b&&b.options.simple&&b.resolve(xo||C),b=xo=null,C=new Pc,V.cancel(),wi){if(y){if(!Un.in_hot_standby||!Un.default_transaction_read_only)return U4();else if(E4(y,Un))return px()}if(Xn)return wi===!0&&(wi=null),Q4();wi!==!0&&cx(wi),n.shared.retries=en=0,wi=null;return}while(k.length&&(b=k.shift())&&(b.active=!0,b.cancelled))VR(n).cancel(b.state,b.cancelled.resolve,b.cancelled.reject);if(b)return;Ai.reserved?!Ai.reserved.release&&J[5]===73?so?px():(Ai.reserved=null,o(Ai)):Ai.reserved():so?px():o(Ai)}function A4(J){rn=0;for(let W=J.length-1;W>0;W--){if(J[W]===32&&J[W+1]<58&&C.count===null)C.count=+J.toString("utf8",W+1,J.length-1);if(J[W-1]>=65){C.command=J.toString("utf8",5,W),C.state=K;break}}if(ox&&(ox(),ox=null),C.command==="BEGIN"&&m!==1&&!Ai.reserved)return Go(dn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(b.options.simple)return O0();if(b.cursorFn)C.count&&b.cursorFn(C),fi(Rc);b.resolve(C)}function S4(){b.parsing=!1}function O0(){!C.statement&&(C.statement=b.statement),C.columns=b.statement.columns}function F4(J){let W=J.readUInt16BE(5);for(let r=0;r<W;++r)!b.statement.types[r]&&(b.statement.types[r]=J.readUInt32BE(7+r*4));b.prepare&&(Vi[b.signature]=b.statement),b.describeFirst&&!b.onlyDescribe&&(fi(fm(b)),b.describeFirst=!1)}function M4(J){if(C.command)xo=xo||[C],xo.push(C=new Pc),C.count=null,b.statement.columns=null;let W=J.readUInt16BE(5),r=7,Rn;b.statement.columns=Array(W);for(let In=0;In<W;++In){Rn=r;while(J[r++]!==0);let Si=J.readUInt32BE(r),zi=J.readUInt16BE(r+4),Zo=J.readUInt32BE(r+6);b.statement.columns[In]={name:T.column.from?T.column.from(J.toString("utf8",Rn,r-1)):J.toString("utf8",Rn,r-1),parser:v[Zo],table:Si,number:zi,type:Zo},r+=18}if(C.statement=b.statement,b.onlyDescribe)return b.resolve(b.statement),fi(Rc)}async function R4(J,W=J.readUInt32BE(5)){(W===3?W4:W===5?K4:W===10?X4:W===11?G4:W===12?Y4:W!==0?Z4:gp)(J,W)}async function W4(){let J=await Af();fi(t().p().str(J).z(1).end())}async function K4(J){let W="md5"+await UR(Buffer.concat([Buffer.from(await UR(await Af()+a)),J.subarray(9)]));fi(t().p().str(W).z(1).end())}async function X4(){Xo=(await om.randomBytes(18)).toString("base64"),t().p().str("SCRAM-SHA-256"+t.N);let J=t.i;fi(t.inc(4).str("n,,n=*,r="+Xo).i32(t.i-J-4,J).end())}async function G4(J){let W=J.toString("utf8",9).split(",").reduce((zi,Zo)=>(zi[Zo[0]]=Zo.slice(2),zi),{}),r=await om.pbkdf2Sync(await Af(),Buffer.from(W.s,"base64"),parseInt(W.i),32,"sha256"),Rn=await nf(r,"Client Key"),In="n=*,r="+Xo+",r="+W.r+",s="+W.s+",i="+W.i+",c=biws,r="+W.r;Dn=(await nf(await nf(r,"Server Key"),In)).toString("base64");let Si="c=biws,r="+W.r+",p="+TG(Rn,Buffer.from(await nf(await vG(Rn),In))).toString("base64");fi(t().p().str(Si).end())}function Y4(J){if(J.toString("utf8",9).split(t.N,1)[0].slice(2)===Dn)return;Go(dn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),X.destroy()}function Af(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function z4(){if(C.statement=b.statement,C.statement.columns=[],b.onlyDescribe)return b.resolve(b.statement),fi(Rc)}function H4(J){K.pid=J.readUInt32BE(5),K.secret=J.readUInt32BE(9)}async function Q4(){Xn=!1,(await new po([`
55
55
  select b.oid, b.typarray
56
56
  from pg_catalog.pg_type a
57
57
  left join pg_catalog.pg_type b on b.oid = a.typelem
58
58
  where a.typcategory = 'A'
59
59
  group by b.oid, b.typarray
60
60
  order by b.oid
61
- `],[],ox)).forEach(({oid:W,typarray:r})=>Q4(W,r))}function Q4(J,W){if(!!n.parsers[W]&&!!n.serializers[W])return;let r=n.parsers[J];n.shared.typeArrayMap[J]=W,n.parsers[W]=(Rn)=>YR(Rn,r,W),n.parsers[W].array=!0,n.serializers[W]=(Rn)=>GR(Rn,n.serializers[J],n,W)}function O4(J,W){return J==="read-write"&&W.default_transaction_read_only==="on"||J==="read-only"&&W.default_transaction_read_only==="off"||J==="primary"&&W.in_hot_standby==="on"||J==="standby"&&W.in_hot_standby==="off"||J==="prefer-standby"&&W.in_hot_standby==="off"&&n.host[en]}function E4(){let J=new co([`
61
+ `],[],cx)).forEach(({oid:W,typarray:r})=>O4(W,r))}function O4(J,W){if(!!n.parsers[W]&&!!n.serializers[W])return;let r=n.parsers[J];n.shared.typeArrayMap[J]=W,n.parsers[W]=(Rn)=>zR(Rn,r,W),n.parsers[W].array=!0,n.serializers[W]=(Rn)=>YR(Rn,n.serializers[J],n,W)}function E4(J,W){return J==="read-write"&&W.default_transaction_read_only==="on"||J==="read-only"&&W.default_transaction_read_only==="off"||J==="primary"&&W.in_hot_standby==="on"||J==="standby"&&W.in_hot_standby==="off"||J==="prefer-standby"&&W.in_hot_standby==="off"&&n.host[en]}function U4(){let J=new po([`
62
62
  show transaction_read_only;
63
63
  select pg_catalog.pg_is_in_recovery()
64
- `],[],ox,null,{simple:!0});J.resolve=([[W],[r]])=>{Un.default_transaction_read_only=W.transaction_read_only,Un.in_hot_standby=r.pg_is_in_recovery?"on":"off"},J.execute()}function U4(J){b&&(b.cursorFn||b.describeFirst)&&mi(Rc);let W=dn.postgres(t$(J));b&&b.retried?Go(b.retried):b&&b.prepared&&nG.has(W.routine)?V4(b,W):Go(W)}function V4(J,W){delete Vi[J.signature],J.retried=W,ox(J)}function _4(J){if(!R)return;let W=9;while(J[W++]!==0);R(J.toString("utf8",9,W-1),J.toString("utf8",W,J.length-1))}async function u4(){try{let J=await Promise.resolve(b.cursorFn(C));rn=0,J===Pp?mi(P4(b.portal)):(C=new qc,mi(O0("",b.cursorRows)))}catch(J){mi(Rc),b.reject(J)}}function b4(){C.count&&b.cursorFn(C),b.resolve(C)}function j4(){ni=new P$.Writable({autoDestroy:!0,write(J,W,r){X.write(t().d().raw(J).end(),r)},destroy(J,W){W(J),X.write(t().f().str(J+t.N).end()),ni=null},final(J){X.write(t().c().end()),ix=J}}),b.resolve(ni)}function B4(){ni=new P$.Readable({read(){X.resume()}}),b.resolve(ni)}function y4(){ni=new P$.Duplex({autoDestroy:!0,read(){X.resume()},write(J,W,r){X.write(t().d().raw(J).end(),r)},destroy(J,W){W(J),X.write(t().f().str(J+t.N).end()),ni=null},final(J){X.write(t().c().end()),ix=J}}),b.resolve(ni)}function L4(J){ni&&(ni.push(J.subarray(5))||X.pause())}function N4(){ni&&ni.push(null),ni=null}function D4(J){F?F(t$(J)):console.log(t$(J))}function C4(){}function h4(){Go(dn.notSupported("FunctionCallResponse"))}function I4(){Go(dn.notSupported("NegotiateProtocolVersion"))}function k4(J){console.error("Postgres.js : Unknown Message:",J[0])}function s4(J,W){console.error("Postgres.js : Unknown Auth:",W)}function Z4(J,W,r="",Rn=""){let In,Ai;return t().B().str(Rn+t.N).str(r+t.N).i16(0).i16(J.length),J.forEach((zi,so)=>{if(zi===null)return t.i32(4294967295);Ai=W[so],J[so]=zi=Ai in n.serializers?n.serializers[Ai](zi):""+zi,In=t.i,t.inc(4).str(zi).i32(t.i-In-4,In)}),t.i16(0),t.end()}function Q0(J,W,r,Rn=""){return t().P().str(Rn+t.N).str(J+t.N).i16(W.length),W.forEach((In,Ai)=>t.i32(r[Ai]||0)),t.end()}function q4(J,W=""){return t().D().str(J).str(W+t.N).end()}function O0(J="",W=0){return Buffer.concat([t().E().str(J+t.N).i32(W).end(),OR])}function P4(J=""){return Buffer.concat([t().C().str("P").str(J+t.N).end(),t().S().end()])}function t4(){return s||t().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:m,database:$,client_encoding:"UTF8"},n.connection)).filter(([,J])=>J).map(([J,W])=>J+t.N+W).join(t.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[iG[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function ER(n){return oa.createHash("md5").update(n).digest("hex")}function dm(n,i){return oa.createHmac("sha256",n).update(i).digest()}function oG(n){return oa.createHash("sha256").update(n).digest()}function cG(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 r$(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:rp,start:rp};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 VR=()=>{};function d$(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},x,a,m=!1,f=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(m)return;a=null,p.pid=p.secret=void 0,T(await F(f,c,i.publications)),o.forEach((S)=>S.forEach(({onsubscribe:M})=>M()))},no_subscribe:!0}),l=f.end,$=f.close;return f.end=async()=>{return m=!0,a&&await new Promise((S)=>(a.once("close",S),a.end())),l()},f.close=async()=>{return a&&await new Promise((S)=>(a.once("close",S),a.end())),$()},v;async function v(S,M,G=VR,H=VR){if(S=aG(S),!x)x=F(f,c,i.publications);let B={fn:M,onsubscribe:G},k=o.has(S)?o.get(S).add(B):o.set(S,new Set([B])).get(S),Y=()=>{k.delete(B),k.size===0&&o.delete(S)};return x.then((K)=>{return T(K),G(),a&&a.on("error",H),{unsubscribe:Y,state:p,sql:f}})}function T(S){a=S.stream,p.pid=S.state.pid,p.secret=S.state.secret}async function F(S,M,G){if(!G)throw new Error("Missing publication names");let H=await S.unsafe(`CREATE_REPLICATION_SLOT ${M} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[B]=H,k=await S.unsafe(`START_REPLICATION SLOT ${M} 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 k.on("data",Q),k.on("error",K),k.on("close",S.close),{stream:k,state:H.state};function K(X){console.error("Unexpected error during logical streaming - reconnecting",X)}function Q(X){if(X[0]===119)xG(X.subarray(25),Y,S.options.parsers,u,i.transform);else if(X[0]===107&&X[17])Y.lsn=X.subarray(1,9),V()}function u(X,s){let C=s.relation.schema+"."+s.relation.table;R("*",X,s),R("*:"+C,X,s),s.relation.keys.length&&R("*:"+C+"="+s.relation.keys.map((q)=>X[q.name]),X,s),R(s.command,X,s),R(s.command+":"+C,X,s),s.relation.keys.length&&R(s.command+":"+C+"="+s.relation.keys.map((q)=>X[q.name]),X,s)}function V(){let X=Buffer.alloc(34);X[0]=114,X.fill(Y.lsn,1),X.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),k.write(X)}}function R(S,M,G){o.has(S)&&o.get(S).forEach(({fn:H})=>H(M,G,S))}}function pG(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function xG(n,i,o,c,p){let x=(a,[m,f])=>(a[m.charCodeAt(0)]=f,a);Object.entries({R:(a)=>{let m=1,f=i[a.readUInt32BE(m)]={schema:a.toString("utf8",m+=4,m=a.indexOf(0,m))||"pg_catalog",table:a.toString("utf8",m+1,m=a.indexOf(0,m+1)),columns:Array(a.readUInt16BE(m+=2)),keys:[]};m+=2;let l=0,$;while(m<a.length)$=f.columns[l++]={key:a[m++],name:p.column.from?p.column.from(a.toString("utf8",m,m=a.indexOf(0,m))):a.toString("utf8",m,m=a.indexOf(0,m)),type:a.readUInt32BE(m+=1),parser:o[a.readUInt32BE(m)],atttypmod:a.readUInt32BE(m+=4)},$.key&&f.keys.push($),m+=4},Y:()=>{},O:()=>{},B:(a)=>{i.date=pG(a.readBigInt64BE(9)),i.lsn=a.subarray(1,9)},I:(a)=>{let m=1,f=i[a.readUInt32BE(m)],{row:l}=em(a,f.columns,m+=7,p);c(l,{command:"insert",relation:f})},D:(a)=>{let m=1,f=i[a.readUInt32BE(m)];m+=4;let l=a[m]===75;c(l||a[m]===79?em(a,f.columns,m+=3,p).row:null,{command:"delete",relation:f,key:l})},U:(a)=>{let m=1,f=i[a.readUInt32BE(m)];m+=4;let l=a[m]===75,$=l||a[m]===79?em(a,f.columns,m+=3,p):null;$&&(m=$.i);let{row:v}=em(a,f.columns,m+3,p);c(v,{command:"update",relation:f,key:l,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(x,{})[n[0]](n)}function em(n,i,o,c){let p,x,a,m=c.raw?new Array(i.length):{};for(let f=0;f<i.length;f++)p=n[o++],x=i[f],a=p===110?null:p===117?void 0:x.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):x.parser.array===!0?x.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):x.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?m[f]=c.raw===!0?a:c.value.from?c.value.from(a,x):a:m[x.name]=c.value.from?c.value.from(a,x):a;return{i:o,row:c.row.from?c.row.from(m):m}}function aG(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 _R from"stream";function e$(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(x)=>{let a;!i&&([{oid:i}]=await x`select lo_creat(-1) as oid`);let[{fd:m}]=await x`select lo_open(${i}, ${o}) as fd`,f={writable:$,readable:l,close:()=>x`select lo_close(${m})`.then(a),tell:()=>x`select lo_tell64(${m})`,read:(v)=>x`select loread(${m}, ${v}) as data`,write:(v)=>x`select lowrite(${m}, ${v})`,truncate:(v)=>x`select lo_truncate64(${m}, ${v})`,seek:(v,T=0)=>x`select lo_lseek64(${m}, ${v}, ${T})`,size:()=>x`
64
+ `],[],cx,null,{simple:!0});J.resolve=([[W],[r]])=>{Un.default_transaction_read_only=W.transaction_read_only,Un.in_hot_standby=r.pg_is_in_recovery?"on":"off"},J.execute()}function V4(J){b&&(b.cursorFn||b.describeFirst)&&fi(Rc);let W=dn.postgres(g$(J));b&&b.retried?Go(b.retried):b&&b.prepared&&lG.has(W.routine)?_4(b,W):Go(W)}function _4(J,W){delete Vi[J.signature],J.retried=W,cx(J)}function u4(J){if(!R)return;let W=9;while(J[W++]!==0);R(J.toString("utf8",9,W-1),J.toString("utf8",W,J.length-1))}async function b4(){try{let J=await Promise.resolve(b.cursorFn(C));rn=0,J===tp?fi(t4(b.portal)):(C=new Pc,fi(U0("",b.cursorRows)))}catch(J){fi(Rc),b.reject(J)}}function j4(){C.count&&b.cursorFn(C),b.resolve(C)}function B4(){ni=new r$.Writable({autoDestroy:!0,write(J,W,r){X.write(t().d().raw(J).end(),r)},destroy(J,W){W(J),X.write(t().f().str(J+t.N).end()),ni=null},final(J){X.write(t().c().end()),ox=J}}),b.resolve(ni)}function y4(){ni=new r$.Readable({read(){X.resume()}}),b.resolve(ni)}function L4(){ni=new r$.Duplex({autoDestroy:!0,read(){X.resume()},write(J,W,r){X.write(t().d().raw(J).end(),r)},destroy(J,W){W(J),X.write(t().f().str(J+t.N).end()),ni=null},final(J){X.write(t().c().end()),ox=J}}),b.resolve(ni)}function N4(J){ni&&(ni.push(J.subarray(5))||X.pause())}function D4(){ni&&ni.push(null),ni=null}function C4(J){F?F(g$(J)):console.log(g$(J))}function h4(){}function I4(){Go(dn.notSupported("FunctionCallResponse"))}function k4(){Go(dn.notSupported("NegotiateProtocolVersion"))}function s4(J){console.error("Postgres.js : Unknown Message:",J[0])}function Z4(J,W){console.error("Postgres.js : Unknown Auth:",W)}function q4(J,W,r="",Rn=""){let In,Si;return t().B().str(Rn+t.N).str(r+t.N).i16(0).i16(J.length),J.forEach((zi,Zo)=>{if(zi===null)return t.i32(4294967295);Si=W[Zo],J[Zo]=zi=Si in n.serializers?n.serializers[Si](zi):""+zi,In=t.i,t.inc(4).str(zi).i32(t.i-In-4,In)}),t.i16(0),t.end()}function E0(J,W,r,Rn=""){return t().P().str(Rn+t.N).str(J+t.N).i16(W.length),W.forEach((In,Si)=>t.i32(r[Si]||0)),t.end()}function P4(J,W=""){return t().D().str(J).str(W+t.N).end()}function U0(J="",W=0){return Buffer.concat([t().E().str(J+t.N).i32(W).end(),ER])}function t4(J=""){return Buffer.concat([t().C().str("P").str(J+t.N).end(),t().S().end()])}function r4(){return s||t().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:a,database:$,client_encoding:"UTF8"},n.connection)).filter(([,J])=>J).map(([J,W])=>J+t.N+W).join(t.N)).z(2).end(0)}}function g$(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 UR(n){return om.createHash("md5").update(n).digest("hex")}function nf(n,i){return om.createHmac("sha256",n).update(i).digest()}function vG(n){return om.createHash("sha256").update(n).digest()}function TG(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:gp,start:gp};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 _R=()=>{};function n0(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},x,m,a=!1,f=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(a)return;m=null,p.pid=p.secret=void 0,T(await F(f,c,i.publications)),o.forEach((S)=>S.forEach(({onsubscribe:M})=>M()))},no_subscribe:!0}),l=f.end,$=f.close;return f.end=async()=>{return a=!0,m&&await new Promise((S)=>(m.once("close",S),m.end())),l()},f.close=async()=>{return m&&await new Promise((S)=>(m.once("close",S),m.end())),$()},v;async function v(S,M,G=_R,H=_R){if(S=AG(S),!x)x=F(f,c,i.publications);let y={fn:M,onsubscribe:G},k=o.has(S)?o.get(S).add(y):o.set(S,new Set([y])).get(S),Y=()=>{k.delete(y),k.size===0&&o.delete(S)};return x.then((K)=>{return T(K),G(),m&&m.on("error",H),{unsubscribe:Y,state:p,sql:f}})}function T(S){m=S.stream,p.pid=S.state.pid,p.secret=S.state.secret}async function F(S,M,G){if(!G)throw new Error("Missing publication names");let H=await S.unsafe(`CREATE_REPLICATION_SLOT ${M} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[y]=H,k=await S.unsafe(`START_REPLICATION SLOT ${M} LOGICAL ${y.consistent_point} (proto_version '1', publication_names '${G}')`).writable(),Y={lsn:Buffer.concat(y.consistent_point.split("/").map((X)=>Buffer.from(("00000000"+X).slice(-8),"hex")))};return k.on("data",Q),k.on("error",K),k.on("close",S.close),{stream:k,state:H.state};function K(X){console.error("Unexpected error during logical streaming - reconnecting",X)}function Q(X){if(X[0]===119)wG(X.subarray(25),Y,S.options.parsers,u,i.transform);else if(X[0]===107&&X[17])Y.lsn=X.subarray(1,9),V()}function u(X,s){let C=s.relation.schema+"."+s.relation.table;R("*",X,s),R("*:"+C,X,s),s.relation.keys.length&&R("*:"+C+"="+s.relation.keys.map((q)=>X[q.name]),X,s),R(s.command,X,s),R(s.command+":"+C,X,s),s.relation.keys.length&&R(s.command+":"+C+"="+s.relation.keys.map((q)=>X[q.name]),X,s)}function V(){let X=Buffer.alloc(34);X[0]=114,X.fill(Y.lsn,1),X.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),k.write(X)}}function R(S,M,G){o.has(S)&&o.get(S).forEach(({fn:H})=>H(M,G,S))}}function JG(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function wG(n,i,o,c,p){let x=(m,[a,f])=>(m[a.charCodeAt(0)]=f,m);Object.entries({R:(m)=>{let a=1,f=i[m.readUInt32BE(a)]={schema:m.toString("utf8",a+=4,a=m.indexOf(0,a))||"pg_catalog",table:m.toString("utf8",a+1,a=m.indexOf(0,a+1)),columns:Array(m.readUInt16BE(a+=2)),keys:[]};a+=2;let l=0,$;while(a<m.length)$=f.columns[l++]={key:m[a++],name:p.column.from?p.column.from(m.toString("utf8",a,a=m.indexOf(0,a))):m.toString("utf8",a,a=m.indexOf(0,a)),type:m.readUInt32BE(a+=1),parser:o[m.readUInt32BE(a)],atttypmod:m.readUInt32BE(a+=4)},$.key&&f.keys.push($),a+=4},Y:()=>{},O:()=>{},B:(m)=>{i.date=JG(m.readBigInt64BE(9)),i.lsn=m.subarray(1,9)},I:(m)=>{let a=1,f=i[m.readUInt32BE(a)],{row:l}=of(m,f.columns,a+=7,p);c(l,{command:"insert",relation:f})},D:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let l=m[a]===75;c(l||m[a]===79?of(m,f.columns,a+=3,p).row:null,{command:"delete",relation:f,key:l})},U:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let l=m[a]===75,$=l||m[a]===79?of(m,f.columns,a+=3,p):null;$&&(a=$.i);let{row:v}=of(m,f.columns,a+3,p);c(v,{command:"update",relation:f,key:l,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(x,{})[n[0]](n)}function of(n,i,o,c){let p,x,m,a=c.raw?new Array(i.length):{};for(let f=0;f<i.length;f++)p=n[o++],x=i[f],m=p===110?null:p===117?void 0:x.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):x.parser.array===!0?x.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):x.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?a[f]=c.raw===!0?m:c.value.from?c.value.from(m,x):m:a[x.name]=c.value.from?c.value.from(m,x):m;return{i:o,row:c.row.from?c.row.from(a):a}}function AG(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 i0(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(x)=>{let m;!i&&([{oid:i}]=await x`select lo_creat(-1) as oid`);let[{fd:a}]=await x`select lo_open(${i}, ${o}) as fd`,f={writable:$,readable:l,close:()=>x`select lo_close(${a})`.then(m),tell:()=>x`select lo_tell64(${a})`,read:(v)=>x`select loread(${a}, ${v}) as data`,write:(v)=>x`select lowrite(${a}, ${v})`,truncate:(v)=>x`select lo_truncate64(${a}, ${v})`,seek:(v,T=0)=>x`select lo_lseek64(${a}, ${v}, ${T})`,size:()=>x`
65
65
  select
66
- lo_lseek64(${m}, location, 0) as position,
66
+ lo_lseek64(${a}, location, 0) as position,
67
67
  seek.size
68
68
  from (
69
69
  select
@@ -71,10 +71,10 @@ ${a.trace}`:"No previous disposal trace was found.");return}switch(o.type){case"
71
71
  tell.location
72
72
  from (select lo_tell64($1) as location) tell
73
73
  ) seek
74
- `};return c(f),new Promise(async(v)=>a=v);async function l({highWaterMark:v=16384,start:T=0,end:F=1/0}={}){let R=F-T;return T&&await f.seek(T),new _R.Readable({highWaterMark:v,async read(S){let M=S>R?S-R:S;R-=S;let[{data:G}]=await f.read(M);if(this.push(G),G.length<S)this.push(null)}})}async function $({highWaterMark:v=16384,start:T=0}={}){return T&&await f.seek(T),new _R.Writable({highWaterMark:v,write(F,R,S){f.write(F).then(()=>S(),S)}})}}).catch(p)})}Object.assign(nf,{PostgresError:tp,toPascal:sc,pascal:Z$,toCamel:kc,camel:s$,toKebab:Zc,kebab:q$,fromPascal:ex,fromCamel:dx,fromKebab:na,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var gp=nf;function nf(n,i){let o=lG(n,i),c=o.no_subscribe||d$(nf,{...o}),p=!1,x=ki(),a=ki(),m=ki(),f=ki(),l=ki(),$=ki(),v=ki(),T=ki(),F={connecting:a,reserved:m,closed:f,ended:l,open:$,busy:v,full:T},R=[...Array(o.max)].map(()=>g$(o,F,{onopen:Vi,onend:Un,onclose:_o})),S=M(u);return Object.assign(S,{get parameters(){return o.parameters},largeObject:e$.bind(null,S),subscribe:c,CLOSE:Pp,END:Pp,PostgresError:tp,options:o,reserve:B,listen:G,begin:k,close:C,end:s}),S;function M(O){return O.debug=o.debug,Object.entries(o.types).reduce((vn,[Vn,rn])=>{return vn[Vn]=(Dn)=>new Vo(Dn,rn.to),vn},P),Object.assign(Mn,{types:P,typed:P,unsafe:yn,notify:H,array:Q,json:K,file:en}),Mn;function P(vn,Vn){return new Vo(vn,Vn)}function Mn(vn,...Vn){return vn&&Array.isArray(vn.raw)?new co(vn,Vn,O,X):typeof vn==="string"&&!Vn.length?new ia(o.transform.column.to?o.transform.column.to(vn):vn):new Pm(vn,Vn)}function yn(vn,Vn=[],rn={}){return arguments.length===2&&!Array.isArray(Vn)&&(rn=Vn,Vn=[]),new co([vn],Vn,O,X,{prepare:!1,...rn,simple:"simple"in rn?rn.simple:Vn.length===0})}function en(vn,Vn=[],rn={}){return arguments.length===2&&!Array.isArray(Vn)&&(rn=Vn,Vn=[]),new co([],Vn,(un)=>{fG.readFile(vn,"utf8",(Ti,_n)=>{if(Ti)return un.reject(Ti);un.strings=[_n],O(un)})},X,{...rn,simple:"simple"in rn?rn.simple:Vn.length===0})}}async function G(O,P,Mn){let yn={fn:P,onlisten:Mn},en=G.sql||(G.sql=nf({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(G.channels).forEach(([un,{listeners:Ti}])=>{delete G.channels[un],Promise.all(Ti.map((_n)=>G(un,_n.fn,_n.onlisten).catch(()=>{})))})},onnotify(un,Ti){un in G.channels&&G.channels[un].listeners.forEach((_n)=>_n.fn(Ti))}})),vn=G.channels||(G.channels={});if(O in vn){vn[O].listeners.push(yn);let un=await vn[O].result;return yn.onlisten&&yn.onlisten(),{state:un.state,unlisten:Dn}}vn[O]={result:en`listen ${en.unsafe('"'+O.replace(/"/g,'""')+'"')}`,listeners:[yn]};let rn=await vn[O].result;return yn.onlisten&&yn.onlisten(),{state:rn.state,unlisten:Dn};async function Dn(){if(O in vn===!1)return;if(vn[O].listeners=vn[O].listeners.filter((un)=>un!==yn),vn[O].listeners.length)return;return delete vn[O],en`unlisten ${en.unsafe('"'+O.replace(/"/g,'""')+'"')}`}}async function H(O,P){return await S`select pg_notify(${O}, ${""+P})`}async function B(){let O=ki(),P=$.length?$.shift():await new Promise((en)=>{x.push({reserve:en}),f.length&&Xn(f.shift())});Y(P,m),P.reserved=()=>O.length?P.execute(O.shift()):Y(P,m),P.reserved.release=!0;let Mn=M(yn);return Mn.release=()=>{P.reserved=null,Vi(P)},Mn;function yn(en){P.queue===T?O.push(en):P.execute(en)||Y(P,T)}}async function k(O,P){!P&&(P=O,O="");let Mn=ki(),yn=0,en,vn=null;try{return await S.unsafe("begin "+O.replace(/[^a-z ]/ig,""),[],{onexecute:rn}).execute(),await Promise.race([Vn(en,P),new Promise((Dn,un)=>en.onclose=un)])}catch(Dn){throw Dn}async function Vn(Dn,un,Ti){let _n=M(ni);_n.savepoint=ko,_n.prepare=(bn)=>vn=bn.replace(/[^a-z0-9$-_. ]/gi);let po,Ji;Ti&&await _n`savepoint ${_n(Ti)}`;try{if(Ji=await new Promise((bn,xo)=>{let Xo=un(_n);Promise.resolve(Array.isArray(Xo)?Promise.all(Xo):Xo).then(bn,xo)}),po)throw po}catch(bn){throw await(Ti?_n`rollback to ${_n(Ti)}`:_n`rollback`),bn instanceof tp&&bn.code==="25P02"&&po||bn}if(!Ti)vn?await _n`prepare transaction '${_n.unsafe(vn)}'`:await _n`commit`;return Ji;function ko(bn,xo){if(bn&&Array.isArray(bn.raw))return ko((Xo)=>Xo.apply(Xo,arguments));return arguments.length===1&&(xo=bn,bn=null),Vn(Dn,xo,"s"+yn+++(bn?"_"+bn:""))}function ni(bn){bn.catch((xo)=>po||(po=xo)),Dn.queue===T?Mn.push(bn):Dn.execute(bn)||Y(Dn,T)}}function rn(Dn){en=Dn,Y(Dn,m),Dn.reserved=()=>Mn.length?Dn.execute(Mn.shift()):Y(Dn,m)}}function Y(O,P){return O.queue.remove(O),P.push(O),O.queue=P,P===$?O.idleTimer.start():O.idleTimer.cancel(),O}function K(O){return new Vo(O,3802)}function Q(O,P){if(!Array.isArray(O))return Q(Array.from(arguments));return new Vo(O,P||(O.length?Zm(O)||25:0),o.shared.typeArrayMap)}function u(O){if(p)return O.reject(dn.connection("CONNECTION_ENDED",o,o));if($.length)return V($.shift(),O);if(f.length)return Xn(f.shift(),O);v.length?V(v.shift(),O):x.push(O)}function V(O,P){return O.execute(P)?Y(O,v):Y(O,T)}function X(O){return new Promise((P,Mn)=>{O.state?O.active?g$(o).cancel(O.state,P,Mn):O.cancelled={resolve:P,reject:Mn}:(x.remove(O),O.cancelled=!0,O.reject(dn.generic("57014","canceling statement due to user request")),P())})}async function s({timeout:O=null}={}){if(p)return p;await 1;let P;return p=Promise.race([new Promise((Mn)=>O!==null&&(P=setTimeout(q,O*1000,Mn))),Promise.all(R.map((Mn)=>Mn.end()).concat(G.sql?G.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(P))}async function C(){await Promise.all(R.map((O)=>O.end()))}async function q(O){await Promise.all(R.map((P)=>P.terminate()));while(x.length)x.shift().reject(dn.connection("CONNECTION_DESTROYED",o));O()}function Xn(O,P){return Y(O,a),O.connect(P),O}function Un(O){Y(O,l)}function Vi(O){if(x.length===0)return Y(O,$);let P=Math.ceil(x.length/(a.length+1)),Mn=!0;while(Mn&&x.length&&P-- >0){let yn=x.shift();if(yn.reserve)return yn.reserve(O);Mn=O.execute(yn)}Mn?Y(O,v):Y(O,T)}function _o(O,P){Y(O,f),O.reserved=null,O.onclose&&(O.onclose(P),O.onclose=null),o.onclose&&o.onclose(O.id),x.length&&Xn(O,x.shift())}}function lG(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:x}=wG(n),a=[...p.searchParams].reduce((T,[F,R])=>(T[F]=R,T),{}),m=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",f=c.port||p.port||o.PGPORT||5432,l=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||AG();c.no_prepare&&(c.prepare=!1),a.sslmode&&(a.ssl=a.sslmode,delete a.sslmode),"timeout"in c&&(console.log("The timeout option is deprecated, use idle_timeout instead"),c.idle_timeout=c.timeout),a.sslrootcert==="system"&&(a.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:TG,max_pipeline:100,backoff:vG,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(f)?f:m.split(",").map((T)=>parseInt(T.split(":")[1]||f)),path:c.path||m.indexOf("/")>-1&&m+"/.s.PGSQL."+f,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||l,user:l,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(v).reduce((T,[F,R])=>{let S=F in c?c[F]:(F in a)?a[F]==="disable"||a[F]==="false"?!1:a[F]:o["PG"+F.toUpperCase()]||R;return T[F]=typeof S==="string"&&$.includes(F)?+S:S,T},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(a).reduce((T,[F,R])=>((F in v)||(T[F]=R),T),{})},types:c.types||{},target_session_attrs:$G(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:JG(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...KR(c.types)}}function $G(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 vG(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function TG(){return 60*(30+Math.random()*30)}function JG(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 wG(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 AG(){try{return mG.userInfo().username}catch(n){return process.env.USERNAME||"runner"}}class of extends Qi{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[w]="PgDelete";config;where(n){return this.config.where=n,this}returning(n=this.config.table[y.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 En.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};$dynamic(){return this}}function SG(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 x=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+x},"")}function MG(n){return n}class n0{static[w]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?SG:n==="camelCase"?FG:MG}getColumnCasing(n){if(!n.keyAsName)return n.name;let i=n.table[y.Symbol.Schema]??"public",o=n.table[y.Symbol.OriginalName],c=`${i}.${o}.${n.name}`;if(!this.cache[c])this.cacheTable(n.table);return this.cache[c]}cacheTable(n){let i=n[y.Symbol.Schema]??"public",o=n[y.Symbol.OriginalName],c=`${i}.${o}`;if(!this.cachedTables[c]){for(let p of Object.values(n[y.Symbol.Columns])){let x=`${c}.${p.name}`;this.cache[x]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class ca extends ui{static[w]="PgViewBase"}class Pc{static[w]="PgDialect";casing;constructor(n){this.casing=new n0(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",x=A`
74
+ `};return c(f),new Promise(async(v)=>m=v);async function l({highWaterMark:v=16384,start:T=0,end:F=1/0}={}){let R=F-T;return T&&await f.seek(T),new uR.Readable({highWaterMark:v,async read(S){let M=S>R?S-R:S;R-=S;let[{data:G}]=await f.read(M);if(this.push(G),G.length<S)this.push(null)}})}async function $({highWaterMark:v=16384,start:T=0}={}){return T&&await f.seek(T),new uR.Writable({highWaterMark:v,write(F,R,S){f.write(F).then(()=>S(),S)}})}}).catch(p)})}Object.assign(cf,{PostgresError:rp,toPascal:Zc,pascal:P$,toCamel:sc,camel:q$,toKebab:qc,kebab:t$,fromPascal:ex,fromCamel:dx,fromKebab:nm,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var dp=cf;function cf(n,i){let o=MG(n,i),c=o.no_subscribe||n0(cf,{...o}),p=!1,x=ki(),m=ki(),a=ki(),f=ki(),l=ki(),$=ki(),v=ki(),T=ki(),F={connecting:m,reserved:a,closed:f,ended:l,open:$,busy:v,full:T},R=[...Array(o.max)].map(()=>e$(o,F,{onopen:Vi,onend:Un,onclose:_o})),S=M(u);return Object.assign(S,{get parameters(){return o.parameters},largeObject:i0.bind(null,S),subscribe:c,CLOSE:tp,END:tp,PostgresError:rp,options:o,reserve:y,listen:G,begin:k,close:C,end:s}),S;function M(O){return O.debug=o.debug,Object.entries(o.types).reduce((vn,[Vn,rn])=>{return vn[Vn]=(Dn)=>new Vo(Dn,rn.to),vn},P),Object.assign(Mn,{types:P,typed:P,unsafe:yn,notify:H,array:Q,json:K,file:en}),Mn;function P(vn,Vn){return new Vo(vn,Vn)}function Mn(vn,...Vn){return vn&&Array.isArray(vn.raw)?new po(vn,Vn,O,X):typeof vn==="string"&&!Vn.length?new im(o.transform.column.to?o.transform.column.to(vn):vn):new ra(vn,Vn)}function yn(vn,Vn=[],rn={}){return arguments.length===2&&!Array.isArray(Vn)&&(rn=Vn,Vn=[]),new po([vn],Vn,O,X,{prepare:!1,...rn,simple:"simple"in rn?rn.simple:Vn.length===0})}function en(vn,Vn=[],rn={}){return arguments.length===2&&!Array.isArray(Vn)&&(rn=Vn,Vn=[]),new po([],Vn,(un)=>{FG.readFile(vn,"utf8",(Ji,_n)=>{if(Ji)return un.reject(Ji);un.strings=[_n],O(un)})},X,{...rn,simple:"simple"in rn?rn.simple:Vn.length===0})}}async function G(O,P,Mn){let yn={fn:P,onlisten:Mn},en=G.sql||(G.sql=cf({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(G.channels).forEach(([un,{listeners:Ji}])=>{delete G.channels[un],Promise.all(Ji.map((_n)=>G(un,_n.fn,_n.onlisten).catch(()=>{})))})},onnotify(un,Ji){un in G.channels&&G.channels[un].listeners.forEach((_n)=>_n.fn(Ji))}})),vn=G.channels||(G.channels={});if(O in vn){vn[O].listeners.push(yn);let un=await vn[O].result;return yn.onlisten&&yn.onlisten(),{state:un.state,unlisten:Dn}}vn[O]={result:en`listen ${en.unsafe('"'+O.replace(/"/g,'""')+'"')}`,listeners:[yn]};let rn=await vn[O].result;return yn.onlisten&&yn.onlisten(),{state:rn.state,unlisten:Dn};async function Dn(){if(O in vn===!1)return;if(vn[O].listeners=vn[O].listeners.filter((un)=>un!==yn),vn[O].listeners.length)return;return delete vn[O],en`unlisten ${en.unsafe('"'+O.replace(/"/g,'""')+'"')}`}}async function H(O,P){return await S`select pg_notify(${O}, ${""+P})`}async function y(){let O=ki(),P=$.length?$.shift():await new Promise((en)=>{x.push({reserve:en}),f.length&&Xn(f.shift())});Y(P,a),P.reserved=()=>O.length?P.execute(O.shift()):Y(P,a),P.reserved.release=!0;let Mn=M(yn);return Mn.release=()=>{P.reserved=null,Vi(P)},Mn;function yn(en){P.queue===T?O.push(en):P.execute(en)||Y(P,T)}}async function k(O,P){!P&&(P=O,O="");let Mn=ki(),yn=0,en,vn=null;try{return await S.unsafe("begin "+O.replace(/[^a-z ]/ig,""),[],{onexecute:rn}).execute(),await Promise.race([Vn(en,P),new Promise((Dn,un)=>en.onclose=un)])}catch(Dn){throw Dn}async function Vn(Dn,un,Ji){let _n=M(ni);_n.savepoint=so,_n.prepare=(bn)=>vn=bn.replace(/[^a-z0-9$-_. ]/gi);let xo,wi;Ji&&await _n`savepoint ${_n(Ji)}`;try{if(wi=await new Promise((bn,mo)=>{let Xo=un(_n);Promise.resolve(Array.isArray(Xo)?Promise.all(Xo):Xo).then(bn,mo)}),xo)throw xo}catch(bn){throw await(Ji?_n`rollback to ${_n(Ji)}`:_n`rollback`),bn instanceof rp&&bn.code==="25P02"&&xo||bn}if(!Ji)vn?await _n`prepare transaction '${_n.unsafe(vn)}'`:await _n`commit`;return wi;function so(bn,mo){if(bn&&Array.isArray(bn.raw))return so((Xo)=>Xo.apply(Xo,arguments));return arguments.length===1&&(mo=bn,bn=null),Vn(Dn,mo,"s"+yn+++(bn?"_"+bn:""))}function ni(bn){bn.catch((mo)=>xo||(xo=mo)),Dn.queue===T?Mn.push(bn):Dn.execute(bn)||Y(Dn,T)}}function rn(Dn){en=Dn,Y(Dn,a),Dn.reserved=()=>Mn.length?Dn.execute(Mn.shift()):Y(Dn,a)}}function Y(O,P){return O.queue.remove(O),P.push(O),O.queue=P,P===$?O.idleTimer.start():O.idleTimer.cancel(),O}function K(O){return new Vo(O,3802)}function Q(O,P){if(!Array.isArray(O))return Q(Array.from(arguments));return new Vo(O,P||(O.length?Pa(O)||25:0),o.shared.typeArrayMap)}function u(O){if(p)return O.reject(dn.connection("CONNECTION_ENDED",o,o));if($.length)return V($.shift(),O);if(f.length)return Xn(f.shift(),O);v.length?V(v.shift(),O):x.push(O)}function V(O,P){return O.execute(P)?Y(O,v):Y(O,T)}function X(O){return new Promise((P,Mn)=>{O.state?O.active?e$(o).cancel(O.state,P,Mn):O.cancelled={resolve:P,reject:Mn}:(x.remove(O),O.cancelled=!0,O.reject(dn.generic("57014","canceling statement due to user request")),P())})}async function s({timeout:O=null}={}){if(p)return p;await 1;let P;return p=Promise.race([new Promise((Mn)=>O!==null&&(P=setTimeout(q,O*1000,Mn))),Promise.all(R.map((Mn)=>Mn.end()).concat(G.sql?G.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(P))}async function C(){await Promise.all(R.map((O)=>O.end()))}async function q(O){await Promise.all(R.map((P)=>P.terminate()));while(x.length)x.shift().reject(dn.connection("CONNECTION_DESTROYED",o));O()}function Xn(O,P){return Y(O,m),O.connect(P),O}function Un(O){Y(O,l)}function Vi(O){if(x.length===0)return Y(O,$);let P=Math.ceil(x.length/(m.length+1)),Mn=!0;while(Mn&&x.length&&P-- >0){let yn=x.shift();if(yn.reserve)return yn.reserve(O);Mn=O.execute(yn)}Mn?Y(O,v):Y(O,T)}function _o(O,P){Y(O,f),O.reserved=null,O.onclose&&(O.onclose(P),O.onclose=null),o.onclose&&o.onclose(O.id),x.length&&Xn(O,x.shift())}}function MG(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:x}=GG(n),m=[...p.searchParams].reduce((T,[F,R])=>(T[F]=R,T),{}),a=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",f=c.port||p.port||o.PGPORT||5432,l=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||YG();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:WG,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(a)?a:a.split(",").map((T)=>T.split(":")[0]),port:Array.isArray(f)?f:a.split(",").map((T)=>parseInt(T.split(":")[1]||f)),path:c.path||a.indexOf("/")>-1&&a+"/.s.PGSQL."+f,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||l,user:l,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(v).reduce((T,[F,R])=>{let S=F in c?c[F]:(F in m)?m[F]==="disable"||m[F]==="false"?!1:m[F]:o["PG"+F.toUpperCase()]||R;return T[F]=typeof S==="string"&&$.includes(F)?+S:S,T},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((T,[F,R])=>((F in v)||(T[F]=R),T),{})},types:c.types||{},target_session_attrs:RG(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:XG(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...XR(c.types)}}function RG(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 WG(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function KG(){return 60*(30+Math.random()*30)}function XG(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 GG(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 YG(){try{return SG.userInfo().username}catch(n){return process.env.USERNAME||"runner"}}class pf extends Qi{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[w]="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 En.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};$dynamic(){return this}}function zG(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function HG(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((o,c,p)=>{let x=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+x},"")}function QG(n){return n}class o0{static[w]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?zG:n==="camelCase"?HG:QG}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 x=`${c}.${p.name}`;this.cache[x]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class cm extends ui{static[w]="PgViewBase"}class tc{static[w]="PgDialect";casing;constructor(n){this.casing=new o0(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",x=A`
75
75
  CREATE TABLE IF NOT EXISTS ${A.identifier(p)}.${A.identifier(c)} (
76
76
  id SERIAL PRIMARY KEY,
77
77
  hash text NOT NULL,
78
78
  created_at bigint
79
79
  )
80
- `;await i.execute(A`CREATE SCHEMA IF NOT EXISTS ${A.identifier(p)}`),await i.execute(x);let m=(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(f)=>{for await(let l of n)if(!m||Number(m.created_at)<l.folderMillis){for(let $ of l.sql)await f.execute(A.raw($));await f.execute(A`insert into ${A.identifier(p)}.${A.identifier(c)} ("hash", "created_at") values(${l.hash}, ${l.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),x=o?A` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,a=i?A` where ${i}`:void 0;return A`${p}delete from ${n}${a}${x}`}buildUpdateSet(n,i){let o=n[y.Symbol.Columns],c=Object.keys(o).filter((x)=>i[x]!==void 0||o[x]?.onUpdateFn!==void 0),p=c.length;return A.join(c.flatMap((x,a)=>{let m=o[x],f=i[x]??A.param(m.onUpdateFn(),m),l=A`${A.identifier(this.casing.getColumnCasing(m))} = ${f}`;if(a<p-1)return[l,A.raw(", ")];return[l]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p,from:x,joins:a}){let m=this.buildWithCTE(p),f=n[$i.Symbol.Name],l=n[$i.Symbol.Schema],$=n[$i.Symbol.OriginalName],v=f===$?void 0:f,T=A`${l?A`${A.identifier(l)}.`:void 0}${A.identifier($)}${v&&A` ${A.identifier(v)}`}`,F=this.buildUpdateSet(n,i),R=x&&A.join([A.raw(" from "),this.buildFromTable(x)]),S=this.buildJoins(a),M=c?A` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,G=o?A` where ${o}`:void 0;return A`${m}update ${T} set ${F}${R}${S}${G}${M}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let a=[];if(z(p,N.Aliased)&&p.isSelectionField)a.push(A.identifier(p.fieldAlias));else if(z(p,N.Aliased)||z(p,N)){let m=z(p,N.Aliased)?p.sql:p;if(i)a.push(new N(m.queryChunks.map((f)=>{if(z(f,_))return A.identifier(this.casing.getColumnCasing(f));return f})));else a.push(m);if(z(p,N.Aliased))a.push(A` as ${A.identifier(p.fieldAlias)}`)}else if(z(p,On))if(i)a.push(A.identifier(this.casing.getColumnCasing(p)));else a.push(p);if(x<o-1)a.push(A`, `);return a});return A.join(c)}buildJoins(n){if(!n||n.length===0)return;let i=[];for(let[o,c]of n.entries()){if(o===0)i.push(A` `);let p=c.table,x=c.lateral?A` lateral`:void 0;if(z(p,$i)){let a=p[$i.Symbol.Name],m=p[$i.Symbol.Schema],f=p[$i.Symbol.OriginalName],l=a===f?void 0:c.alias;i.push(A`${A.raw(c.joinType)} join${x} ${m?A`${A.identifier(m)}.`:void 0}${A.identifier(f)}${l&&A` ${A.identifier(l)}`} on ${c.on}`)}else if(z(p,ui)){let a=p[Bn].name,m=p[Bn].schema,f=p[Bn].originalName,l=a===f?void 0:c.alias;i.push(A`${A.raw(c.joinType)} join${x} ${m?A`${A.identifier(m)}.`:void 0}${A.identifier(f)}${l&&A` ${A.identifier(l)}`} on ${c.on}`)}else i.push(A`${A.raw(c.joinType)} join${x} ${p} on ${c.on}`);if(o<n.length-1)i.push(A` `)}return A.join(i)}buildFromTable(n){if(z(n,y)&&n[y.Symbol.OriginalName]!==n[y.Symbol.Name]){let i=A`${A.identifier(n[y.Symbol.OriginalName])}`;if(n[y.Symbol.Schema])i=A`${A.identifier(n[y.Symbol.Schema])}.${i}`;return A`${i} ${A.identifier(n[y.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:a,orderBy:m,groupBy:f,limit:l,offset:$,lockingClause:v,distinct:T,setOperators:F}){let R=o??ei(i);for(let q of R)if(z(q.field,On)&&di(q.field.table)!==(z(x,ci)?x._.alias:z(x,ca)?x[Bn].name:z(x,N)?void 0:di(x))&&!((Xn)=>a?.some(({alias:Un})=>Un===(Xn[y.Symbol.IsAlias]?di(Xn):Xn[y.Symbol.BaseName])))(q.field.table)){let Xn=di(q.field.table);throw new Error(`Your "${q.path.join("->")}" field references a column "${Xn}"."${q.field.name}", but the table "${Xn}" is not part of the query! Did you forget to join it?`)}let S=!a||a.length===0,M=this.buildWithCTE(n),G;if(T)G=T===!0?A` distinct`:A` distinct on (${A.join(T.on,A`, `)})`;let H=this.buildSelection(R,{isSingleTable:S}),B=this.buildFromTable(x),k=this.buildJoins(a),Y=c?A` where ${c}`:void 0,K=p?A` having ${p}`:void 0,Q;if(m&&m.length>0)Q=A` order by ${A.join(m,A`, `)}`;let u;if(f&&f.length>0)u=A` group by ${A.join(f,A`, `)}`;let V=typeof l==="object"||typeof l==="number"&&l>=0?A` limit ${l}`:void 0,X=$?A` offset ${$}`:void 0,s=A.empty();if(v){let q=A` for ${A.raw(v.strength)}`;if(v.config.of)q.append(A` of ${A.join(Array.isArray(v.config.of)?v.config.of:[v.config.of],A`, `)}`);if(v.config.noWait)q.append(A` no wait`);else if(v.config.skipLocked)q.append(A` skip locked`);s.append(q)}let C=A`${M}select${G} ${H} from ${B}${k}${Y}${u}${K}${Q}${V}${X}${s}`;if(F.length>0)return this.buildSetOperations(C,F);return C}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:x,offset:a}}){let m=A`(${n.getSQL()}) `,f=A`(${c.getSQL()})`,l;if(x&&x.length>0){let F=[];for(let R of x)if(z(R,_))F.push(A.identifier(R.name));else if(z(R,N)){for(let S=0;S<R.queryChunks.length;S++){let M=R.queryChunks[S];if(z(M,_))R.queryChunks[S]=A.identifier(M.name)}F.push(A`${R}`)}else F.push(A`${R}`);l=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 ":""}`),T=a?A` offset ${a}`:void 0;return A`${m}${v}${f}${l}${$}${T}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:a}){let m=[],f=n[y.Symbol.Columns],l=Object.entries(f).filter(([M,G])=>!G.shouldDisableInsert()),$=l.map(([,M])=>A.identifier(this.casing.getColumnCasing(M)));if(x){let M=i;if(z(M,N))m.push(M);else m.push(M.getSQL())}else{let M=i;m.push(A.raw("values "));for(let[G,H]of M.entries()){let B=[];for(let[k,Y]of l){let K=H[k];if(K===void 0||z(K,Li)&&K.value===void 0)if(Y.defaultFn!==void 0){let Q=Y.defaultFn(),u=z(Q,N)?Q:A.param(Q,Y);B.push(u)}else if(!Y.default&&Y.onUpdateFn!==void 0){let Q=Y.onUpdateFn(),u=z(Q,N)?Q:A.param(Q,Y);B.push(u)}else B.push(A`default`);else B.push(K)}if(m.push(B),G<M.length-1)m.push(A`, `)}}let v=this.buildWithCTE(p),T=A.join(m),F=c?A` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,R=o?A` on conflict ${o}`:void 0,S=a===!0?A`overriding system value `:void 0;return A`${v}insert into ${n} ${$} ${S}${T}${R}${F}`}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(z(n,am)||z(n,xm))return"json";else if(z(n,mm))return"decimal";else if(z(n,fm))return"time";else if(z(n,lm)||z(n,$m))return"timestamp";else if(z(n,om)||z(n,cm))return"date";else if(z(n,vm))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:x,tableAlias:a,nestedQueryRelation:m,joinOn:f}){let l=[],$,v,T=[],F,R=[];if(x===!0)l=Object.entries(p.columns).map(([G,H])=>({dbKey:H.name,tsKey:G,field:Ho(H,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let M=Object.fromEntries(Object.entries(p.columns).map(([K,Q])=>[K,Ho(Q,a)]));if(x.where){let K=typeof x.where==="function"?x.where(M,pA()):x.where;F=K&&Ex(K,a)}let G=[],H=[];if(x.columns){let K=!1;for(let[Q,u]of Object.entries(x.columns)){if(u===void 0)continue;if(Q in p.columns){if(!K&&u===!0)K=!0;H.push(Q)}}if(H.length>0)H=K?H.filter((Q)=>x.columns?.[Q]===!0):Object.keys(p.columns).filter((Q)=>!H.includes(Q))}else H=Object.keys(p.columns);for(let K of H){let Q=p.columns[K];G.push({tsKey:K,value:Q})}let B=[];if(x.with)B=Object.entries(x.with).filter((K)=>!!K[1]).map(([K,Q])=>({tsKey:K,queryConfig:Q,relation:p.relations[K]}));let k;if(x.extras){k=typeof x.extras==="function"?x.extras(M,{sql:A}):x.extras;for(let[K,Q]of Object.entries(k))G.push({tsKey:K,value:Ql(Q,a)})}for(let{tsKey:K,value:Q}of G)l.push({dbKey:z(Q,N.Aliased)?Q.fieldAlias:p.columns[K].name,tsKey:K,field:z(Q,On)?Ho(Q,a):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let Y=typeof x.orderBy==="function"?x.orderBy(M,xA()):x.orderBy??[];if(!Array.isArray(Y))Y=[Y];T=Y.map((K)=>{if(z(K,On))return Ho(K,a);return Ex(K,a)}),$=x.limit,v=x.offset;for(let{tsKey:K,queryConfig:Q,relation:u}of B){let V=mA(i,o,u),X=Uc(u.referencedTable),s=o[X],C=`${a}_${K}`,q=Vc(...V.fields.map((Vi,_o)=>Qo(Ho(V.references[_o],C),Ho(Vi,a)))),Xn=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[s],tableConfig:i[s],queryConfig:z(u,fc)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:C,joinOn:q,nestedQueryRelation:u}),Un=A`${A.identifier(C)}.${A.identifier("data")}`.as(K);R.push({on:A`true`,table:new ci(Xn.sql,{},C),alias:C,joinType:"left",lateral:!0}),l.push({dbKey:K,tsKey:K,field:Un,relationTableTsKey:s,isJson:!0,selection:Xn.selection})}}if(l.length===0)throw new ea({message:`No fields selected for table "${p.tsName}" ("${a}")`});let S;if(F=Vc(f,F),m){let M=A`json_build_array(${A.join(l.map(({field:B,tsKey:k,isJson:Y})=>Y?A`${A.identifier(`${a}_${k}`)}.${A.identifier("data")}`:z(B,N.Aliased)?B.sql:B),A`, `)})`;if(z(m,ux))M=A`coalesce(json_agg(${M}${T.length>0?A` order by ${A.join(T,A`, `)}`:void 0}), '[]'::json)`;let G=[{dbKey:"data",tsKey:"data",field:M.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:l}];if($!==void 0||v!==void 0||T.length>0)S=this.buildSelectQuery({table:da(c,a),fields:{},fieldsFlat:[{path:[],field:A.raw("*")}],where:F,limit:$,offset:v,orderBy:T,setOperators:[]}),F=void 0,$=void 0,v=void 0,T=[];else S=da(c,a);S=this.buildSelectQuery({table:z(S,$i)?S:new ci(S,{},a),fields:{},fieldsFlat:G.map(({field:B})=>({path:[],field:z(B,On)?Ho(B,a):B})),joins:R,where:F,limit:$,offset:v,orderBy:T,setOperators:[]})}else S=this.buildSelectQuery({table:da(c,a),fields:{},fieldsFlat:l.map(({field:M})=>({path:[],field:z(M,On)?Ho(M,a):M})),joins:R,where:F,limit:$,offset:v,orderBy:T,setOperators:[]});return{tableTsKey:p.tsName,sql:S,selection:l}}}class vi{static[w]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===Bn)return{...n[Bn],selectedFields:new Proxy(n[Bn].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(z(n,ci)?n._.selectedFields:z(n,ui)?n[Bn].selectedFields:n)[i];if(z(c,N.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(z(c,N)){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,On)){if(this.config.alias)return new Proxy(c,new Fp(new Proxy(c.table,new Ox(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 i0{static[w]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Ui{static[w]="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}authToken;setToken(n){return this.authToken=n,this}from(n){let i=!!this.fields,o;if(this.fields)o=this.fields;else if(z(n,ci))o=Object.fromEntries(Object.keys(n._.selectedFields).map((c)=>[c,n[c]]));else if(z(n,ca))o=n[Bn].selectedFields;else if(z(n,N))o={};else o=fJ(n);return new o0({table:n,fields:o,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}class uR extends i0{static[w]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:x,distinct:a}){super();this.config={withList:x,table:n,fields:{...i},distinct:a,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=yo(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=yo(i);if(typeof p==="string"&&this.config.joins?.some((x)=>x.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,N)){let x=z(i,ci)?i._.selectedFields:z(i,ui)?i[Bn].selectedFields:i[y.Symbol.Columns];this.config.fields[p]=x}}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(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!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(RG()):o;if(!Ux(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 ci(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 o0 extends uR{static[w]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p,authToken:x}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return En.startActiveSpan("drizzle.prepareQuery",()=>{let a=ei(o.fields),m=i.prepareQuery(c.sqlToQuery(this.getSQL()),a,n,!0);return m.joinsNotNullableMap=p,m.setToken(x)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}mJ(o0,[Qi]);function dp(n,i){return(o,c,...p)=>{let x=[c,...p].map((a)=>({type:n,isAll:i,rightSelect:a}));for(let a of x)if(!Ux(o.getSelectedFields(),a.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(x)}}var RG=()=>({union:WG,unionAll:KG,intersect:XG,intersectAll:GG,except:YG,exceptAll:zG}),WG=dp("union",!1),KG=dp("union",!0),XG=dp("intersect",!1),GG=dp("intersect",!0),YG=dp("except",!1),zG=dp("except",!0);class pa{static[w]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=z(n,Pc)?n:void 0,this.dialectConfig=z(n,Pc)?void 0:n}$with(n){let i=this;return{as(o){if(typeof o==="function")o=o(i);return new Proxy(new Qx(o.getSQL(),o.getSelectedFields(),n,!0),new vi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}with(...n){let i=this;function o(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(x,a){return new Ui({fields:a??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:x}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Ui({fields:i??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:n}})}getDialect(){if(!this.dialect)this.dialect=new Pc(this.dialectConfig);return this.dialect}}class cf{constructor(n,i,o,c,p){this.table=n,this.session=i,this.dialect=o,this.withList=c,this.overridingSystemValue_=p}static[w]="PgInsertBuilder";authToken;setToken(n){return this.authToken=n,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}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[y.Symbol.Columns];for(let x of Object.keys(o)){let a=o[x];c[x]=z(a,N)?a:new Li(a,p[x])}return c});return new c0(this.table,i,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(n){let i=typeof n==="function"?n(new pa):n;if(!z(i,N)&&!Ux(this.table[ta],i._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new c0(this.table,i,this.session,this.dialect,this.withList,!0)}}class c0 extends Qi{constructor(n,i,o,c,p,x,a){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p,select:x,overridingSystemValue_:a}}static[w]="PgInsert";config;returning(n=this.config.table[y.Symbol.Columns]){return this.config.returning=ei(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,im(this.config.table,n.set)),x="";return x=Array.isArray(n.target)?n.target.map((a)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(a))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target)),this.config.onConflict=A`(${A.raw(x)})${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 En.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};$dynamic(){return this}}class p0 extends Qi{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[w]="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 En.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}class pf{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[w]="PgUpdateBuilder";authToken;setToken(n){return this.authToken=n,this}set(n){return new bR(this.table,im(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class bR extends Qi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p,joins:[]},this.tableName=yo(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}static[w]="PgUpdate";config;tableName;joinsNotNullableMap;from(n){let i=yo(n);if(typeof i==="string")this.joinsNotNullableMap[i]=!0;return this.config.from=n,this}getTableLikeFields(n){if(z(n,$i))return n[y.Symbol.Columns];else if(z(n,ci))return n._.selectedFields;return n[Bn].selectedFields}createJoin(n){return(i,o)=>{let c=yo(i);if(typeof c==="string"&&this.config.joins.some((p)=>p.alias===c))throw new Error(`Alias "${c}" is already used in this query`);if(typeof o==="function"){let p=this.config.from&&!z(this.config.from,N)?this.getTableLikeFields(this.config.from):void 0;o=o(new Proxy(this.config.table[y.Symbol.Columns],new vi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),p&&new Proxy(p,new vi({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:o,table:i,joinType:n,alias:c}),typeof c==="string")switch(n){case"left":{this.joinsNotNullableMap[c]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!0;break}case"inner":{this.joinsNotNullableMap[c]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(n){return this.config.where=n,this}returning(n){if(!n){if(n=Object.assign({},this.config.table[y.Symbol.Columns]),this.config.from){let i=yo(this.config.from);if(typeof i==="string"&&this.config.from&&!z(this.config.from,N)){let o=this.getTableLikeFields(this.config.from);n[i]=o}for(let o of this.config.joins){let c=yo(o.table);if(typeof c==="string"&&!z(o.table,N)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}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){let i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return this._prepare().execute(n,this.authToken)};$dynamic(){return this}}class xa extends N{constructor(n){super(xa.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=xa.buildCount(n.source,n.filters)}sql;token;static[w]="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};`}setToken(n){return this.token=n,this}then(n,i){return Promise.resolve(this.session.count(this.sql,this.token)).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 a0{constructor(n,i,o,c,p,x,a){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=a}static[w]="PgRelationalQueryBuilder";findMany(n){return new x0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new x0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class x0 extends Qi{constructor(n,i,o,c,p,x,a,m,f){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=a,this.config=m,this.mode=f}static[w]="PgRelationalQuery";_prepare(n){return En.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let x=c.map((a)=>Tm(this.schema,this.tableConfig,a,i.selection,p));if(this.mode==="first")return x[0];return x})})}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}authToken;setToken(n){return this.authToken=n,this}execute(){return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(void 0,this.authToken)})}}class m0 extends Qi{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[w]="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 aa{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 a0(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[w]="PgDatabase";query;$with(n){let i=this;return{as(o){if(typeof o==="function")o=o(new pa(i.dialect));return new Proxy(new Qx(o.getSQL(),o.getSelectedFields(),n,!0),new vi({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}$count(n,i){return new xa({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(f,l){return new Ui({fields:l??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:f}})}function x(f){return new pf(f,i.session,i.dialect,n)}function a(f){return new cf(f,i.session,i.dialect,n)}function m(f){return new of(f,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:a,delete:m}}select(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Ui({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new pf(n,this.session,this.dialect)}insert(n){return new cf(n,this.session,this.dialect)}delete(n){return new of(n,this.session,this.dialect)}refreshMaterializedView(n){return new p0(n,this.session,this.dialect)}authToken;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 m0(()=>c.execute(void 0,this.authToken),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class jR{constructor(n,i){this.unique=n,this.name=i}static[w]="PgIndexBuilderOn";on(...n){return new xf(n.map((i)=>{if(z(i,N))return i;i=i;let o=new Hx(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 xf(n.map((i)=>{if(z(i,N))return i;i=i;let o=new Hx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new xf(i.map((o)=>{if(z(o,N))return o;o=o;let c=new Hx(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 xf{static[w]="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 BR(this.config,n)}}class BR{static[w]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function f0(n){return new jR(!0,n)}class l0{constructor(n){this.query=n}authToken;getQuery(){return this.query}mapResult(n,i){return n}setToken(n){return this.authToken=n,this}static[w]="PgPreparedQuery";joinsNotNullableMap}class $0{constructor(n){this.dialect=n}static[w]="PgSession";execute(n,i){return En.startActiveSpan("drizzle.operation",()=>{return En.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).setToken(i).execute(void 0,i)})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n,i){let o=await this.execute(n,i);return Number(o[0].count)}}class v0 extends aa{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[w]="PgTransaction";rollback(){throw new Ol}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 yR extends l0{constructor(n,i,o,c,p,x,a){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=x,this.customResultMapper=a}static[w]="PostgresJsPreparedQuery";async execute(n={}){return En.startActiveSpan("drizzle.execute",async(i)=>{let o=Hl(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:x,joinsNotNullableMap:a,customResultMapper:m}=this;if(!c&&!m)return En.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let f=await En.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),x.unsafe(p,o).values()});return En.startActiveSpan("drizzle.mapResponse",()=>{return m?m(f):f.map((l)=>aJ(c,l,a))})})}all(n={}){return En.startActiveSpan("drizzle.execute",async(i)=>{let o=Hl(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),En.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 ma extends $0{constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new Ul}static[w]="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 ma(o,this.dialect,this.schema,this.options),p=new T0(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class T0 extends v0{constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[w]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new ma(i,this.dialect,this.schema,this.session.options),c=new T0(this.dialect,o,this.schema);return n(c)})}}class LR extends aa{static[w]="PostgresJsDatabase"}function ep(n,i={}){let o=(f)=>f;for(let f of["1184","1082","1083","1114"])n.options.parsers[f]=o,n.options.serializers[f]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new Pc({casing:i.casing}),p;if(i.logger===!0)p=new El;else if(i.logger!==!1)p=i.logger;let x;if(i.schema){let f=aA(i.schema,fA);x={fullSchema:i.schema,schema:f.tables,tableNamesMap:f.tableNamesMap}}let a=new ma(n,c,x,{logger:p}),m=new LR(c,a,x);return m.$client=n,m}function af(...n){if(typeof n[0]==="string"){let i=gp(n[0]);return ep(i,n[1])}if(lJ(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return ep(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:x,...a}=i,m=gp(x,a);return ep(m,c)}let p=gp(i);return ep(p,c)}return ep(n[0],n[1])}((n)=>{function i(o){return ep({},o)}n.mock=i})(af||(af={}));var w0={};n8(w0,{users:()=>Ko,userChanges:()=>QG,untrackedUserColumnNames:()=>HG,twoFactorMethod:()=>IR,trackedUserColumnName:()=>hR,trackableUserColumnNames:()=>CR,role:()=>DR,players:()=>J0,passwordResetAttempts:()=>OG,loginHistory:()=>nx,games:()=>mf,banishedIps:()=>ff});function NR(n){return A`lower(${n})`}var DR=qa("role",["admin","user"]),Ko=mc("users",{id:Ni().primaryKey().defaultRandom(),username:li({length:16}).notNull(),email:li({length:254}).notNull(),hash:li({length:64}).notNull(),salt:li({length:36}).notNull(),createdAt:To({withTimezone:!0}).notNull().defaultNow(),createdIp:li({length:45}).notNull(),isActive:Vx().notNull().default(!1),verifiedAt:To({withTimezone:!0}),userRole:DR().default("user")},(n)=>[f0("usernameUniqueIndex").on(NR(n.username)),f0("emailUniqueIndex").on(NR(n.email))]),HG=["id","createdAt","createdIp","isActive","salt","verifiedAt"],CR=["username","email","hash","userRole"],hR=qa("trackedUserColumnName",CR),QG=mc("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ko.id),changedAt:To({withTimezone:!0}).notNull().defaultNow(),changedIp:li({length:45}).notNull(),changedColumn:hR().notNull(),oldValue:li({length:255}),newValue:li({length:255})}),mf=mc("games",{id:Ni().primaryKey().defaultRandom()}),J0=mc("players",{userId:Ni().notNull().references(()=>Ko.id),gameId:Ni().notNull().references(()=>mf.id),score:pm().notNull()},(n)=>[iA({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),nx=mc("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>Ko.id),loginTime:To({withTimezone:!0}).notNull().defaultNow(),ipAddress:li({length:45}).notNull(),userAgent:li({length:1024}),successful:Vx().notNull().default(!1)}),IR=qa("twoFactorMethod",["email","phone"]),OG=mc("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ko.id),requestedIp:li({length:45}).notNull(),requestedAt:To({withTimezone:!0}).notNull().defaultNow(),succeededIp:li({length:45}),succeededAt:To({withTimezone:!0}),verificationMethod:IR().notNull()}),ff=mc("banishedIps",{ip:li({length:45}).primaryKey(),reason:li({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 A0{options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(EG.resolve(__dirname,"notify_update.sql"));let n=[di(Ko),di(mf),di(J0)];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],x=`${c}("${p}")`;if(this.observers.has(x))this.observers.get(x).next(x)})}constructor(n=!1,i={host:tn.POSTGRES_HOST,port:tn.POSTGRES_PORT,user:tn.POSTGRES_USER,password:tn.POSTGRES_PASSWORD,database:tn.POSTGRES_DATABASE}){this.options=i,this.sql=gp(i),this.drizzle=af(this.sql,{schema:w0,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new an);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as UG}from"crypto";function S0(n){let i=UG("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 kR=["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 VG=3,_G=15,uG=/^[a-zA-Z0-9_-]+$/,qR=Kn.string().min(VG).max(_G).regex(uG),sR=20,ZR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function bG(n){let i="";for(let o of n)if(o in ZR)i+=ZR[o];else i+=o;return i}function jG(n){let i=n.toLocaleLowerCase(),o=bG(i);for(let c of kR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function BG(n){let i=new Set(n).size;return n.length*Math.log2(i)}function yG(n){let i=0,o=100;if(jG(n))i-=o;return i+=BG(n)*0.5,Math.max(i,0)}var PR=Kn.string().refine((n)=>{return yG(n)>=sR},{message:`Password does not meet the minimum complexity of ${sR}.`}).brand("password"),tR=Kn.object({username:qR,password:PR}).strict(),LG=Kn.string().email().brand("email"),rR=Kn.object({username:qR,password:PR,email:LG}).strict();var lf={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"},F0=E0(lf).map(([n])=>Kn.literal(Number(n))),NG=Kn.union([F0[0],F0[1],...F0]),gR=Kn.tuple([NG,Kn.string()]);var dR=eo({key:"count",default:0}),DG=Gc({key:"incrementTX",do:({set:n})=>{n(dR,(i)=>i+1)}}),eR=vv({key:"countContinuity",config:(n)=>n.add(dR).add(DG)});var i4=j$(Mc,"backend.worker.game.bun",$n),tc=new A0({logQuery(n,i){$n.info("\uD83D\uDCDD query",n,i)}});on.STORE.loggers[0]=new Kc("info",void 0,$n);var FI=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new o4.CronJob("00 15 * * * *",()=>{j$(Mc,"backend.worker.tribunal.bun",$n)}),n.start(),process.on("exit",()=>{n.stop(),$n.info("\u231B tribunal daily cronjob stopped")}),$n.info("\u23F3 tribunal daily cronjob started");return n})();function IG(n){if(b$)return hG(b$,n);return CG({},n)}var c4=IG((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 x=new Date,a=new URL(n.url,tn.VITE_BACKEND_ORIGIN);$n.info(x,p,n.method,a.pathname);let m=await tc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Qo(ff.ip,p)}),f=m?.banishedUntil===null,l=m?.banishedUntil&&m.banishedUntil>x;if(f||l){$n.info(`\uD83D\uDE45 request from banned ip ${p}`);return}switch(n.method){case"POST":if(!o)throw[400,"No data received"];switch(a.pathname){case`/sign-up-${S0("sign-up")}`:{let $=Buffer.concat(o).toString(),v=JSON.parse($),T=rR.safeParse(v);if(!T.success){$n.warn("signup parsed",T.error.issues);return}let{username:F,password:R,email:S}=T.data;if($n.info(`\uD83D\uDD11 attempting to sign up: ${F}`),await tc.drizzle.query.users.findFirst({columns:{id:!0},where:Qo(Ko.email,S)}))throw[400,"User already exists"];let G=crypto.randomUUID(),H=n4("sha256").update(R+G).digest("hex");await tc.drizzle.insert(Ko).values({username:F,email:S,hash:H,salt:G,createdIp:p}),$n.info(`\uD83D\uDD11 user created: ${F}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end(lf[201])}break;case`/login-${S0("login")}`:{let $=!1,v=null;try{let T=new Date(+x-600000);$n.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:T,now:x});let F=await tc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Vc(Qo(nx.ipAddress,p),Qo(nx.successful,!1),nm(nx.loginTime,T)),limit:10});$n.info(`\uD83D\uDD11 ${F.length}/10 recent failed logins from ${p}`);let R=10-F.length;if(R<1)throw $n.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await tc.drizzle.insert(ff).values({ip:p,reason:"Too many recent login attempts.",banishedAt:x,banishedUntil:new Date(+x+86400000)}),[429,"Too many recent login attempts."];let S=Buffer.concat(o).toString(),M=JSON.parse(S),G=tR.safeParse(M);if(!G.success)throw $n.warn("login parsed",G.error.issues),[400,`${R} attempts remaining.`];let{username:H,password:B}=G.data,k=await tc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Qo(Ko.username,H)});if($n.info("\uD83D\uDD11 login attempt as user",H),!k)throw $n.info(`\uD83D\uDD11 user ${H} does not exist`),[400,`${R} attempts remaining.`];let{hash:Y,salt:K}=k;if(v=k.id,n4("sha256").update(B+K).digest("hex")===Y){let u=crypto.randomUUID(),V=Im.get(H);if(!V)V=new Map,Im.set(H,V);V.set(u,Number(x)),$=!0,$n.info("\uD83D\uDD11 login successful as",H),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end(`${H} ${u}`)}}finally{await tc.drizzle.insert(nx).values({userId:v,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),$n.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}}}}catch(p){let x=gR.safeParse(p);if(x.success){let[a,m]=x.data,l=`${lf[a]}. ${m}`;$n.info(`\u274C ${a}: ${l}`),i.writeHead(a,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end(l)}else $n.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),M0=c4.listen(tn.BACKEND_PORT).address(),kG=typeof M0==="string"?null:M0===null?null:M0.port;if(kG===null)throw new Error("Could not determine port for test server");new rM(c4,{cors:{origin:tn.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}`,x=`socket::${n.id}`;if(Im.get(o)?.has(c)){let m=Tn(on.STORE,za,x);Yn(on.STORE,m,n),Wc(Yc,(f)=>{f.set(p,x)},on.STORE),Yn(on.STORE,Df,(f)=>f.add(p)),Yn(on.STORE,Nf,(f)=>f.add(x)),$n.info(`${o} connected on ${n.id}`),i()}else $n.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=Rv({socket:n,store:on.STORE})(eR);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=ip(Yc,c,on.STORE).userKeyOfSocket,x=An(on.STORE,p);if(Wc(Yc,(a)=>{a.delete(c)},on.STORE),x)Yn(on.STORE,Df,(a)=>(a.delete(x),a));Yn(on.STORE,Nf,(a)=>(a.delete(c),a)),$n.info(`${n.id} disconnected`),o()})});async function $f(){$n.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>i4.process.once("close",i));i4.process.emit("timeToStop"),await n,$n.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{$n.info("\u2757 received SIGINT; exiting gracefully"),await $f()});process.on("SIGTERM",async()=>{$n.info("\u2757 received SIGTERM; exiting gracefully"),await $f()});process.on("exit",async()=>{$n.info("\u2757 received exit; exiting gracefully"),await $f()});Mc.on("updatesReady",()=>{$n.info('\u2757 backend server received signal "updatesReady"'),Mc.emit("readyToUpdate"),$n.info('\u2757 backend server has sent signal "readyToUpdate"; now awaits signal "timeToStop"'),Mc.on("timeToStop",async()=>{$n.info('\u2757 backend server received signal "timeToStop"; exiting gracefully'),await $f()})});$n.info(`\uD83D\uDEEB backend server ready on port ${tn.BACKEND_PORT}`);Mc.emit("alive");export{FI as tribunalDaily};
80
+ `;await i.execute(A`CREATE SCHEMA IF NOT EXISTS ${A.identifier(p)}`),await i.execute(x);let a=(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(f)=>{for await(let l of n)if(!a||Number(a.created_at)<l.folderMillis){for(let $ of l.sql)await f.execute(A.raw($));await f.execute(A`insert into ${A.identifier(p)}.${A.identifier(c)} ("hash", "created_at") values(${l.hash}, ${l.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),x=o?A` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,m=i?A` where ${i}`:void 0;return A`${p}delete from ${n}${m}${x}`}buildUpdateSet(n,i){let o=n[L.Symbol.Columns],c=Object.keys(o).filter((x)=>i[x]!==void 0||o[x]?.onUpdateFn!==void 0),p=c.length;return A.join(c.flatMap((x,m)=>{let a=o[x],f=i[x]??A.param(a.onUpdateFn(),a),l=A`${A.identifier(this.casing.getColumnCasing(a))} = ${f}`;if(m<p-1)return[l,A.raw(", ")];return[l]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p,from:x,joins:m}){let a=this.buildWithCTE(p),f=n[vi.Symbol.Name],l=n[vi.Symbol.Schema],$=n[vi.Symbol.OriginalName],v=f===$?void 0:f,T=A`${l?A`${A.identifier(l)}.`:void 0}${A.identifier($)}${v&&A` ${A.identifier(v)}`}`,F=this.buildUpdateSet(n,i),R=x&&A.join([A.raw(" from "),this.buildFromTable(x)]),S=this.buildJoins(m),M=c?A` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,G=o?A` where ${o}`:void 0;return A`${a}update ${T} set ${F}${R}${S}${G}${M}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let m=[];if(z(p,N.Aliased)&&p.isSelectionField)m.push(A.identifier(p.fieldAlias));else if(z(p,N.Aliased)||z(p,N)){let a=z(p,N.Aliased)?p.sql:p;if(i)m.push(new N(a.queryChunks.map((f)=>{if(z(f,_))return A.identifier(this.casing.getColumnCasing(f));return f})));else m.push(a);if(z(p,N.Aliased))m.push(A` as ${A.identifier(p.fieldAlias)}`)}else if(z(p,On))if(i)m.push(A.identifier(this.casing.getColumnCasing(p)));else m.push(p);if(x<o-1)m.push(A`, `);return m});return A.join(c)}buildJoins(n){if(!n||n.length===0)return;let i=[];for(let[o,c]of n.entries()){if(o===0)i.push(A` `);let p=c.table,x=c.lateral?A` lateral`:void 0;if(z(p,vi)){let m=p[vi.Symbol.Name],a=p[vi.Symbol.Schema],f=p[vi.Symbol.OriginalName],l=m===f?void 0:c.alias;i.push(A`${A.raw(c.joinType)} join${x} ${a?A`${A.identifier(a)}.`:void 0}${A.identifier(f)}${l&&A` ${A.identifier(l)}`} on ${c.on}`)}else if(z(p,ui)){let m=p[Bn].name,a=p[Bn].schema,f=p[Bn].originalName,l=m===f?void 0:c.alias;i.push(A`${A.raw(c.joinType)} join${x} ${a?A`${A.identifier(a)}.`:void 0}${A.identifier(f)}${l&&A` ${A.identifier(l)}`} on ${c.on}`)}else i.push(A`${A.raw(c.joinType)} join${x} ${p} on ${c.on}`);if(o<n.length-1)i.push(A` `)}return A.join(i)}buildFromTable(n){if(z(n,L)&&n[L.Symbol.OriginalName]!==n[L.Symbol.Name]){let i=A`${A.identifier(n[L.Symbol.OriginalName])}`;if(n[L.Symbol.Schema])i=A`${A.identifier(n[L.Symbol.Schema])}.${i}`;return A`${i} ${A.identifier(n[L.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:m,orderBy:a,groupBy:f,limit:l,offset:$,lockingClause:v,distinct:T,setOperators:F}){let R=o??ei(i);for(let q of R)if(z(q.field,On)&&di(q.field.table)!==(z(x,ci)?x._.alias:z(x,cm)?x[Bn].name:z(x,N)?void 0:di(x))&&!((Xn)=>m?.some(({alias:Un})=>Un===(Xn[L.Symbol.IsAlias]?di(Xn):Xn[L.Symbol.BaseName])))(q.field.table)){let Xn=di(q.field.table);throw new Error(`Your "${q.path.join("->")}" field references a column "${Xn}"."${q.field.name}", but the table "${Xn}" is not part of the query! Did you forget to join it?`)}let S=!m||m.length===0,M=this.buildWithCTE(n),G;if(T)G=T===!0?A` distinct`:A` distinct on (${A.join(T.on,A`, `)})`;let H=this.buildSelection(R,{isSingleTable:S}),y=this.buildFromTable(x),k=this.buildJoins(m),Y=c?A` where ${c}`:void 0,K=p?A` having ${p}`:void 0,Q;if(a&&a.length>0)Q=A` order by ${A.join(a,A`, `)}`;let u;if(f&&f.length>0)u=A` group by ${A.join(f,A`, `)}`;let V=typeof l==="object"||typeof l==="number"&&l>=0?A` limit ${l}`:void 0,X=$?A` offset ${$}`:void 0,s=A.empty();if(v){let q=A` for ${A.raw(v.strength)}`;if(v.config.of)q.append(A` of ${A.join(Array.isArray(v.config.of)?v.config.of:[v.config.of],A`, `)}`);if(v.config.noWait)q.append(A` no wait`);else if(v.config.skipLocked)q.append(A` skip locked`);s.append(q)}let C=A`${M}select${G} ${H} from ${y}${k}${Y}${u}${K}${Q}${V}${X}${s}`;if(F.length>0)return this.buildSetOperations(C,F);return C}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:x,offset:m}}){let a=A`(${n.getSQL()}) `,f=A`(${c.getSQL()})`,l;if(x&&x.length>0){let F=[];for(let R of x)if(z(R,_))F.push(A.identifier(R.name));else if(z(R,N)){for(let S=0;S<R.queryChunks.length;S++){let M=R.queryChunks[S];if(z(M,_))R.queryChunks[S]=A.identifier(M.name)}F.push(A`${R}`)}else F.push(A`${R}`);l=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 ":""}`),T=m?A` offset ${m}`:void 0;return A`${a}${v}${f}${l}${$}${T}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:m}){let a=[],f=n[L.Symbol.Columns],l=Object.entries(f).filter(([M,G])=>!G.shouldDisableInsert()),$=l.map(([,M])=>A.identifier(this.casing.getColumnCasing(M)));if(x){let M=i;if(z(M,N))a.push(M);else a.push(M.getSQL())}else{let M=i;a.push(A.raw("values "));for(let[G,H]of M.entries()){let y=[];for(let[k,Y]of l){let K=H[k];if(K===void 0||z(K,Li)&&K.value===void 0)if(Y.defaultFn!==void 0){let Q=Y.defaultFn(),u=z(Q,N)?Q:A.param(Q,Y);y.push(u)}else if(!Y.default&&Y.onUpdateFn!==void 0){let Q=Y.onUpdateFn(),u=z(Q,N)?Q:A.param(Q,Y);y.push(u)}else y.push(A`default`);else y.push(K)}if(a.push(y),G<M.length-1)a.push(A`, `)}}let v=this.buildWithCTE(p),T=A.join(a),F=c?A` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,R=o?A` on conflict ${o}`:void 0,S=m===!0?A`overriding system value `:void 0;return A`${v}insert into ${n} ${$} ${S}${T}${R}${F}`}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(z(n,aa)||z(n,ma))return"json";else if(z(n,fa))return"decimal";else if(z(n,la))return"time";else if(z(n,$a)||z(n,va))return"timestamp";else if(z(n,ca)||z(n,pa))return"date";else if(z(n,Ta))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:x,tableAlias:m,nestedQueryRelation:a,joinOn:f}){let l=[],$,v,T=[],F,R=[];if(x===!0)l=Object.entries(p.columns).map(([G,H])=>({dbKey:H.name,tsKey:G,field:Ho(H,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let M=Object.fromEntries(Object.entries(p.columns).map(([K,Q])=>[K,Ho(Q,m)]));if(x.where){let K=typeof x.where==="function"?x.where(M,pA()):x.where;F=K&&Ux(K,m)}let G=[],H=[];if(x.columns){let K=!1;for(let[Q,u]of Object.entries(x.columns)){if(u===void 0)continue;if(Q in p.columns){if(!K&&u===!0)K=!0;H.push(Q)}}if(H.length>0)H=K?H.filter((Q)=>x.columns?.[Q]===!0):Object.keys(p.columns).filter((Q)=>!H.includes(Q))}else H=Object.keys(p.columns);for(let K of H){let Q=p.columns[K];G.push({tsKey:K,value:Q})}let y=[];if(x.with)y=Object.entries(x.with).filter((K)=>!!K[1]).map(([K,Q])=>({tsKey:K,queryConfig:Q,relation:p.relations[K]}));let k;if(x.extras){k=typeof x.extras==="function"?x.extras(M,{sql:A}):x.extras;for(let[K,Q]of Object.entries(k))G.push({tsKey:K,value:El(Q,m)})}for(let{tsKey:K,value:Q}of G)l.push({dbKey:z(Q,N.Aliased)?Q.fieldAlias:p.columns[K].name,tsKey:K,field:z(Q,On)?Ho(Q,m):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let Y=typeof x.orderBy==="function"?x.orderBy(M,xA()):x.orderBy??[];if(!Array.isArray(Y))Y=[Y];T=Y.map((K)=>{if(z(K,On))return Ho(K,m);return Ux(K,m)}),$=x.limit,v=x.offset;for(let{tsKey:K,queryConfig:Q,relation:u}of y){let V=aA(i,o,u),X=Uc(u.referencedTable),s=o[X],C=`${m}_${K}`,q=Vc(...V.fields.map((Vi,_o)=>Qo(Ho(V.references[_o],C),Ho(Vi,m)))),Xn=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[s],tableConfig:i[s],queryConfig:z(u,lc)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:C,joinOn:q,nestedQueryRelation:u}),Un=A`${A.identifier(C)}.${A.identifier("data")}`.as(K);R.push({on:A`true`,table:new ci(Xn.sql,{},C),alias:C,joinType:"left",lateral:!0}),l.push({dbKey:K,tsKey:K,field:Un,relationTableTsKey:s,isJson:!0,selection:Xn.selection})}}if(l.length===0)throw new na({message:`No fields selected for table "${p.tsName}" ("${m}")`});let S;if(F=Vc(f,F),a){let M=A`json_build_array(${A.join(l.map(({field:y,tsKey:k,isJson:Y})=>Y?A`${A.identifier(`${m}_${k}`)}.${A.identifier("data")}`:z(y,N.Aliased)?y.sql:y),A`, `)})`;if(z(a,bx))M=A`coalesce(json_agg(${M}${T.length>0?A` order by ${A.join(T,A`, `)}`:void 0}), '[]'::json)`;let G=[{dbKey:"data",tsKey:"data",field:M.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:l}];if($!==void 0||v!==void 0||T.length>0)S=this.buildSelectQuery({table:em(c,m),fields:{},fieldsFlat:[{path:[],field:A.raw("*")}],where:F,limit:$,offset:v,orderBy:T,setOperators:[]}),F=void 0,$=void 0,v=void 0,T=[];else S=em(c,m);S=this.buildSelectQuery({table:z(S,vi)?S:new ci(S,{},m),fields:{},fieldsFlat:G.map(({field:y})=>({path:[],field:z(y,On)?Ho(y,m):y})),joins:R,where:F,limit:$,offset:v,orderBy:T,setOperators:[]})}else S=this.buildSelectQuery({table:em(c,m),fields:{},fieldsFlat:l.map(({field:M})=>({path:[],field:z(M,On)?Ho(M,m):M})),joins:R,where:F,limit:$,offset:v,orderBy:T,setOperators:[]});return{tableTsKey:p.tsName,sql:S,selection:l}}}class Ti{static[w]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===Bn)return{...n[Bn],selectedFields:new Proxy(n[Bn].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(z(n,ci)?n._.selectedFields:z(n,ui)?n[Bn].selectedFields:n)[i];if(z(c,N.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(z(c,N)){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,On)){if(this.config.alias)return new Proxy(c,new Rp(new Proxy(c.table,new Ex(this.config.alias,this.config.replaceOriginalName??!1))));return c}if(typeof c!=="object"||c===null)return c;return new Proxy(c,new Ti(this.config))}}class c0{static[w]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Ui{static[w]="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}authToken;setToken(n){return this.authToken=n,this}from(n){let i=!!this.fields,o;if(this.fields)o=this.fields;else if(z(n,ci))o=Object.fromEntries(Object.keys(n._.selectedFields).map((c)=>[c,n[c]]));else if(z(n,cm))o=n[Bn].selectedFields;else if(z(n,N))o={};else o=fJ(n);return new p0({table:n,fields:o,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}class bR extends c0{static[w]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:x,distinct:m}){super();this.config={withList:x,table:n,fields:{...i},distinct:m,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=yo(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=yo(i);if(typeof p==="string"&&this.config.joins?.some((x)=>x.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,N)){let x=z(i,ci)?i._.selectedFields:z(i,ui)?i[Bn].selectedFields:i[L.Symbol.Columns];this.config.fields[p]=x}}if(typeof o==="function")o=o(new Proxy(this.config.fields,new Ti({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(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!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(OG()):o;if(!Vx(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 Ti({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=n,this}having(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new Ti({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 Ti({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 Ti({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 ci(this.getSQL(),this.config.fields,n),new Ti({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Ti({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class p0 extends bR{static[w]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p,authToken:x}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return En.startActiveSpan("drizzle.prepareQuery",()=>{let m=ei(o.fields),a=i.prepareQuery(c.sqlToQuery(this.getSQL()),m,n,!0);return a.joinsNotNullableMap=p,a.setToken(x)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}aJ(p0,[Qi]);function ep(n,i){return(o,c,...p)=>{let x=[c,...p].map((m)=>({type:n,isAll:i,rightSelect:m}));for(let m of x)if(!Vx(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(x)}}var OG=()=>({union:EG,unionAll:UG,intersect:VG,intersectAll:_G,except:uG,exceptAll:bG}),EG=ep("union",!1),UG=ep("union",!0),VG=ep("intersect",!1),_G=ep("intersect",!0),uG=ep("except",!1),bG=ep("except",!0);class pm{static[w]="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 Ox(o.getSQL(),o.getSelectedFields(),n,!0),new Ti({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}with(...n){let i=this;function o(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(x,m){return new Ui({fields:m??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:x}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Ui({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 xf{constructor(n,i,o,c,p){this.table=n,this.session=i,this.dialect=o,this.withList=c,this.overridingSystemValue_=p}static[w]="PgInsertBuilder";authToken;setToken(n){return this.authToken=n,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}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 x of Object.keys(o)){let m=o[x];c[x]=z(m,N)?m:new Li(m,p[x])}return c});return new x0(this.table,i,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(n){let i=typeof n==="function"?n(new pm):n;if(!z(i,N)&&!Vx(this.table[rm],i._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new x0(this.table,i,this.session,this.dialect,this.withList,!0)}}class x0 extends Qi{constructor(n,i,o,c,p,x,m){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p,select:x,overridingSystemValue_:m}}static[w]="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=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,oa(this.config.table,n.set)),x="";return x=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(x)})${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 En.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};$dynamic(){return this}}class m0 extends Qi{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[w]="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 En.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}class mf{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[w]="PgUpdateBuilder";authToken;setToken(n){return this.authToken=n,this}set(n){return new jR(this.table,oa(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class jR extends Qi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p,joins:[]},this.tableName=yo(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}static[w]="PgUpdate";config;tableName;joinsNotNullableMap;from(n){let i=yo(n);if(typeof i==="string")this.joinsNotNullableMap[i]=!0;return this.config.from=n,this}getTableLikeFields(n){if(z(n,vi))return n[L.Symbol.Columns];else if(z(n,ci))return n._.selectedFields;return n[Bn].selectedFields}createJoin(n){return(i,o)=>{let c=yo(i);if(typeof c==="string"&&this.config.joins.some((p)=>p.alias===c))throw new Error(`Alias "${c}" is already used in this query`);if(typeof o==="function"){let p=this.config.from&&!z(this.config.from,N)?this.getTableLikeFields(this.config.from):void 0;o=o(new Proxy(this.config.table[L.Symbol.Columns],new Ti({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),p&&new Proxy(p,new Ti({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:o,table:i,joinType:n,alias:c}),typeof c==="string")switch(n){case"left":{this.joinsNotNullableMap[c]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!0;break}case"inner":{this.joinsNotNullableMap[c]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(n){return this.config.where=n,this}returning(n){if(!n){if(n=Object.assign({},this.config.table[L.Symbol.Columns]),this.config.from){let i=yo(this.config.from);if(typeof i==="string"&&this.config.from&&!z(this.config.from,N)){let o=this.getTableLikeFields(this.config.from);n[i]=o}for(let o of this.config.joins){let c=yo(o.table);if(typeof c==="string"&&!z(o.table,N)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}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){let i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return this._prepare().execute(n,this.authToken)};$dynamic(){return this}}class xm extends N{constructor(n){super(xm.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=xm.buildCount(n.source,n.filters)}sql;token;static[w]="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};`}setToken(n){return this.token=n,this}then(n,i){return Promise.resolve(this.session.count(this.sql,this.token)).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 f0{constructor(n,i,o,c,p,x,m){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m}static[w]="PgRelationalQueryBuilder";findMany(n){return new a0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new a0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class a0 extends Qi{constructor(n,i,o,c,p,x,m,a,f){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m,this.config=a,this.mode=f}static[w]="PgRelationalQuery";_prepare(n){return En.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let x=c.map((m)=>Ja(this.schema,this.tableConfig,m,i.selection,p));if(this.mode==="first")return x[0];return x})})}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}authToken;setToken(n){return this.authToken=n,this}execute(){return En.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(void 0,this.authToken)})}}class l0 extends Qi{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[w]="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 mm{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 f0(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[w]="PgDatabase";query;$with(n){let i=this;return{as(o){if(typeof o==="function")o=o(new pm(i.dialect));return new Proxy(new Ox(o.getSQL(),o.getSelectedFields(),n,!0),new Ti({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}}$count(n,i){return new xm({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(f,l){return new Ui({fields:l??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:f}})}function x(f){return new mf(f,i.session,i.dialect,n)}function m(f){return new xf(f,i.session,i.dialect,n)}function a(f){return new pf(f,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:m,delete:a}}select(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Ui({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new mf(n,this.session,this.dialect)}insert(n){return new xf(n,this.session,this.dialect)}delete(n){return new pf(n,this.session,this.dialect)}refreshMaterializedView(n){return new m0(n,this.session,this.dialect)}authToken;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 l0(()=>c.execute(void 0,this.authToken),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[w]="PgIndexBuilderOn";on(...n){return new af(n.map((i)=>{if(z(i,N))return i;i=i;let o=new Qx(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 af(n.map((i)=>{if(z(i,N))return i;i=i;let o=new Qx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new af(i.map((o)=>{if(z(o,N))return o;o=o;let c=new Qx(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 af{static[w]="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 yR(this.config,n)}}class yR{static[w]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function $0(n){return new BR(!0,n)}class v0{constructor(n){this.query=n}authToken;getQuery(){return this.query}mapResult(n,i){return n}setToken(n){return this.authToken=n,this}static[w]="PgPreparedQuery";joinsNotNullableMap}class T0{constructor(n){this.dialect=n}static[w]="PgSession";execute(n,i){return En.startActiveSpan("drizzle.operation",()=>{return En.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).setToken(i).execute(void 0,i)})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n,i){let o=await this.execute(n,i);return Number(o[0].count)}}class J0 extends mm{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[w]="PgTransaction";rollback(){throw new Ul}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 LR extends v0{constructor(n,i,o,c,p,x,m){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=x,this.customResultMapper=m}static[w]="PostgresJsPreparedQuery";async execute(n={}){return En.startActiveSpan("drizzle.execute",async(i)=>{let o=Ol(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:x,joinsNotNullableMap:m,customResultMapper:a}=this;if(!c&&!a)return En.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let f=await En.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),x.unsafe(p,o).values()});return En.startActiveSpan("drizzle.mapResponse",()=>{return a?a(f):f.map((l)=>mJ(c,l,m))})})}all(n={}){return En.startActiveSpan("drizzle.execute",async(i)=>{let o=Ol(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),En.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 am extends T0{constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new _l}static[w]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new LR(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 am(o,this.dialect,this.schema,this.options),p=new w0(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class w0 extends J0{constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[w]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new am(i,this.dialect,this.schema,this.session.options),c=new w0(this.dialect,o,this.schema);return n(c)})}}class NR extends mm{static[w]="PostgresJsDatabase"}function nx(n,i={}){let o=(f)=>f;for(let f of["1184","1082","1083","1114"])n.options.parsers[f]=o,n.options.serializers[f]=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 Vl;else if(i.logger!==!1)p=i.logger;let x;if(i.schema){let f=mA(i.schema,fA);x={fullSchema:i.schema,schema:f.tables,tableNamesMap:f.tableNamesMap}}let m=new am(n,c,x,{logger:p}),a=new NR(c,m,x);return a.$client=n,a}function ff(...n){if(typeof n[0]==="string"){let i=dp(n[0]);return nx(i,n[1])}if(lJ(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return nx(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:x,...m}=i,a=dp(x,m);return nx(a,c)}let p=dp(i);return nx(p,c)}return nx(n[0],n[1])}((n)=>{function i(o){return nx({options:{parsers:{},serializers:{}}},o)}n.mock=i})(ff||(ff={}));var S0={};i8(S0,{users:()=>Ko,userChanges:()=>BG,untrackedUserColumnNames:()=>jG,twoFactorMethod:()=>kR,trackedUserColumnName:()=>IR,trackableUserColumnNames:()=>hR,role:()=>CR,players:()=>A0,passwordResetAttempts:()=>yG,loginHistory:()=>ix,games:()=>lf,banishedIps:()=>$f});function DR(n){return A`lower(${n})`}var CR=Pm("role",["admin","user"]),Ko=fc("users",{id:Ni().primaryKey().defaultRandom(),username:$i({length:16}).notNull(),email:$i({length:254}).notNull(),hash:$i({length:64}).notNull(),salt:$i({length:36}).notNull(),createdAt:Jo({withTimezone:!0}).notNull().defaultNow(),createdIp:$i({length:45}).notNull(),isActive:_x().notNull().default(!1),verifiedAt:Jo({withTimezone:!0}),userRole:CR().default("user")},(n)=>[$0("usernameUniqueIndex").on(DR(n.username)),$0("emailUniqueIndex").on(DR(n.email))]),jG=["id","createdAt","createdIp","isActive","salt","verifiedAt"],hR=["username","email","hash","userRole"],IR=Pm("trackedUserColumnName",hR),BG=fc("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ko.id),changedAt:Jo({withTimezone:!0}).notNull().defaultNow(),changedIp:$i({length:45}).notNull(),changedColumn:IR().notNull(),oldValue:$i({length:255}),newValue:$i({length:255})}),lf=fc("games",{id:Ni().primaryKey().defaultRandom()}),A0=fc("players",{userId:Ni().notNull().references(()=>Ko.id),gameId:Ni().notNull().references(()=>lf.id),score:xa().notNull()},(n)=>[iA({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),ix=fc("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>Ko.id),loginTime:Jo({withTimezone:!0}).notNull().defaultNow(),ipAddress:$i({length:45}).notNull(),userAgent:$i({length:1024}),successful:_x().notNull().default(!1)}),kR=Pm("twoFactorMethod",["email","phone"]),yG=fc("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ko.id),requestedIp:$i({length:45}).notNull(),requestedAt:Jo({withTimezone:!0}).notNull().defaultNow(),succeededIp:$i({length:45}),succeededAt:Jo({withTimezone:!0}),verificationMethod:kR().notNull()}),$f=fc("banishedIps",{ip:$i({length:45}).primaryKey(),reason:$i({length:2048}).notNull(),banishedAt:Jo({withTimezone:!0}).notNull().defaultNow(),banishedUntil:Jo({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class F0{options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(LG.resolve(__dirname,"notify_update.sql"));let n=[di(Ko),di(lf),di(A0)];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],x=`${c}("${p}")`;if(this.observers.has(x))this.observers.get(x).next(x)})}constructor(n=!1,i={host:tn.POSTGRES_HOST,port:tn.POSTGRES_PORT,user:tn.POSTGRES_USER,password:tn.POSTGRES_PASSWORD,database:tn.POSTGRES_DATABASE}){this.options=i,this.sql=dp(i),this.drizzle=ff(this.sql,{schema:S0,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new mn);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as NG}from"crypto";function M0(n){let i=NG("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 sR=["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 DG=3,CG=15,hG=/^[a-zA-Z0-9_-]+$/,PR=Kn.string().min(DG).max(CG).regex(hG),ZR=20,qR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function IG(n){let i="";for(let o of n)if(o in qR)i+=qR[o];else i+=o;return i}function kG(n){let i=n.toLocaleLowerCase(),o=IG(i);for(let c of sR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function sG(n){let i=new Set(n).size;return n.length*Math.log2(i)}function ZG(n){let i=0,o=100;if(kG(n))i-=o;return i+=sG(n)*0.5,Math.max(i,0)}var tR=Kn.string().refine((n)=>{return ZG(n)>=ZR},{message:`Password does not meet the minimum complexity of ${ZR}.`}).brand("password"),rR=Kn.object({username:PR,password:tR}).strict(),qG=Kn.string().email().brand("email"),gR=Kn.object({username:PR,password:tR,email:qG}).strict();var vf={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"},R0=V0(vf).map(([n])=>Kn.literal(Number(n))),PG=Kn.union([R0[0],R0[1],...R0]),dR=Kn.tuple([PG,Kn.string()]);var eR=nc({key:"count",default:0}),tG=Gc({key:"incrementTX",do:({set:n})=>{n(eR,(i)=>i+1)}}),n4=Jv({key:"countContinuity",config:(n)=>n.add(eR).add(tG)});var o4=y$(Mc,"backend.worker.game.bun",$n),rc=new F0({logQuery(n,i){$n.info("\uD83D\uDCDD query",n,i)}});on.STORE.loggers[0]=new Kc("info",void 0,$n);var HI=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new c4.CronJob("00 15 * * * *",()=>{y$(Mc,"backend.worker.tribunal.bun",$n)}),n.start(),process.on("exit",()=>{n.stop(),$n.info("\u231B tribunal daily cronjob stopped")}),$n.info("\u23F3 tribunal daily cronjob started");return n})();function dG(n){if(B$)return gG(B$,n);return rG({},n)}var p4=dG((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 x=new Date,m=new URL(n.url,tn.VITE_BACKEND_ORIGIN);$n.info(x,p,n.method,m.pathname);let a=await rc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Qo($f.ip,p)}),f=a?.banishedUntil===null,l=a?.banishedUntil&&a.banishedUntil>x;if(f||l){$n.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-${M0("sign-up")}`:{let $=Buffer.concat(o).toString(),v=JSON.parse($),T=gR.safeParse(v);if(!T.success){$n.warn("signup parsed",T.error.issues);return}let{username:F,password:R,email:S}=T.data;if($n.info(`\uD83D\uDD11 attempting to sign up: ${F}`),await rc.drizzle.query.users.findFirst({columns:{id:!0},where:Qo(Ko.email,S)}))throw[400,"User already exists"];let G=crypto.randomUUID(),H=i4("sha256").update(R+G).digest("hex");await rc.drizzle.insert(Ko).values({username:F,email:S,hash:H,salt:G,createdIp:p}),$n.info(`\uD83D\uDD11 user created: ${F}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end(vf[201])}break;case`/login-${M0("login")}`:{let $=!1,v=null;try{let T=new Date(+x-600000);$n.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:T,now:x});let F=await rc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Vc(Qo(ix.ipAddress,p),Qo(ix.successful,!1),ia(ix.loginTime,T)),limit:10});$n.info(`\uD83D\uDD11 ${F.length}/10 recent failed logins from ${p}`);let R=10-F.length;if(R<1)throw $n.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await rc.drizzle.insert($f).values({ip:p,reason:"Too many recent login attempts.",banishedAt:x,banishedUntil:new Date(+x+86400000)}),[429,"Too many recent login attempts."];let S=Buffer.concat(o).toString(),M=JSON.parse(S),G=rR.safeParse(M);if(!G.success)throw $n.warn("login parsed",G.error.issues),[400,`${R} attempts remaining.`];let{username:H,password:y}=G.data,k=await rc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Qo(Ko.username,H)});if($n.info("\uD83D\uDD11 login attempt as user",H),!k)throw $n.info(`\uD83D\uDD11 user ${H} does not exist`),[400,`${R} attempts remaining.`];let{hash:Y,salt:K}=k;if(v=k.id,i4("sha256").update(y+K).digest("hex")===Y){let u=crypto.randomUUID(),V=sa.get(H);if(!V)V=new Map,sa.set(H,V);V.set(u,Number(x)),$=!0,$n.info("\uD83D\uDD11 login successful as",H),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end(`${H} ${u}`)}}finally{await rc.drizzle.insert(ix).values({userId:v,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),$n.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}}}}catch(p){let x=dR.safeParse(p);if(x.success){let[m,a]=x.data,l=`${vf[m]}. ${a}`;$n.info(`\u274C ${m}: ${l}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end(l)}else $n.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${tn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),W0=p4.listen(tn.BACKEND_PORT).address(),eG=typeof W0==="string"?null:W0===null?null:W0.port;if(eG===null)throw new Error("Could not determine port for test server");new gM(p4,{cors:{origin:tn.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}`,x=`socket::${n.id}`;if(sa.get(o)?.has(c)){let a=Tn(on.STORE,zm,x);Yn(on.STORE,a,n),Wc(Yc,(f)=>{f.set(p,x)},on.STORE),Yn(on.STORE,hf,(f)=>f.add(p)),Yn(on.STORE,Cf,(f)=>f.add(x)),$n.info(`${o} connected on ${n.id}`),i()}else $n.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=Kv({socket:n,store:on.STORE})(n4);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=op(Yc,c,on.STORE).userKeyOfSocket,x=An(on.STORE,p);if(Wc(Yc,(m)=>{m.delete(c)},on.STORE),x)Yn(on.STORE,hf,(m)=>(m.delete(x),m));Yn(on.STORE,Cf,(m)=>(m.delete(c),m)),$n.info(`${n.id} disconnected`),o()})});async function Tf(){$n.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>o4.process.once("close",i));o4.process.emit("timeToStop"),await n,$n.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{$n.info("\u2757 received SIGINT; exiting gracefully"),await Tf()});process.on("SIGTERM",async()=>{$n.info("\u2757 received SIGTERM; exiting gracefully"),await Tf()});process.on("exit",async()=>{$n.info("\u2757 received exit; exiting gracefully"),await Tf()});Mc.on("updatesReady",()=>{$n.info('\u2757 backend server received signal "updatesReady"'),Mc.emit("readyToUpdate"),$n.info('\u2757 backend server has sent signal "readyToUpdate"; now awaits signal "timeToStop"'),Mc.on("timeToStop",async()=>{$n.info('\u2757 backend server received signal "timeToStop"; exiting gracefully'),await Tf()})});$n.info(`\uD83D\uDEEB backend server ready on port ${tn.BACKEND_PORT}`);Mc.emit("alive");export{HI as tribunalDaily};