pocketbase/ui/dist/assets/autocomplete.worker-gXCJZNf...

5 lines
89 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){"use strict";class Y extends Error{}class Zn extends Y{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Un extends Y{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class qn extends Y{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class K extends Y{}class ot extends Y{constructor(e){super(`Invalid unit ${e}`)}}class M extends Y{}class U extends Y{constructor(){super("Zone is an abstract class")}}const f="numeric",W="short",F="long",pe={year:f,month:f,day:f},ut={year:f,month:W,day:f},zn={year:f,month:W,day:f,weekday:W},lt={year:f,month:F,day:f},ct={year:f,month:F,day:f,weekday:F},ft={hour:f,minute:f},dt={hour:f,minute:f,second:f},ht={hour:f,minute:f,second:f,timeZoneName:W},mt={hour:f,minute:f,second:f,timeZoneName:F},yt={hour:f,minute:f,hourCycle:"h23"},gt={hour:f,minute:f,second:f,hourCycle:"h23"},pt={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:W},wt={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:F},St={year:f,month:f,day:f,hour:f,minute:f},kt={year:f,month:f,day:f,hour:f,minute:f,second:f},Tt={year:f,month:W,day:f,hour:f,minute:f},Ot={year:f,month:W,day:f,hour:f,minute:f,second:f},Pn={year:f,month:W,day:f,weekday:W,hour:f,minute:f},Nt={year:f,month:F,day:f,hour:f,minute:f,timeZoneName:W},Et={year:f,month:F,day:f,hour:f,minute:f,second:f,timeZoneName:W},xt={year:f,month:F,day:f,weekday:F,hour:f,minute:f,timeZoneName:F},bt={year:f,month:F,day:f,weekday:F,hour:f,minute:f,second:f,timeZoneName:F};class ae{get type(){throw new U}get name(){throw new U}get ianaName(){return this.name}get isUniversal(){throw new U}offsetName(e,t){throw new U}formatOffset(e,t){throw new U}offset(e){throw new U}equals(e){throw new U}get isValid(){throw new U}}let We=null;class we extends ae{static get instance(){return We===null&&(We=new we),We}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Ht(e,t,n)}formatOffset(e,t){return ce(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Se={};function Yn(s){return Se[s]||(Se[s]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Se[s]}const Jn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Bn(s,e){const t=s.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,r,i,a,o,u,l,c]=n;return[a,r,i,o,u,l,c]}function jn(s,e){const t=s.formatToParts(e),n=[];for(let r=0;r<t.length;r++){const{type:i,value:a}=t[r],o=Jn[i];i==="era"?n[o]=a:y(o)||(n[o]=parseInt(a,10))}return n}let ke={};class Z extends ae{static create(e){return ke[e]||(ke[e]=new Z(e)),ke[e]}static resetCache(){ke={},Se={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=Z.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Ht(e,t,n,this.name)}formatOffset(e,t){return ce(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=Yn(this.name);let[r,i,a,o,u,l,c]=n.formatToParts?jn(n,t):Bn(n,t);o==="BC"&&(r=-Math.abs(r)+1);const p=xe({year:r,month:i,day:a,hour:u===24?0:u,minute:l,second:c,millisecond:0});let m=+t;const E=m%1e3;return m-=E>=0?E:1e3+E,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let It={};function Gn(s,e={}){const t=JSON.stringify([s,e]);let n=It[t];return n||(n=new Intl.ListFormat(s,e),It[t]=n),n}let Le={};function Re(s,e={}){const t=JSON.stringify([s,e]);let n=Le[t];return n||(n=new Intl.DateTimeFormat(s,e),Le[t]=n),n}let $e={};function Kn(s,e={}){const t=JSON.stringify([s,e]);let n=$e[t];return n||(n=new Intl.NumberFormat(s,e),$e[t]=n),n}let Ze={};function Hn(s,e={}){const{base:t,...n}=e,r=JSON.stringify([s,n]);let i=Ze[r];return i||(i=new Intl.RelativeTimeFormat(s,e),Ze[r]=i),i}let oe=null;function _n(){return oe||(oe=new Intl.DateTimeFormat().resolvedOptions().locale,oe)}let vt={};function Qn(s){let e=vt[s];if(!e){const t=new Intl.Locale(s);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,vt[s]=e}return e}function Xn(s){const e=s.indexOf("-x-");e!==-1&&(s=s.substring(0,e));const t=s.indexOf("-u-");if(t===-1)return[s];{let n,r;try{n=Re(s).resolvedOptions(),r=s}catch{const u=s.substring(0,t);n=Re(u).resolvedOptions(),r=u}const{numberingSystem:i,calendar:a}=n;return[r,i,a]}}function es(s,e,t){return(t||e)&&(s.includes("-u-")||(s+="-u"),t&&(s+=`-ca-${t}`),e&&(s+=`-nu-${e}`)),s}function ts(s){const e=[];for(let t=1;t<=12;t++){const n=g.utc(2009,t,1);e.push(s(n))}return e}function ns(s){const e=[];for(let t=1;t<=7;t++){const n=g.utc(2016,11,13+t);e.push(s(n))}return e}function Te(s,e,t,n){const r=s.listingMode();return r==="error"?null:r==="en"?t(e):n(e)}function ss(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||new Intl.DateTimeFormat(s.intl).resolvedOptions().numberingSystem==="latn"}class rs{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){const o={useGrouping:!1,...n};n.padTo>0&&(o.minimumIntegerDigits=n.padTo),this.inf=Kn(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Be(e,3);return I(t,this.padTo)}}}class is{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&Z.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Re(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:n}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class as{constructor(e,t,n){this.opts={style:"long",...n},!t&&Bt()&&(this.rtf=Hn(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):bs(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const os={firstDay:1,minimalDays:4,weekend:[6,7]};class O{static fromOpts(e){return O.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,i=!1){const a=e||b.defaultLocale,o=a||(i?"en-US":_n()),u=t||b.defaultNumberingSystem,l=n||b.defaultOutputCalendar,c=Ye(r)||b.defaultWeekSettings;return new O(o,u,l,c,a)}static resetCache(){oe=null,Le={},$e={},Ze={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return O.create(e,t,n,r)}constructor(e,t,n,r,i){const[a,o,u]=Xn(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||u||null,this.weekSettings=r,this.intl=es(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ss(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:O.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Ye(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Te(this,e,Xt,()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=ts(i=>this.extract(i,n,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1){return Te(this,e,nn,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=ns(i=>this.extract(i,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return Te(this,void 0,()=>sn,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[g.utc(2016,11,13,9),g.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Te(this,e,rn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[g.utc(-40,1,1),g.utc(2017,1,1)].map(n=>this.extract(n,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t),i=r.formatToParts(),a=i.find(o=>o.type.toLowerCase()===n);return a?a.value:null}numberFormatter(e={}){return new rs(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new is(e,this.intl,t)}relFormatter(e={}){return new as(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Gn(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:jt()?Qn(this.locale):os}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let Ue=null;class D extends ae{static get utcInstance(){return Ue===null&&(Ue=new D(0)),Ue}static instance(e){return e===0?D.utcInstance:new D(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new D(be(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ce(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ce(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ce(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class us extends ae{constructor(e){super(),this.zoneName=e}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 q(s,e){if(y(s)||s===null)return e;if(s instanceof ae)return s;if(fs(s)){const t=s.toLowerCase();return t==="default"?e:t==="local"||t==="system"?we.instance:t==="utc"||t==="gmt"?D.utcInstance:D.parseSpecifier(t)||Z.create(s)}else return J(s)?D.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new us(s)}let Dt=()=>Date.now(),Mt="system",Ft=null,At=null,Vt=null,Ct=60,Wt,Lt=null;class b{static get now(){return Dt}static set now(e){Dt=e}static set defaultZone(e){Mt=e}static get defaultZone(){return q(Mt,we.instance)}static get defaultLocale(){return Ft}static set defaultLocale(e){Ft=e}static get defaultNumberingSystem(){return At}static set defaultNumberingSystem(e){At=e}static get defaultOutputCalendar(){return Vt}static set defaultOutputCalendar(e){Vt=e}static get defaultWeekSettings(){return Lt}static set defaultWeekSettings(e){Lt=Ye(e)}static get twoDigitCutoffYear(){return Ct}static set twoDigitCutoffYear(e){Ct=e%100}static get throwOnInvalid(){return Wt}static set throwOnInvalid(e){Wt=e}static resetCaches(){O.resetCache(),Z.resetCache()}}class L{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Rt=[0,31,59,90,120,151,181,212,243,273,304,334],$t=[0,31,60,91,121,152,182,213,244,274,305,335];function A(s,e){return new L("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${s}, which is invalid`)}function qe(s,e,t){const n=new Date(Date.UTC(s,e-1,t));s<100&&s>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const r=n.getUTCDay();return r===0?7:r}function Zt(s,e,t){return t+(ue(s)?$t:Rt)[e-1]}function Ut(s,e){const t=ue(s)?$t:Rt,n=t.findIndex(i=>i<e),r=e-t[n];return{month:n+1,day:r}}function ze(s,e){return(s-e+7)%7+1}function Oe(s,e=4,t=1){const{year:n,month:r,day:i}=s,a=Zt(n,r,i),o=ze(qe(n,r,i),t);let u=Math.floor((a-o+14-e)/7),l;return u<1?(l=n-1,u=le(l,e,t)):u>le(n,e,t)?(l=n+1,u=1):l=n,{weekYear:l,weekNumber:u,weekday:o,...ve(s)}}function qt(s,e=4,t=1){const{weekYear:n,weekNumber:r,weekday:i}=s,a=ze(qe(n,1,e),t),o=_(n);let u=r*7+i-a-7+e,l;u<1?(l=n-1,u+=_(l)):u>o?(l=n+1,u-=_(n)):l=n;const{month:c,day:h}=Ut(l,u);return{year:l,month:c,day:h,...ve(s)}}function Pe(s){const{year:e,month:t,day:n}=s,r=Zt(e,t,n);return{year:e,ordinal:r,...ve(s)}}function zt(s){const{year:e,ordinal:t}=s,{month:n,day:r}=Ut(e,t);return{year:e,month:n,day:r,...ve(s)}}function Pt(s,e){if(!y(s.localWeekday)||!y(s.localWeekNumber)||!y(s.localWeekYear)){if(!y(s.weekday)||!y(s.weekNumber)||!y(s.weekYear))throw new K("Cannot mix locale-based week fields with ISO-based week fields");return y(s.localWeekday)||(s.weekday=s.localWeekday),y(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),y(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ls(s,e=4,t=1){const n=Ne(s.weekYear),r=V(s.weekNumber,1,le(s.weekYear,e,t)),i=V(s.weekday,1,7);return n?r?i?!1:A("weekday",s.weekday):A("week",s.weekNumber):A("weekYear",s.weekYear)}function cs(s){const e=Ne(s.year),t=V(s.ordinal,1,_(s.year));return e?t?!1:A("ordinal",s.ordinal):A("year",s.year)}function Yt(s){const e=Ne(s.year),t=V(s.month,1,12),n=V(s.day,1,Ee(s.year,s.month));return e?t?n?!1:A("day",s.day):A("month",s.month):A("year",s.year)}function Jt(s){const{hour:e,minute:t,second:n,millisecond:r}=s,i=V(e,0,23)||e===24&&t===0&&n===0&&r===0,a=V(t,0,59),o=V(n,0,59),u=V(r,0,999);return i?a?o?u?!1:A("millisecond",r):A("second",n):A("minute",t):A("hour",e)}function y(s){return typeof s>"u"}function J(s){return typeof s=="number"}function Ne(s){return typeof s=="number"&&s%1===0}function fs(s){return typeof s=="string"}function ds(s){return Object.prototype.toString.call(s)==="[object Date]"}function Bt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function jt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function hs(s){return Array.isArray(s)?s:[s]}function Gt(s,e,t){if(s.length!==0)return s.reduce((n,r)=>{const i=[e(r),r];return n&&t(n[0],i[0])===n[0]?n:i},null)[1]}function ms(s,e){return e.reduce((t,n)=>(t[n]=s[n],t),{})}function H(s,e){return Object.prototype.hasOwnProperty.call(s,e)}function Ye(s){if(s==null)return null;if(typeof s!="object")throw new M("Week settings must be an object");if(!V(s.firstDay,1,7)||!V(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(e=>!V(e,1,7)))throw new M("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function V(s,e,t){return Ne(s)&&s>=e&&s<=t}function ys(s,e){return s-e*Math.floor(s/e)}function I(s,e=2){const t=s<0;let n;return t?n="-"+(""+-s).padStart(e,"0"):n=(""+s).padStart(e,"0"),n}function z(s){if(!(y(s)||s===null||s===""))return parseInt(s,10)}function B(s){if(!(y(s)||s===null||s===""))return parseFloat(s)}function Je(s){if(!(y(s)||s===null||s==="")){const e=parseFloat("0."+s)*1e3;return Math.floor(e)}}function Be(s,e,t=!1){const n=10**e;return(t?Math.trunc:Math.round)(s*n)/n}function ue(s){return s%4===0&&(s%100!==0||s%400===0)}function _(s){return ue(s)?366:365}function Ee(s,e){const t=ys(e-1,12)+1,n=s+(e-t)/12;return t===2?ue(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function xe(s){let e=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(e=new Date(e),e.setUTCFullYear(s.year,s.month-1,s.day)),+e}function Kt(s,e,t){return-ze(qe(s,1,e),t)+e-1}function le(s,e=4,t=1){const n=Kt(s,e,t),r=Kt(s+1,e,t);return(_(s)-n+r)/7}function je(s){return s>99?s:s>b.twoDigitCutoffYear?1900+s:2e3+s}function Ht(s,e,t,n=null){const r=new Date(s),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(i.timeZone=n);const a={timeZoneName:e,...i},o=new Intl.DateTimeFormat(t,a).formatToParts(r).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function be(s,e){let t=parseInt(s,10);Number.isNaN(t)&&(t=0);const n=parseInt(e,10)||0,r=t<0||Object.is(t,-0)?-n:n;return t*60+r}function _t(s){const e=Number(s);if(typeof s=="boolean"||s===""||Number.isNaN(e))throw new M(`Invalid unit value ${s}`);return e}function Ie(s,e){const t={};for(const n in s)if(H(s,n)){const r=s[n];if(r==null)continue;t[e(n)]=_t(r)}return t}function ce(s,e){const t=Math.trunc(Math.abs(s/60)),n=Math.trunc(Math.abs(s%60)),r=s>=0?"+":"-";switch(e){case"short":return`${r}${I(t,2)}:${I(n,2)}`;case"narrow":return`${r}${t}${n>0?`:${n}`:""}`;case"techie":return`${r}${I(t,2)}${I(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function ve(s){return ms(s,["hour","minute","second","millisecond"])}const gs=["January","February","March","April","May","June","July","August","September","October","November","December"],Qt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ps=["J","F","M","A","M","J","J","A","S","O","N","D"];function Xt(s){switch(s){case"narrow":return[...ps];case"short":return[...Qt];case"long":return[...gs];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}}const en=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],tn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ws=["M","T","W","T","F","S","S"];function nn(s){switch(s){case"narrow":return[...ws];case"short":return[...tn];case"long":return[...en];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const sn=["AM","PM"],Ss=["Before Christ","Anno Domini"],ks=["BC","AD"],Ts=["B","A"];function rn(s){switch(s){case"narrow":return[...Ts];case"short":return[...ks];case"long":return[...Ss];default:return null}}function Os(s){return sn[s.hour<12?0:1]}function Ns(s,e){return nn(e)[s.weekday-1]}function Es(s,e){return Xt(e)[s.month-1]}function xs(s,e){return rn(e)[s.year<0?0:1]}function bs(s,e,t="always",n=!1){const r={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."]},i=["hours","minutes","seconds"].indexOf(s)===-1;if(t==="auto"&&i){const h=s==="days";switch(e){case 1:return h?"tomorrow":`next ${r[s][0]}`;case-1:return h?"yesterday":`last ${r[s][0]}`;case 0:return h?"today":`this ${r[s][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=r[s],c=n?u?l[1]:l[2]||l[1]:u?r[s][0]:s;return a?`${o} ${c} ago`:`in ${o} ${c}`}function an(s,e){let t="";for(const n of s)n.literal?t+=n.val:t+=e(n.val);return t}const Is={D:pe,DD:ut,DDD:lt,DDDD:ct,t:ft,tt:dt,ttt:ht,tttt:mt,T:yt,TT:gt,TTT:pt,TTTT:wt,f:St,ff:Tt,fff:Nt,ffff:xt,F:kt,FF:Ot,FFF:Et,FFFF:bt};class v{static create(e,t={}){return new v(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let a=0;a<e.length;a++){const o=e.charAt(a);o==="'"?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return Is[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return I(e,t);const n={...this.opts};return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,E)=>this.loc.extract(e,m,E),a=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>n?Os(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,E)=>n?Es(e,m):i(E?{month:m}:{month:m,day:"numeric"},"month"),l=(m,E)=>n?Ns(e,m):i(E?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{const E=v.macroTokenToFormatOpts(m);return E?this.formatWithSystemDefault(e,E):m},h=m=>n?xs(e,m):i({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return an(v.parseFormat(t),p)}formatDurationFromString(e,t){const n=u=>{switch(u[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}},r=u=>l=>{const c=n(l);return c?this.num(u.get(c),l.length):l},i=v.parseFormat(t),a=i.reduce((u,{literal:l,val:c})=>l?u:u.concat(c),[]),o=e.shiftTo(...a.map(n).filter(u=>u));return an(i,r(o))}}const on=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Q(...s){const e=s.reduce((t,n)=>t+n.source,"");return RegExp(`^${e}$`)}function X(...s){return e=>s.reduce(([t,n,r],i)=>{const[a,o,u]=i(e,r);return[{...t,...a},o||n,u]},[{},null,1]).slice(0,2)}function ee(s,...e){if(s==null)return[null,null];for(const[t,n]of e){const r=t.exec(s);if(r)return n(r)}return[null,null]}function un(...s){return(e,t)=>{const n={};let r;for(r=0;r<s.length;r++)n[s[r]]=z(e[t+r]);return[n,null,t+r]}}const ln=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,vs=`(?:${ln.source}?(?:\\[(${on.source})\\])?)?`,Ge=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,cn=RegExp(`${Ge.source}${vs}`),Ke=RegExp(`(?:T${cn.source})?`),Ds=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ms=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Fs=/(\d{4})-?(\d{3})/,As=un("weekYear","weekNumber","weekDay"),Vs=un("year","ordinal"),Cs=/(\d{4})-(\d\d)-(\d\d)/,fn=RegExp(`${Ge.source} ?(?:${ln.source}|(${on.source}))?`),Ws=RegExp(`(?: ${fn.source})?`);function te(s,e,t){const n=s[e];return y(n)?t:z(n)}function Ls(s,e){return[{year:te(s,e),month:te(s,e+1,1),day:te(s,e+2,1)},null,e+3]}function ne(s,e){return[{hours:te(s,e,0),minutes:te(s,e+1,0),seconds:te(s,e+2,0),milliseconds:Je(s[e+3])},null,e+4]}function fe(s,e){const t=!s[e]&&!s[e+1],n=be(s[e+1],s[e+2]),r=t?null:D.instance(n);return[{},r,e+3]}function de(s,e){const t=s[e]?Z.create(s[e]):null;return[{},t,e+1]}const Rs=RegExp(`^T?${Ge.source}$`),$s=/^-?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 Zs(s){const[e,t,n,r,i,a,o,u,l]=s,c=e[0]==="-",h=u&&u[0]==="-",p=(m,E=!1)=>m!==void 0&&(E||m&&c)?-m:m;return[{years:p(B(t)),months:p(B(n)),weeks:p(B(r)),days:p(B(i)),hours:p(B(a)),minutes:p(B(o)),seconds:p(B(u),u==="-0"),milliseconds:p(Je(l),h)}]}const Us={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function He(s,e,t,n,r,i,a){const o={year:e.length===2?je(z(e)):z(e),month:Qt.indexOf(t)+1,day:z(n),hour:z(r),minute:z(i)};return a&&(o.second=z(a)),s&&(o.weekday=s.length>3?en.indexOf(s)+1:tn.indexOf(s)+1),o}const qs=/^(?:(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 zs(s){const[,e,t,n,r,i,a,o,u,l,c,h]=s,p=He(e,r,n,t,i,a,o);let m;return u?m=Us[u]:l?m=0:m=be(c,h),[p,new D(m)]}function Ps(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ys=/^(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$/,Js=/^(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$/,Bs=/^(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 dn(s){const[,e,t,n,r,i,a,o]=s;return[He(e,r,n,t,i,a,o),D.utcInstance]}function js(s){const[,e,t,n,r,i,a,o]=s;return[He(e,o,t,n,r,i,a),D.utcInstance]}const Gs=Q(Ds,Ke),Ks=Q(Ms,Ke),Hs=Q(Fs,Ke),_s=Q(cn),hn=X(Ls,ne,fe,de),Qs=X(As,ne,fe,de),Xs=X(Vs,ne,fe,de),er=X(ne,fe,de);function tr(s){return ee(s,[Gs,hn],[Ks,Qs],[Hs,Xs],[_s,er])}function nr(s){return ee(Ps(s),[qs,zs])}function sr(s){return ee(s,[Ys,dn],[Js,dn],[Bs,js])}function rr(s){return ee(s,[$s,Zs])}const ir=X(ne);function ar(s){return ee(s,[Rs,ir])}const or=Q(Cs,Ws),ur=Q(fn),lr=X(ne,fe,de);function cr(s){return ee(s,[or,hn],[ur,lr])}const mn="Invalid Duration",yn={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},fr={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...yn},C=146097/400,se=146097/4800,dr={years:{quarters:4,months:12,weeks:C/7,days:C,hours:C*24,minutes:C*24*60,seconds:C*24*60*60,milliseconds:C*24*60*60*1e3},quarters:{months:3,weeks:C/28,days:C/4,hours:C*24/4,minutes:C*24*60/4,seconds:C*24*60*60/4,milliseconds:C*24*60*60*1e3/4},months:{weeks:se/7,days:se,hours:se*24,minutes:se*24*60,seconds:se*24*60*60,milliseconds:se*24*60*60*1e3},...yn},j=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],hr=j.slice(0).reverse();function P(s,e,t=!1){const n={values:t?e.values:{...s.values,...e.values||{}},loc:s.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||s.conversionAccuracy,matrix:e.matrix||s.matrix};return new w(n)}function gn(s,e){let t=e.milliseconds??0;for(const n of hr.slice(1))e[n]&&(t+=e[n]*s[n].milliseconds);return t}function pn(s,e){const t=gn(s,e)<0?-1:1;j.reduceRight((n,r)=>{if(y(e[r]))return n;if(n){const i=e[n]*t,a=s[r][n],o=Math.floor(i/a);e[r]+=o*t,e[n]-=o*a*t}return r},null),j.reduce((n,r)=>{if(y(e[r]))return n;if(n){const i=e[n]%1;e[n]-=i,e[r]+=i*s[n][r]}return r},null)}function mr(s){const e={};for(const[t,n]of Object.entries(s))n!==0&&(e[t]=n);return e}class w{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let n=t?dr:fr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||O.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return w.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new M(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new w({values:Ie(e,w.normalizeUnit),loc:O.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(J(e))return w.fromMillis(e);if(w.isDuration(e))return e;if(typeof e=="object")return w.fromObject(e);throw new M(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=rr(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=ar(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new M("need to specify a reason the Duration is invalid");const n=e instanceof L?e:new L(e,t);if(b.throwOnInvalid)throw new qn(n);return new w({invalid:n})}static normalizeUnit(e){const t={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"}[e&&e.toLowerCase()];if(!t)throw new ot(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?v.create(this.loc,n).formatDurationFromString(this,e):mn}toHuman(e={}){if(!this.isValid)return mn;const t=j.map(n=>{const r=this.values[n];return y(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Be(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},g.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?gn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e),n={};for(const r of j)(H(t.values,r)||H(this.values,r))&&(n[r]=t.get(r)+this.get(r));return P(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=_t(e(this.values[n],n));return P(this,{values:t},!0)}get(e){return this[w.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...Ie(e,w.normalizeUnit)};return P(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return P(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return pn(this.matrix,e),P(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=mr(this.normalize().shiftToAll().toObject());return P(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>w.normalizeUnit(a));const t={},n={},r=this.toObject();let i;for(const a of j)if(e.indexOf(a)>=0){i=a;let o=0;for(const l in n)o+=this.matrix[l][a]*n[l],n[l]=0;J(r[a])&&(o+=r[a]);const u=Math.trunc(o);t[a]=u,n[a]=(o*1e3-u*1e3)/1e3}else J(r[a])&&(n[a]=r[a]);for(const a in n)n[a]!==0&&(t[i]+=a===i?n[a]:n[a]/this.matrix[i][a]);return pn(this.matrix,t),P(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return P(this,{values:e},!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(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(n,r){return n===void 0||n===0?r===void 0||r===0:n===r}for(const n of j)if(!t(this.values[n],e.values[n]))return!1;return!0}}const re="Invalid Interval";function yr(s,e){return!s||!s.isValid?x.invalid("missing or invalid start"):!e||!e.isValid?x.invalid("missing or invalid end"):e<s?x.invalid("end before start",`The end of an interval must be after its start, but you had start=${s.toISO()} and end=${e.toISO()}`):null}class x{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new M("need to specify a reason the Interval is invalid");const n=e instanceof L?e:new L(e,t);if(b.throwOnInvalid)throw new Un(n);return new x({invalid:n})}static fromDateTimes(e,t){const n=me(e),r=me(t),i=yr(n,r);return i??new x({start:n,end:r})}static after(e,t){const n=w.fromDurationLike(t),r=me(e);return x.fromDateTimes(r,r.plus(n))}static before(e,t){const n=w.fromDurationLike(t),r=me(e);return x.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){let i,a;try{i=g.fromISO(n,t),a=i.isValid}catch{a=!1}let o,u;try{o=g.fromISO(r,t),u=o.isValid}catch{u=!1}if(a&&u)return x.fromDateTimes(i,o);if(a){const l=w.fromISO(r,t);if(l.isValid)return x.after(i,l)}else if(u){const l=w.fromISO(n,t);if(l.isValid)return x.before(o,l)}}return x.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.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(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const n=this.start.startOf(e,t);let r;return t!=null&&t.useLocaleWeeks?r=this.end.reconfigure({locale:n.locale}):r=this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?x.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(me).filter(a=>this.contains(a)).sort((a,o)=>a.toMillis()-o.toMillis()),n=[];let{s:r}=this,i=0;for(;r<this.e;){const a=t[i]||this.e,o=+a>+this.e?this.e:a;n.push(x.fromDateTimes(r,o)),r=o,i+=1}return n}splitBy(e){const t=w.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:n}=this,r=1,i;const a=[];for(;n<this.e;){const o=this.start.plus(t.mapUnits(u=>u*r));i=+o>+this.e?this.e:o,a.push(x.fromDateTimes(n,i)),n=i,r+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>=n?null:x.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return x.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((r,i)=>r.s-i.s).reduce(([r,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[r,i.union(a)]:[r.concat([i]),a]:[r,a],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)n+=u.type==="s"?1:-1,n===1?t=u.time:(t&&+t!=+u.time&&r.push(x.fromDateTimes(t,u.time)),t=null);return x.merge(r)}difference(...e){return x.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:re}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=pe,t={}){return this.isValid?v.create(this.s.loc.clone(t),e).formatInterval(this):re}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:re}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:re}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:re}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:re}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):w.invalid(this.invalidReason)}mapEndpoints(e){return x.fromDateTimes(e(this.s),e(this.e))}}class De{static hasDST(e=b.defaultZone){const t=g.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Z.isValidZone(e)}static normalizeZone(e){return q(e,b.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||O.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||O.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||O.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||O.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||O.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||O.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||O.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return O.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return O.create(t,null,"gregory").eras(e)}static features(){return{relative:Bt(),localeWeek:jt()}}}function wn(s,e){const t=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=t(e)-t(s);return Math.floor(w.fromMillis(n).as("days"))}function gr(s,e,t){const n=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{const c=wn(u,l);return(c-c%7)/7}],["days",wn]],r={},i=s;let a,o;for(const[u,l]of n)t.indexOf(u)>=0&&(a=u,r[u]=l(s,e),o=i.plus(r),o>e?(r[u]--,s=i.plus(r),s>e&&(o=s,r[u]--,s=i.plus(r))):s=o);return[s,r,o,a]}function pr(s,e,t,n){let[r,i,a,o]=gr(s,e,t);const u=e-r,l=t.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);l.length===0&&(a<e&&(a=r.plus({[o]:1})),a!==r&&(i[o]=(i[o]||0)+u/(a-r)));const c=w.fromObject(i,n);return l.length>0?w.fromMillis(u,n).shiftTo(...l).plus(c):c}const _e={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},Sn={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]},wr=_e.hanidec.replace(/[\[|\]]/g,"").split("");function Sr(s){let e=parseInt(s,10);if(isNaN(e)){e="";for(let t=0;t<s.length;t++){const n=s.charCodeAt(t);if(s[t].search(_e.hanidec)!==-1)e+=wr.indexOf(s[t]);else for(const r in Sn){const[i,a]=Sn[r];n>=i&&n<=a&&(e+=n-i)}}return parseInt(e,10)}else return e}function R({numberingSystem:s},e=""){return new RegExp(`${_e[s||"latn"]}${e}`)}const kr="missing Intl.DateTimeFormat.formatToParts support";function S(s,e=t=>t){return{regex:s,deser:([t])=>e(Sr(t))}}const kn="[  ]",Tn=new RegExp(kn,"g");function Tr(s){return s.replace(/\./g,"\\.?").replace(Tn,kn)}function On(s){return s.replace(/\./g,"").replace(Tn," ").toLowerCase()}function $(s,e){return s===null?null:{regex:RegExp(s.map(Tr).join("|")),deser:([t])=>s.findIndex(n=>On(t)===On(n))+e}}function Nn(s,e){return{regex:s,deser:([,t,n])=>be(t,n),groups:e}}function Me(s){return{regex:s,deser:([e])=>e}}function Or(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Nr(s,e){const t=R(e),n=R(e,"{2}"),r=R(e,"{3}"),i=R(e,"{4}"),a=R(e,"{6}"),o=R(e,"{1,2}"),u=R(e,"{1,3}"),l=R(e,"{1,6}"),c=R(e,"{1,9}"),h=R(e,"{2,4}"),p=R(e,"{4,6}"),m=T=>({regex:RegExp(Or(T.val)),deser:([ie])=>ie,literal:!0}),N=(T=>{if(s.literal)return m(T);switch(T.val){case"G":return $(e.eras("short"),0);case"GG":return $(e.eras("long"),0);case"y":return S(l);case"yy":return S(h,je);case"yyyy":return S(i);case"yyyyy":return S(p);case"yyyyyy":return S(a);case"M":return S(o);case"MM":return S(n);case"MMM":return $(e.months("short",!0),1);case"MMMM":return $(e.months("long",!0),1);case"L":return S(o);case"LL":return S(n);case"LLL":return $(e.months("short",!1),1);case"LLLL":return $(e.months("long",!1),1);case"d":return S(o);case"dd":return S(n);case"o":return S(u);case"ooo":return S(r);case"HH":return S(n);case"H":return S(o);case"hh":return S(n);case"h":return S(o);case"mm":return S(n);case"m":return S(o);case"q":return S(o);case"qq":return S(n);case"s":return S(o);case"ss":return S(n);case"S":return S(u);case"SSS":return S(r);case"u":return Me(c);case"uu":return Me(o);case"uuu":return S(t);case"a":return $(e.meridiems(),0);case"kkkk":return S(i);case"kk":return S(h,je);case"W":return S(o);case"WW":return S(n);case"E":case"c":return S(t);case"EEE":return $(e.weekdays("short",!1),1);case"EEEE":return $(e.weekdays("long",!1),1);case"ccc":return $(e.weekdays("short",!0),1);case"cccc":return $(e.weekdays("long",!0),1);case"Z":case"ZZ":return Nn(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return Nn(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return Me(/[a-z_+-/]{1,256}?/i);case" ":return Me(/[^\S\n\r]/);default:return m(T)}})(s)||{invalidReason:kr};return N.token=s,N}const Er={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 xr(s,e,t){const{type:n,value:r}=s;if(n==="literal"){const u=/^\s+$/.test(r);return{literal:!u,val:u?" ":r}}const i=e[n];let a=n;n==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=t.hour12?"hour12":"hour24");let o=Er[a];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function br(s){return[`^${s.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,s]}function Ir(s,e,t){const n=s.match(e);if(n){const r={};let i=1;for(const a in t)if(H(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(r[o.token.val[0]]=o.deser(n.slice(i,i+u))),i+=u}return[n,r]}else return[n,{}]}function vr(s){const e=i=>{switch(i){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}};let t=null,n;return y(s.z)||(t=Z.create(s.z)),y(s.Z)||(t||(t=new D(s.Z)),n=s.Z),y(s.q)||(s.M=(s.q-1)*3+1),y(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),y(s.u)||(s.S=Je(s.u)),[Object.keys(s).reduce((i,a)=>{const o=e(a);return o&&(i[o]=s[a]),i},{}),t,n]}let Qe=null;function Dr(){return Qe||(Qe=g.fromMillis(1555555555555)),Qe}function Mr(s,e){if(s.literal)return s;const t=v.macroTokenToFormatOpts(s.val),n=bn(t,e);return n==null||n.includes(void 0)?s:n}function En(s,e){return Array.prototype.concat(...s.map(t=>Mr(t,e)))}function xn(s,e,t){const n=En(v.parseFormat(t),s),r=n.map(a=>Nr(a,s)),i=r.find(a=>a.invalidReason);if(i)return{input:e,tokens:n,invalidReason:i.invalidReason};{const[a,o]=br(r),u=RegExp(a,"i"),[l,c]=Ir(e,u,o),[h,p,m]=c?vr(c):[null,null,void 0];if(H(c,"a")&&H(c,"H"))throw new K("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:u,rawMatches:l,matches:c,result:h,zone:p,specificOffset:m}}}function Fr(s,e,t){const{result:n,zone:r,specificOffset:i,invalidReason:a}=xn(s,e,t);return[n,r,i,a]}function bn(s,e){if(!s)return null;const n=v.create(e,s).dtFormatter(Dr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(a=>xr(a,s,i))}const Xe="Invalid DateTime",In=864e13;function Fe(s){return new L("unsupported zone",`the zone "${s.name}" is not supported`)}function et(s){return s.weekData===null&&(s.weekData=Oe(s.c)),s.weekData}function tt(s){return s.localWeekData===null&&(s.localWeekData=Oe(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function G(s,e){const t={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new g({...t,...e,old:t})}function vn(s,e,t){let n=s-e*60*1e3;const r=t.offset(n);if(e===r)return[n,e];n-=(r-e)*60*1e3;const i=t.offset(n);return r===i?[n,r]:[s-Math.min(r,i)*60*1e3,Math.max(r,i)]}function Ae(s,e){s+=e*60*1e3;const t=new Date(s);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Ve(s,e,t){return vn(xe(s),e,t)}function Dn(s,e){const t=s.o,n=s.c.year+Math.trunc(e.years),r=s.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...s.c,year:n,month:r,day:Math.min(s.c.day,Ee(n,r))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=w.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=xe(i);let[u,l]=vn(o,t,s.zone);return a!==0&&(u+=a,l=s.zone.offset(u)),{ts:u,o:l}}function he(s,e,t,n,r,i){const{setZone:a,zone:o}=t;if(s&&Object.keys(s).length!==0||e){const u=e||o,l=g.fromObject(s,{...t,zone:u,specificOffset:i});return a?l:l.setZone(o)}else return g.invalid(new L("unparsable",`the input "${r}" can't be parsed as ${n}`))}function Ce(s,e,t=!0){return s.isValid?v.create(O.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(s,e):null}function nt(s,e){const t=s.c.year>9999||s.c.year<0;let n="";return t&&s.c.year>=0&&(n+="+"),n+=I(s.c.year,t?6:4),e?(n+="-",n+=I(s.c.month),n+="-",n+=I(s.c.day)):(n+=I(s.c.month),n+=I(s.c.day)),n}function Mn(s,e,t,n,r,i){let a=I(s.c.hour);return e?(a+=":",a+=I(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=":")):a+=I(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=I(s.c.second),(s.c.millisecond!==0||!n)&&(a+=".",a+=I(s.c.millisecond,3))),r&&(s.isOffsetFixed&&s.offset===0&&!i?a+="Z":s.o<0?(a+="-",a+=I(Math.trunc(-s.o/60)),a+=":",a+=I(Math.trunc(-s.o%60))):(a+="+",a+=I(Math.trunc(s.o/60)),a+=":",a+=I(Math.trunc(s.o%60)))),i&&(a+="["+s.zone.ianaName+"]"),a}const Fn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ar={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Vr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},An=["year","month","day","hour","minute","second","millisecond"],Cr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Wr=["year","ordinal","hour","minute","second","millisecond"];function Lr(s){const e={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"}[s.toLowerCase()];if(!e)throw new ot(s);return e}function Vn(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Lr(s)}}function Cn(s,e){const t=q(e.zone,b.defaultZone),n=O.fromObject(e),r=b.now();let i,a;if(y(s.year))i=r;else{for(const l of An)y(s[l])&&(s[l]=Fn[l]);const o=Yt(s)||Jt(s);if(o)return g.invalid(o);const u=t.offset(r);[i,a]=Ve(s,u,t)}return new g({ts:i,zone:t,loc:n,o:a})}function Wn(s,e,t){const n=y(t.round)?!0:t.round,r=(a,o)=>(a=Be(a,n||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(a,o)),i=a=>t.calendary?e.hasSame(s,a)?0:e.startOf(a).diff(s.startOf(a),a).get(a):e.diff(s,a).get(a);if(t.unit)return r(i(t.unit),t.unit);for(const a of t.units){const o=i(a);if(Math.abs(o)>=1)return r(o,a)}return r(s>e?-0:0,t.units[t.units.length-1])}function Ln(s){let e={},t;return s.length>0&&typeof s[s.length-1]=="object"?(e=s[s.length-1],t=Array.from(s).slice(0,s.length-1)):t=Array.from(s),[e,t]}class g{constructor(e){const t=e.zone||b.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new L("invalid input"):null)||(t.isValid?null:Fe(t));this.ts=y(e.ts)?b.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const o=t.offset(this.ts);r=Ae(this.ts,o),n=Number.isNaN(r.year)?new L("invalid input"):null,r=n?null:r,i=n?null:o}this._zone=t,this.loc=e.loc||O.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new g({})}static local(){const[e,t]=Ln(arguments),[n,r,i,a,o,u,l]=t;return Cn({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static utc(){const[e,t]=Ln(arguments),[n,r,i,a,o,u,l]=t;return e.zone=D.utcInstance,Cn({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static fromJSDate(e,t={}){const n=ds(e)?e.valueOf():NaN;if(Number.isNaN(n))return g.invalid("invalid input");const r=q(t.zone,b.defaultZone);return r.isValid?new g({ts:n,zone:r,loc:O.fromObject(t)}):g.invalid(Fe(r))}static fromMillis(e,t={}){if(J(e))return e<-In||e>In?g.invalid("Timestamp out of range"):new g({ts:e,zone:q(t.zone,b.defaultZone),loc:O.fromObject(t)});throw new M(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(J(e))return new g({ts:e*1e3,zone:q(t.zone,b.defaultZone),loc:O.fromObject(t)});throw new M("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=q(t.zone,b.defaultZone);if(!n.isValid)return g.invalid(Fe(n));const r=O.fromObject(t),i=Ie(e,Vn),{minDaysInFirstWeek:a,startOfWeek:o}=Pt(i,r),u=b.now(),l=y(t.specificOffset)?n.offset(u):t.specificOffset,c=!y(i.ordinal),h=!y(i.year),p=!y(i.month)||!y(i.day),m=h||p,E=i.weekYear||i.weekNumber;if((m||c)&&E)throw new K("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new K("Can't mix ordinal dates with month/day");const N=E||i.weekday&&!m;let T,ie,ye=Ae(u,l);N?(T=Cr,ie=Ar,ye=Oe(ye,a,o)):c?(T=Wr,ie=Vr,ye=Pe(ye)):(T=An,ie=Fn);let Rn=!1;for(const ge of T){const Jr=i[ge];y(Jr)?Rn?i[ge]=ie[ge]:i[ge]=ye[ge]:Rn=!0}const qr=N?ls(i,a,o):c?cs(i):Yt(i),$n=qr||Jt(i);if($n)return g.invalid($n);const zr=N?qt(i,a,o):c?zt(i):i,[Pr,Yr]=Ve(zr,l,n),at=new g({ts:Pr,zone:n,o:Yr,loc:r});return i.weekday&&m&&e.weekday!==at.weekday?g.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${at.toISO()}`):at}static fromISO(e,t={}){const[n,r]=tr(e);return he(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=nr(e);return he(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=sr(e);return he(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(y(e)||y(t))throw new M("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,a=O.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[o,u,l,c]=Fr(a,e,t);return c?g.invalid(c):he(o,u,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return g.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=cr(e);return he(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new M("need to specify a reason the DateTime is invalid");const n=e instanceof L?e:new L(e,t);if(b.throwOnInvalid)throw new Zn(n);return new g({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=bn(e,O.fromObject(t));return n?n.map(r=>r?r.val:null).join(""):null}static expandFormat(e,t={}){return En(v.parseFormat(e),O.fromObject(t)).map(r=>r.val).join("")}get(e){return this[e]}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?et(this).weekYear:NaN}get weekNumber(){return this.isValid?et(this).weekNumber:NaN}get weekday(){return this.isValid?et(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?tt(this).weekday:NaN}get localWeekNumber(){return this.isValid?tt(this).weekNumber:NaN}get localWeekYear(){return this.isValid?tt(this).weekYear:NaN}get ordinal(){return this.isValid?Pe(this.c).ordinal:NaN}get monthShort(){return this.isValid?De.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?De.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?De.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?De.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=xe(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];const u=n-a*t,l=n-o*t,c=Ae(u,a),h=Ae(l,o);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[G(this,{ts:u}),G(this,{ts:l})]:[this]}get isInLeapYear(){return ue(this.year)}get daysInMonth(){return Ee(this.year,this.month)}get daysInYear(){return this.isValid?_(this.year):NaN}get weeksInWeekYear(){return this.isValid?le(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?le(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=v.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(D.instance(e),t)}toLocal(){return this.setZone(b.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if(e=q(e,b.defaultZone),e.equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const i=e.offset(this.ts),a=this.toObject();[r]=Ve(a,i,e)}return G(this,{ts:r,zone:e})}else return g.invalid(Fe(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){const r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return G(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Ie(e,Vn),{minDaysInFirstWeek:n,startOfWeek:r}=Pt(t,this.loc),i=!y(t.weekYear)||!y(t.weekNumber)||!y(t.weekday),a=!y(t.ordinal),o=!y(t.year),u=!y(t.month)||!y(t.day),l=o||u,c=t.weekYear||t.weekNumber;if((l||a)&&c)throw new K("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new K("Can't mix ordinal dates with month/day");let h;i?h=qt({...Oe(this.c,n,r),...t},n,r):y(t.ordinal)?(h={...this.toObject(),...t},y(t.day)&&(h.day=Math.min(Ee(h.year,h.month),h.day))):h=zt({...Pe(this.c),...t});const[p,m]=Ve(h,this.o,this.zone);return G(this,{ts:p,o:m})}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e);return G(this,Dn(this,t))}minus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e).negate();return G(this,Dn(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=w.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks")if(t){const i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(n.weekNumber=this.weekNumber-1),n.weekday=i}else n.weekday=1;if(r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?v.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Xe}toLocaleString(e=pe,t={}){return this.isValid?v.create(this.loc.clone(t),e).formatDateTime(this):Xe}toLocaleParts(e={}){return this.isValid?v.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=e==="extended";let o=nt(this,a);return o+="T",o+=Mn(this,a,t,n,r,i),o}toISODate({format:e="extended"}={}){return this.isValid?nt(this,e==="extended"):null}toISOWeekDate(){return Ce(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(r?"T":"")+Mn(this,a==="extended",t,e,n,i):null}toRFC2822(){return Ce(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ce(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?nt(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),Ce(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Xe}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return w.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=hs(t).map(w.normalizeUnit),a=e.valueOf()>this.valueOf(),o=a?this:e,u=a?e:this,l=pr(o,u,i,r);return a?l.negate():l}diffNow(e="milliseconds",t={}){return this.diff(g.now(),e,t)}until(e){return this.isValid?x.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||g.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(r=e.unit,i=void 0),Wn(t,this.plus(n),{...e,numeric:"always",units:r,unit:i})}toRelativeCalendar(e={}){return this.isValid?Wn(e.base||g.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(g.isDateTime))throw new M("min requires all arguments be DateTimes");return Gt(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(g.isDateTime))throw new M("max requires all arguments be DateTimes");return Gt(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n,a=O.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return xn(a,e,t)}static fromStringExplain(e,t,n={}){return g.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return pe}static get DATE_MED(){return ut}static get DATE_MED_WITH_WEEKDAY(){return zn}static get DATE_FULL(){return lt}static get DATE_HUGE(){return ct}static get TIME_SIMPLE(){return ft}static get TIME_WITH_SECONDS(){return dt}static get TIME_WITH_SHORT_OFFSET(){return ht}static get TIME_WITH_LONG_OFFSET(){return mt}static get TIME_24_SIMPLE(){return yt}static get TIME_24_WITH_SECONDS(){return gt}static get TIME_24_WITH_SHORT_OFFSET(){return pt}static get TIME_24_WITH_LONG_OFFSET(){return wt}static get DATETIME_SHORT(){return St}static get DATETIME_SHORT_WITH_SECONDS(){return kt}static get DATETIME_MED(){return Tt}static get DATETIME_MED_WITH_SECONDS(){return Ot}static get DATETIME_MED_WITH_WEEKDAY(){return Pn}static get DATETIME_FULL(){return Nt}static get DATETIME_FULL_WITH_SECONDS(){return Et}static get DATETIME_HUGE(){return xt}static get DATETIME_HUGE_WITH_SECONDS(){return bt}}function me(s){if(g.isDateTime(s))return s;if(s&&s.valueOf&&J(s.valueOf()))return g.fromJSDate(s);if(s&&typeof s=="object")return g.fromObject(s);throw new M(`Unknown datetime argument: ${s}, of type ${typeof s}`)}const Rr=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],$r=[".mp4",".avi",".mov",".3gp",".wmv"],Zr=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Ur=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class d{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(config[k])?[]:{};case"undefined":return e;default:return null}}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||d.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return d.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!d.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!d.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t){e.splice(n,1);break}}static pushUnique(e,t){d.inArray(e,t)||e.push(t)}static findByKey(e,t,n){e=Array.isArray(e)?e:[];for(let r in e)if(e[r][t]==n)return e[r];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const n={};for(let r in e)n[e[r][t]]=n[e[r][t]]||[],n[e[r][t]].push(e[r]);return n}static removeByKey(e,t,n){for(let r in e)if(e[r][t]==n){e.splice(r,1);break}}static pushOrReplaceByKey(e,t,n="id"){for(let r=e.length-1;r>=0;r--)if(e[r][n]==t[n]){e[r]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const n={};for(const r of e)n[r[t]]=r;return Object.values(n)}static filterRedactedProps(e,t="******"){const n=JSON.parse(JSON.stringify(e||{}));for(let r in n)typeof n[r]=="object"&&n[r]!==null?n[r]=d.filterRedactedProps(n[r],t):n[r]===t&&delete n[r];return n}static getNestedVal(e,t,n=null,r="."){let i=e||{},a=(t||"").split(r);for(const o of a){if(!d.isObject(i)&&!Array.isArray(i)||typeof i[o]>"u")return n;i=i[o]}return i}static setByPath(e,t,n,r="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let i=e,a=t.split(r),o=a.pop();for(const u of a)(!d.isObject(i)&&!Array.isArray(i)||!d.isObject(i[u])&&!Array.isArray(i[u]))&&(i[u]={}),i=i[u];i[o]=n}static deleteByPath(e,t,n="."){let r=e||{},i=(t||"").split(n),a=i.pop();for(const o of i)(!d.isObject(r)&&!Array.isArray(r)||!d.isObject(r[o])&&!Array.isArray(r[o]))&&(r[o]={}),r=r[o];Array.isArray(r)?r.splice(a,1):d.isObject(r)&&delete r[a],i.length>0&&(Array.isArray(r)&&!r.length||d.isObject(r)&&!Object.keys(r).length)&&(Array.isArray(e)&&e.length>0||d.isObject(e)&&Object.keys(e).length>0)&&d.deleteByPath(e,i.join(n),n)}static randomString(e=10){let t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}static randomSecret(e=15){if(typeof crypto>"u")return d.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const n="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=n.charAt(t[i]%n.length);return r}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let n=e[e.length-1];n!=="."&&n!=="?"&&n!=="!"&&(e+=".")}return e}static trimQuotedValue(e){return typeof e=="string"&&(e[0]=='"'||e[0]=="'"||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,n=!0){return e=""+e,e.length<=t?e:e.substring(0,t)+(n?"...":"")}static truncateObject(e){const t={};for(let n in e){let r=e[n];typeof r=="string"&&(r=d.truncate(r,150,!0)),t[n]=r}return t}static slugify(e,t="_",n=[".","=","-"]){if(e==="")return"";const r={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let i in r)e=e.replace(r[i],i);return e.replace(new RegExp("["+n.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const n=[],r=(e||"").replaceAll("\\"+t,"{_PB_ESCAPED_}").split(t).map(i=>i.replaceAll("{_PB_ESCAPED_}",t));for(let i of r)i=i.trim(),d.isEmpty(i)||n.push(i);return n}static joinNonEmpty(e,t=", "){e=e||[];const n=[],r=t.length>1?t.trim():t;for(let i of e)i=typeof i=="string"?i.trim():"",d.isEmpty(i)||n.push(i.replaceAll(r,"\\"+r));return n.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},n=t[e.length]||t[19];return g.fromFormat(e,n,{zone:"UTC"})}return g.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(n=>{console.warn("Failed to copy.",n)})}static download(e,t){const n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download",t),n.setAttribute("target","_blank"),n.click(),n.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n);d.download(r,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const n=decodeURIComponent(atob(t));return JSON.parse(n)||{}}catch(n){console.warn("Failed to parse JWT payload data.",n)}return{}}static hasImageExtension(e){return e=e||"",!!Rr.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!$r.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Zr.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Ur.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return d.hasImageExtension(e)?"image":d.hasDocumentExtension(e)?"document":d.hasVideoExtension(e)?"video":d.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,n=100){return new Promise(r=>{let i=new FileReader;i.onload=function(a){let o=new Image;o.onload=function(){let u=document.createElement("canvas"),l=u.getContext("2d"),c=o.width,h=o.height;return u.width=t,u.height=n,l.drawImage(o,c>h?(c-h)/2:0,0,c>h?h:c,c>h?h:c,0,0,t,n),r(u.toDataURL(e.type))},o.src=a.target.result},i.readAsDataURL(e)})}static addValueToFormData(e,t,n){if(!(typeof n>"u"))if(d.isEmpty(n))e.append(t,"");else if(Array.isArray(n))for(const r of n)d.addValueToFormData(e,t,r);else n instanceof File?e.append(t,n):n instanceof Date?e.append(t,n.toISOString()):d.isObject(n)?e.append(t,JSON.stringify(n)):e.append(t,""+n)}static dummyCollectionRecord(e){var u,l,c,h,p,m,E;const t=(e==null?void 0:e.schema)||[],n=(e==null?void 0:e.type)==="auth",r=(e==null?void 0:e.type)==="view",i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};n&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!r||d.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!r||d.extractColumnsFromQuery((l=e==null?void 0:e.options)==null?void 0:l.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const N of t){let T=null;N.type==="number"?T=123:N.type==="date"?T="2022-01-01 10:00:00.123Z":N.type==="bool"?T=!0:N.type==="email"?T="test@example.com":N.type==="url"?T="https://example.com":N.type==="json"?T="JSON":N.type==="file"?(T="filename.jpg",((c=N.options)==null?void 0:c.maxSelect)!==1&&(T=[T])):N.type==="select"?(T=(p=(h=N.options)==null?void 0:h.values)==null?void 0:p[0],((m=N.options)==null?void 0:m.maxSelect)!==1&&(T=[T])):N.type==="relation"?(T="RELATION_RECORD_ID",((E=N.options)==null?void 0:E.maxSelect)!==1&&(T=[T])):T="test",i[N.name]=T}return i}static dummyCollectionSchemaData(e){var r,i,a,o;const t=(e==null?void 0:e.schema)||[],n={};for(const u of t){let l=null;if(u.type==="number")l=123;else if(u.type==="date")l="2022-01-01 10:00:00.123Z";else if(u.type==="bool")l=!0;else if(u.type==="email")l="test@example.com";else if(u.type==="url")l="https://example.com";else if(u.type==="json")l="JSON";else{if(u.type==="file")continue;u.type==="select"?(l=(i=(r=u.options)==null?void 0:r.values)==null?void 0:i[0],((a=u.options)==null?void 0:a.maxSelect)!==1&&(l=[l])):u.type==="relation"?(l="RELATION_RECORD_ID",((o=u.options)==null?void 0:o.maxSelect)!==1&&(l=[l])):l="test"}n[u.name]=l}return n}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,n=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let l in e)if(l!=="schema"&&JSON.stringify(e[l])!==JSON.stringify(t[l]))return!0;const r=Array.isArray(e.schema)?e.schema:[],i=Array.isArray(t.schema)?t.schema:[],a=r.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(i,"id",l.id)),o=i.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(r,"id",l.id)),u=i.filter(l=>{const c=d.isObject(l)&&d.findByKey(r,"id",l.id);if(!c)return!1;for(let h in c)if(JSON.stringify(l[h])!=JSON.stringify(c[h]))return!0;return!1});return!!(o.length||u.length||n&&a.length)}static sortCollections(e=[]){const t=[],n=[],r=[];for(const a of e)a.type==="auth"?t.push(a):a.type==="base"?n.push(a):r.push(a);function i(a,o){return a.name>o.name?1:a.name<o.name?-1:0}return[].concat(t.sort(i),n.sort(i),r.sort(i))}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(r){let i=r.parentNode;for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}function n(r){if(r){for(const i of r.children)n(i);e.includes(r.tagName)?(r.removeAttribute("style"),r.removeAttribute("class")):t(r)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(r,i)=>{n(i.node)},file_picker_types:"image",file_picker_callback:(r,i,a)=>{const o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("accept","image/*"),o.addEventListener("change",u=>{const l=u.target.files[0],c=new FileReader;c.addEventListener("load",()=>{if(!tinymce)return;const h="blobid"+new Date().getTime(),p=tinymce.activeEditor.editorUpload.blobCache,m=c.result.split(",")[1],E=p.create(h,l,m);p.add(E),r(E.blobUri(),{title:l.name})}),c.readAsDataURL(l)}),o.click()},setup:r=>{r.on("keydown",a=>{(a.ctrlKey||a.metaKey)&&a.code=="KeyS"&&r.formElement&&(a.preventDefault(),a.stopPropagation(),r.formElement.dispatchEvent(new KeyboardEvent("keydown",a)))});const i="tinymce_last_direction";r.on("init",()=>{var o;const a=(o=window==null?void 0:window.localStorage)==null?void 0:o.getItem(i);!r.isDirty()&&r.getContent()==""&&a=="rtl"&&r.execCommand("mceDirectionRTL")}),r.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:a=>{a([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"ltr"),r.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"rtl"),r.execCommand("mceDirectionRTL")}}])}}),r.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:a=>{a([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{r.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{r.execCommand("mceImage")}}])}})}}}static displayValue(e,t,n="N/A"){e=e||{},t=t||[];let r=[];for(const a of t){let o=e[a];typeof o>"u"||(o=d.stringifyValue(o,n),r.push(o))}if(r.length>0)return r.join(", ");const i=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const a of i){let o=d.stringifyValue(e[a],"");if(o)return o}return n}static stringifyValue(e,t="N/A",n=150){if(d.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?d.plainText(e):e,d.truncate(e,n)||t;if(Array.isArray(e)&&typeof e[0]!="object")return d.truncate(e.join(","),n);if(typeof e=="object")try{return d.truncate(JSON.stringify(e),n)||t}catch{return t}return e}static extractColumnsFromQuery(e){var a;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const n=e.match(/select\s+([\s\S]+)\s+from/),r=((a=n==null?void 0:n[1])==null?void 0:a.split(","))||[],i=[];for(let o of r){const u=o.trim().split(" ").pop();u!=""&&u!=t&&i.push(u.replace(/[\'\"\`\[\]\s]/g,""))}return i}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let n=[t+"id"];if(e.type==="view")for(let i of d.extractColumnsFromQuery(e.options.query))d.pushUnique(n,t+i);else e.type==="auth"?(n.push(t+"username"),n.push(t+"email"),n.push(t+"emailVisibility"),n.push(t+"verified"),n.push(t+"created"),n.push(t+"updated")):(n.push(t+"created"),n.push(t+"updated"));const r=e.schema||[];for(const i of r)d.pushUnique(n,t+i.name);return n}static getCollectionAutocompleteKeys(e,t,n="",r=0){var o,u,l;let i=e.find(c=>c.name==t||c.id==t);if(!i||r>=4)return[];i.schema=i.schema||[];let a=d.getAllCollectionIdentifiers(i,n);for(const c of i.schema){const h=n+c.name;if(c.type=="relation"&&((o=c.options)!=null&&o.collectionId)){const p=d.getCollectionAutocompleteKeys(e,c.options.collectionId,h+".",r+1);p.length&&(a=a.concat(p))}((u=c.options)==null?void 0:u.maxSelect)!=1&&["select","file","relation"].includes(c.type)&&(a.push(h+":each"),a.push(h+":length"))}for(const c of e){c.schema=c.schema||[];for(const h of c.schema)if(h.type=="relation"&&((l=h.options)==null?void 0:l.collectionId)==i.id){const p=n+c.name+"_via_"+h.name,m=d.getCollectionAutocompleteKeys(e,c.id,p+".",r+2);m.length&&(a=a.concat(m))}}return a}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const n of e){const r="@collection."+n.name+".",i=d.getCollectionAutocompleteKeys(e,n.name,r);for(const a of i)t.push(a)}return t}static getRequestAutocompleteKeys(e,t){const n=[];n.push("@request.context"),n.push("@request.method"),n.push("@request.query."),n.push("@request.data."),n.push("@request.headers."),n.push("@request.auth.id"),n.push("@request.auth.collectionId"),n.push("@request.auth.collectionName"),n.push("@request.auth.verified"),n.push("@request.auth.username"),n.push("@request.auth.email"),n.push("@request.auth.emailVisibility"),n.push("@request.auth.created"),n.push("@request.auth.updated");const r=e.filter(i=>i.type==="auth");for(const i of r){const a=d.getCollectionAutocompleteKeys(e,i.id,"@request.auth.");for(const o of a)d.pushUnique(n,o)}if(t){const i=["created","updated"],a=d.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const o of a){n.push(o);const u=o.split(".");u.length===3&&u[2].indexOf(":")===-1&&!i.includes(u[2])&&n.push(o+":isset")}}return n}static parseIndex(e){var u,l,c,h,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},r=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((r==null?void 0:r.length)!=7)return t;const i=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((u=r[1])==null?void 0:u.trim().toLowerCase())==="unique",t.optional=!d.isEmpty((l=r[2])==null?void 0:l.trim());const a=(r[3]||"").split(".");a.length==2?(t.schemaName=a[0].replace(i,""),t.indexName=a[1].replace(i,"")):(t.schemaName="",t.indexName=a[0].replace(i,"")),t.tableName=(r[4]||"").replace(i,"");const o=(r[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of o){m=m.trim().replaceAll("{PB_TEMP}",",");const N=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((N==null?void 0:N.length)!=4)continue;const T=(h=(c=N[1])==null?void 0:c.trim())==null?void 0:h.replace(i,"");T&&t.columns.push({name:T,collate:N[2]||"",sort:((p=N[3])==null?void 0:p.toUpperCase())||""})}return t.where=r[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+d.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const n=e.columns.filter(r=>!!(r!=null&&r.name));return n.length>1&&(t+=`
`),t+=n.map(r=>{let i="";return r.name.includes("(")||r.name.includes(" ")?i+=r.name:i+="`"+r.name+"`",r.collate&&(i+=" COLLATE "+r.collate),r.sort&&(i+=" "+r.sort.toUpperCase()),i}).join(`,
`),n.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const n=d.parseIndex(e);return n.tableName=t,d.buildIndex(n)}static replaceIndexColumn(e,t,n){if(t===n)return e;const r=d.parseIndex(e);let i=!1;for(let a of r.columns)a.name===t&&(a.name=n,i=!0);return i?d.buildIndex(r):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const n=["=","!=","~","!~",">",">=","<","<="];for(const r of n)if(e.includes(r))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(r=>`${r}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return d.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",n=window.location.hash;const r=n.indexOf("?");r>-1&&(t=n.substring(r+1),n=n.substring(0,r));const i=new URLSearchParams(t);for(let u in e){const l=e[u];l===null?i.delete(u):i.set(u,l)}t=i.toString(),t!=""&&(n+="?"+t);let a=window.location.href;const o=a.indexOf("#");o>-1&&(a=a.substring(0,o)),window.location.replace(a+n)}}const st=11e3;onmessage=s=>{var t,n;if(!s.data.collections)return;const e={};e.baseKeys=d.getCollectionAutocompleteKeys(s.data.collections,(t=s.data.baseCollection)==null?void 0:t.name),e.baseKeys=it(e.baseKeys.sort(rt),st),s.data.disableRequestKeys||(e.requestKeys=d.getRequestAutocompleteKeys(s.data.collections,(n=s.data.baseCollection)==null?void 0:n.name),e.requestKeys=it(e.requestKeys.sort(rt),st)),s.data.disableCollectionJoinKeys||(e.collectionJoinKeys=d.getCollectionJoinAutocompleteKeys(s.data.collections),e.collectionJoinKeys=it(e.collectionJoinKeys.sort(rt),st)),postMessage(e)};function rt(s,e){return s.length-e.length}function it(s,e){return s.length>e?s.slice(0,e):s}})();