@sveltia/cms 0.128.5 → 0.128.6

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.
@@ -136,7 +136,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
136
136
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
137
137
  `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=pg(e),r=xu(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=pg(e),r=xu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function pU(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new fU||null,prettyErrors:e}}function gU(t,e={}){const{lineCounter:n,prettyErrors:r}=pU(e),i=new hU(n?.addNewLine),o=new aU(e);let s=null;for(const a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Cf(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(oT(t,n)),s.warnings.forEach(oT(t,n))),s}function mU(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);const i=gU(t,n);if(!i)return null;if(i.warnings.forEach(o=>R$(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Xb(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){const{keepUndefined:i}=n??e??{};if(!i)return}return yf(t)&&!r?t.toString(n):new Af(t,r,n).toString(n)}const ku=ot(!1),is=ot(),Zb=ot([]),Ji=ot([]),Qb=ot([]),bT=t=>oe(Zb).filter(({collectionName:e,filePathMap:n})=>n?Object.values(n).includes(t):pi(e)?._file?.fullPathRegEx?.test(t)).sort((e,n)=>(n.folderPath??"").localeCompare(e.folderPath??""));var gg={exports:{}},vU=gg.exports,yT;function _U(){return yT||(yT=1,(function(t,e){(function(n,r){t.exports=r()})(vU,(function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",d="week",f="month",h="quarter",p="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var M=["th","st","nd","rd"],q=L%100;return"["+L+(M[(q-20)%10]||M[q]||M[0])+"]"}},w=function(L,M,q){var V=String(L);return!V||V.length>=M?L:""+Array(M+1-V.length).join(q)+L},x={s:w,z:function(L){var M=-L.utcOffset(),q=Math.abs(M),V=Math.floor(q/60),K=q%60;return(M<=0?"+":"-")+w(V,2,"0")+":"+w(K,2,"0")},m:function L(M,q){if(M.date()<q.date())return-L(q,M);var V=12*(q.year()-M.year())+(q.month()-M.month()),K=M.clone().add(V,f),W=q-K<0,Y=M.clone().add(V+(W?-1:1),f);return+(-(V+(q-K)/(W?K-Y:Y-K))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:f,y:p,w:d,d:u,D:g,h:l,m:a,s,ms:o,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},S="en",T={};T[S]=y;var A="$isDayjsObject",k=function(L){return L instanceof O||!(!L||!L[A])},$=function L(M,q,V){var K;if(!M)return S;if(typeof M=="string"){var W=M.toLowerCase();T[W]&&(K=W),q&&(T[W]=q,K=W);var Y=M.split("-");if(!K&&Y.length>1)return L(Y[0])}else{var R=M.name;T[R]=M,K=R}return!V&&K&&(S=K),K||!V&&S},C=function(L,M){if(k(L))return L.clone();var q=typeof M=="object"?M:{};return q.date=L,q.args=arguments,new O(q)},P=x;P.l=$,P.i=k,P.w=function(L,M){return C(L,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var O=(function(){function L(q){this.$L=$(q.locale,null,!0),this.parse(q),this.$x=this.$x||q.x||{},this[A]=!0}var M=L.prototype;return M.parse=function(q){this.$d=(function(V){var K=V.date,W=V.utc;if(K===null)return new Date(NaN);if(P.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var Y=K.match(v);if(Y){var R=Y[2]-1||0,U=(Y[7]||"0").substring(0,3);return W?new Date(Date.UTC(Y[1],R,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,U)):new Date(Y[1],R,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,U)}}return new Date(K)})(q),this.init()},M.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},M.$utils=function(){return P},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(q,V){var K=C(q);return this.startOf(V)<=K&&K<=this.endOf(V)},M.isAfter=function(q,V){return C(q)<this.startOf(V)},M.isBefore=function(q,V){return this.endOf(V)<C(q)},M.$g=function(q,V,K){return P.u(q)?this[V]:this.set(K,q)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(q,V){var K=this,W=!!P.u(V)||V,Y=P.p(q),R=function(fe,de){var ve=P.w(K.$u?Date.UTC(K.$y,de,fe):new Date(K.$y,de,fe),K);return W?ve:ve.endOf(u)},U=function(fe,de){return P.w(K.toDate()[fe].apply(K.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(de)),K)},J=this.$W,Q=this.$M,ee=this.$D,ne="set"+(this.$u?"UTC":"");switch(Y){case p:return W?R(1,0):R(31,11);case f:return W?R(1,Q):R(0,Q+1);case d:var re=this.$locale().weekStart||0,ue=(J<re?J+7:J)-re;return R(W?ee-ue:ee+(6-ue),Q);case u:case g:return U(ne+"Hours",0);case l:return U(ne+"Minutes",1);case a:return U(ne+"Seconds",2);case s:return U(ne+"Milliseconds",3);default:return this.clone()}},M.endOf=function(q){return this.startOf(q,!1)},M.$set=function(q,V){var K,W=P.p(q),Y="set"+(this.$u?"UTC":""),R=(K={},K[u]=Y+"Date",K[g]=Y+"Date",K[f]=Y+"Month",K[p]=Y+"FullYear",K[l]=Y+"Hours",K[a]=Y+"Minutes",K[s]=Y+"Seconds",K[o]=Y+"Milliseconds",K)[W],U=W===u?this.$D+(V-this.$W):V;if(W===f||W===p){var J=this.clone().set(g,1);J.$d[R](U),J.init(),this.$d=J.set(g,Math.min(this.$D,J.daysInMonth())).$d}else R&&this.$d[R](U);return this.init(),this},M.set=function(q,V){return this.clone().$set(q,V)},M.get=function(q){return this[P.p(q)]()},M.add=function(q,V){var K,W=this;q=Number(q);var Y=P.p(V),R=function(Q){var ee=C(W);return P.w(ee.date(ee.date()+Math.round(Q*q)),W)};if(Y===f)return this.set(f,this.$M+q);if(Y===p)return this.set(p,this.$y+q);if(Y===u)return R(1);if(Y===d)return R(7);var U=(K={},K[a]=r,K[l]=i,K[s]=n,K)[Y]||1,J=this.$d.getTime()+q*U;return P.w(J,this)},M.subtract=function(q,V){return this.add(-1*q,V)},M.format=function(q){var V=this,K=this.$locale();if(!this.isValid())return K.invalidDate||m;var W=q||"YYYY-MM-DDTHH:mm:ssZ",Y=P.z(this),R=this.$H,U=this.$m,J=this.$M,Q=K.weekdays,ee=K.months,ne=K.meridiem,re=function(de,ve,be,ge){return de&&(de[ve]||de(V,W))||be[ve].slice(0,ge)},ue=function(de){return P.s(R%12||12,de,"0")},fe=ne||function(de,ve,be){var ge=de<12?"AM":"PM";return be?ge.toLowerCase():ge};return W.replace(b,(function(de,ve){return ve||(function(be){switch(be){case"YY":return String(V.$y).slice(-2);case"YYYY":return P.s(V.$y,4,"0");case"M":return J+1;case"MM":return P.s(J+1,2,"0");case"MMM":return re(K.monthsShort,J,ee,3);case"MMMM":return re(ee,J);case"D":return V.$D;case"DD":return P.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return re(K.weekdaysMin,V.$W,Q,2);case"ddd":return re(K.weekdaysShort,V.$W,Q,3);case"dddd":return Q[V.$W];case"H":return String(R);case"HH":return P.s(R,2,"0");case"h":return ue(1);case"hh":return ue(2);case"a":return fe(R,U,!0);case"A":return fe(R,U,!1);case"m":return String(U);case"mm":return P.s(U,2,"0");case"s":return String(V.$s);case"ss":return P.s(V.$s,2,"0");case"SSS":return P.s(V.$ms,3,"0");case"Z":return Y}return null})(de)||Y.replace(":","")}))},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(q,V,K){var W,Y=this,R=P.p(V),U=C(q),J=(U.utcOffset()-this.utcOffset())*r,Q=this-U,ee=function(){return P.m(Y,U)};switch(R){case p:W=ee()/12;break;case f:W=ee();break;case h:W=ee()/3;break;case d:W=(Q-J)/6048e5;break;case u:W=(Q-J)/864e5;break;case l:W=Q/i;break;case a:W=Q/r;break;case s:W=Q/n;break;default:W=Q}return K?W:P.a(W)},M.daysInMonth=function(){return this.endOf(f).$D},M.$locale=function(){return T[this.$L]},M.locale=function(q,V){if(!q)return this.$L;var K=this.clone(),W=$(q,V,!0);return W&&(K.$L=W),K},M.clone=function(){return P.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},L})(),I=O.prototype;return C.prototype=I,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",f],["$y",p],["$D",g]].forEach((function(L){I[L[1]]=function(M){return this.$g(M,L[0],L[1])}})),C.extend=function(L,M){return L.$i||(L(M,O,C),L.$i=!0),C},C.locale=$,C.isDayjs=k,C.unix=function(L){return C(1e3*L)},C.en=T[S],C.Ls=T,C.p={},C}))})(gg)),gg.exports}var bU=_U();const Xi=Cs(bU);var mg={exports:{}},yU=mg.exports,wT;function wU(){return wT||(wT=1,(function(t,e){(function(n,r){t.exports=r()})(yU,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,o=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(v){return(v=+v)+(v>68?1900:2e3)},d=function(v){return function(b){this[v]=+b}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(b){if(!b||b==="Z")return 0;var y=b.match(/([+-]|\d\d)/g),w=60*y[1]+(+y[2]||0);return w===0?0:y[0]==="+"?-w:w})(v)}],h=function(v){var b=l[v];return b&&(b.indexOf?b:b.s.concat(b.f))},p=function(v,b){var y,w=l.meridiem;if(w){for(var x=1;x<=24;x+=1)if(v.indexOf(w(x,0,b))>-1){y=x>12;break}}else y=v===(b?"pm":"PM");return y},g={A:[a,function(v){this.afternoon=p(v,!1)}],a:[a,function(v){this.afternoon=p(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[o,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[s,d("seconds")],ss:[s,d("seconds")],m:[s,d("minutes")],mm:[s,d("minutes")],H:[s,d("hours")],h:[s,d("hours")],HH:[s,d("hours")],hh:[s,d("hours")],D:[s,d("day")],DD:[o,d("day")],Do:[a,function(v){var b=l.ordinal,y=v.match(/\d+/);if(this.day=y[0],b)for(var w=1;w<=31;w+=1)b(w).replace(/\[|\]/g,"")===v&&(this.day=w)}],w:[s,d("week")],ww:[o,d("week")],M:[s,d("month")],MM:[o,d("month")],MMM:[a,function(v){var b=h("months"),y=(h("monthsShort")||b.map((function(w){return w.slice(0,3)}))).indexOf(v)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(v){var b=h("months").indexOf(v)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,d("year")],YY:[o,function(v){this.year=u(v)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function m(v){var b,y;b=v,y=l&&l.formats;for(var w=(v=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(C,P,O){var I=O&&O.toUpperCase();return P||y[O]||n[O]||y[I].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(L,M,q){return M||q.slice(1)}))}))).match(r),x=w.length,S=0;S<x;S+=1){var T=w[S],A=g[T],k=A&&A[0],$=A&&A[1];w[S]=$?{regex:k,parser:$}:T.replace(/^\[|\]$/g,"")}return function(C){for(var P={},O=0,I=0;O<x;O+=1){var L=w[O];if(typeof L=="string")I+=L.length;else{var M=L.regex,q=L.parser,V=C.slice(I),K=M.exec(V)[0];q.call(P,K),C=C.replace(K,"")}}return(function(W){var Y=W.afternoon;if(Y!==void 0){var R=W.hours;Y?R<12&&(W.hours+=12):R===12&&(W.hours=0),delete W.afternoon}})(P),P}}return function(v,b,y){y.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(u=v.parseTwoDigitYear);var w=b.prototype,x=w.parse;w.parse=function(S){var T=S.date,A=S.utc,k=S.args;this.$u=A;var $=k[1];if(typeof $=="string"){var C=k[2]===!0,P=k[3]===!0,O=C||P,I=k[2];P&&(I=k[2]),l=this.$locale(),!C&&I&&(l=y.Ls[I]),this.$d=(function(V,K,W,Y){try{if(["x","X"].indexOf(K)>-1)return new Date((K==="X"?1e3:1)*V);var R=m(K)(V),U=R.year,J=R.month,Q=R.day,ee=R.hours,ne=R.minutes,re=R.seconds,ue=R.milliseconds,fe=R.zone,de=R.week,ve=new Date,be=Q||(U||J?1:ve.getDate()),ge=U||ve.getFullYear(),we=0;U&&!J||(we=J>0?J-1:ve.getMonth());var Oe,ye=ee||0,pe=ne||0,_e=re||0,Le=ue||0;return fe?new Date(Date.UTC(ge,we,be,ye,pe,_e,Le+60*fe.offset*1e3)):W?new Date(Date.UTC(ge,we,be,ye,pe,_e,Le)):(Oe=new Date(ge,we,be,ye,pe,_e,Le),de&&(Oe=Y(Oe).week(de).toDate()),Oe)}catch{return new Date("")}})(T,$,A,y),this.init(),I&&I!==!0&&(this.$L=this.locale(I).$L),O&&T!=this.format($)&&(this.$d=new Date("")),l={}}else if($ instanceof Array)for(var L=$.length,M=1;M<=L;M+=1){k[1]=$[M-1];var q=y.apply(this,k);if(q.isValid()){this.$d=q.$d,this.$L=q.$L,this.init();break}M===L&&(this.$d=new Date(""))}else x.call(this,S)}}}))})(mg)),mg.exports}var xU=wU();const ey=Cs(xU);var vg={exports:{}},kU=vg.exports,xT;function SU(){return xT||(xT=1,(function(t,e){(function(n,r){t.exports=r()})(kU,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,i,o){var s=i.prototype,a=s.format;o.en.formats=n,s.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,d=(function(f,h){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,g,m){var v=m&&m.toUpperCase();return g||h[m]||n[m]||h[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(b,y,w){return y||w.slice(1)}))}))})(l,u===void 0?{}:u);return a.call(this,d)}}}))})(vg)),vg.exports}var EU=SU();const ty=Cs(EU);var _g={exports:{}},$U=_g.exports,kT;function TU(){return kT||(kT=1,(function(t,e){(function(n,r){t.exports=r()})($U,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(o,s,a){var l=s.prototype;a.utc=function(m){var v={date:m,utc:!0,args:arguments};return new s(v)},l.utc=function(m){var v=a(this.toDate(),{locale:this.$L,utc:!0});return m?v.add(this.utcOffset(),n):v},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=l.parse;l.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var d=l.init;l.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else d.call(this)};var f=l.utcOffset;l.utcOffset=function(m,v){var b=this.$utils().u;if(b(m))return this.$u?0:b(this.$offset)?f.call(this):this.$offset;if(typeof m=="string"&&(m=(function(S){S===void 0&&(S="");var T=S.match(r);if(!T)return null;var A=(""+T[0]).match(i)||["-",0,0],k=A[0],$=60*+A[1]+ +A[2];return $===0?0:k==="+"?$:-$})(m),m===null))return this;var y=Math.abs(m)<=16?60*m:m;if(y===0)return this.utc(v);var w=this.clone();if(v)return w.$offset=y,w.$u=!1,w;var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(w=this.local().add(y+x,n)).$offset=y,w.$x.$localOffset=x,w};var h=l.format;l.format=function(m){var v=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},l.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var p=l.toDate;l.toDate=function(m){return m==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var g=l.diff;l.diff=function(m,v,b){if(m&&this.$u===m.$u)return g.call(this,m,v,b);var y=this.local(),w=a(m).local();return g.call(y,w,v,b)}}}))})(_g)),_g.exports}var AU=TU();const ny=Cs(AU);class Ro{#t;#n="";#e="";#s={};#a=[];constructor(e,n,{keyPath:r,autoIncrement:i,indexes:o=[]}={}){this.#t=void 0,this.#n=e,this.#e=n,this.#s={keyPath:r,autoIncrement:i},this.#a=o}async#i(e){return new Promise(n=>{const r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{const i=r.result,o=this.#e,s=i.objectStoreNames.contains(o)?i.transaction(o,"readwrite").objectStore(o):i.createObjectStore(o,this.#s);this.#a.forEach(({name:a,keyPath:l,options:u})=>{s.indexNames.contains(a)||s.createIndex(a,l,u)})},r.onsuccess=()=>{n(r.result)}})}async#o(){let e=!1,n=await this.#i();const{version:r,objectStoreNames:i}=n,o=this.#e;if(i.contains(o)){const s=n.transaction(o).objectStore(o);e=this.#a.some(({name:a})=>!s.indexNames.contains(a))}else e=!0;return e&&(n.close(),n=await this.#i(r+1)),n.onversionchange=()=>{n.close(),this.#t=void 0},n}async#r(e){this.#t??=await this.#o();const n=this.#t,r=this.#e,i=n.transaction(r,"readwrite"),o=e(i.objectStore(r));return o?new Promise(s=>{o.onsuccess=()=>{s(o.result)}}):new Promise(s=>{i.oncomplete=()=>{s(void 0)}})}async set(e,n){return this.#r(r=>r.put(n,e))}async put(e){return this.#r(n=>n.put(e))}async saveEntries(e){return this.#r(n=>{e.forEach(([r,i])=>{n.put(i,r)})})}async get(e){return this.#r(n=>n.get(e))}async keys(){return this.#r(e=>e.getAllKeys())}async values(){return this.#r(e=>e.getAll())}async entries(){const[e,n]=await Promise.all([this.keys(),this.values()]);return e.map((r,i)=>[r,n[i]])}async#l({callback:e=void 0,index:n=void 0,query:r=void 0,direction:i="next",multiple:o=!1}){return new Promise(s=>{this.#r(a=>{const l=(n?a.index(n):a).openCursor(r,i),u=[];l.onsuccess=()=>{const d=l.result;if(d){const{value:f}=d;typeof e!="function"||e(f)?o?(u.push(f),d.continue()):s(f):d.continue()}else s(o?u:void 0)}})})}async find(e,{index:n,query:r}={}){return this.#l({callback:e,index:n,query:r})}async findLast(e,{index:n,query:r}={}){return this.#l({callback:e,index:n,query:r,direction:"prev"})}async filter(e,{index:n,query:r}={}){return this.#l({callback:e,index:n,query:r,multiple:!0})}async delete(e){await this.#r(n=>n.delete(e))}async deleteEntries(e){await this.#r(n=>{e.forEach(r=>{n.delete(r)})})}async clear(){await this.#r(e=>e.clear())}}class Ti{static async set(e,n){globalThis.localStorage.setItem(e,JSON.stringify(n))}static async get(e){const n=globalThis.localStorage.getItem(e);return n?JSON.parse(n):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(e=>JSON.parse(e))}static async entries(){return Object.entries(globalThis.localStorage).map(([e,n])=>[e,JSON.parse(n)])}}const ST=t=>Array.isArray(t)&&t.every(e=>$t(e)),Su=t=>[...new Set(t)],ET={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.autodesk.fbx":["fbx"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dcmp+xml":["dcmp"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.drawing":["gdraw"],"application/vnd.google-apps.form":["gform"],"application/vnd.google-apps.jam":["gjam"],"application/vnd.google-apps.map":["gmap"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.script":["gscript"],"application/vnd.google-apps.site":["gsite"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-visio.viewer":["vdx"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.procrate.brushset":["brushset"],"application/vnd.procreate.brush":["brush"],"application/vnd.procreate.dream":["drm"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw","vsdx","vtx"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blender":["blend"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-compressed":["*rar"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-ipynb+json":["ipynb"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zip-compressed":["*zip"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.blockfact.facti":["facti"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-adobe-dng":["dng"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(ET);const $T={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze($T);var po=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Eu,If,Al;class CU{constructor(...e){Eu.set(this,new Map),If.set(this,new Map),Al.set(this,new Map);for(const n of e)this.define(n)}define(e,n=!1){for(let[r,i]of Object.entries(e)){r=r.toLowerCase(),i=i.map(a=>a.toLowerCase()),po(this,Al,"f").has(r)||po(this,Al,"f").set(r,new Set);const o=po(this,Al,"f").get(r);let s=!0;for(let a of i){const l=a.startsWith("*");if(a=l?a.slice(1):a,o?.add(a),s&&po(this,If,"f").set(r,a),s=!1,l)continue;const u=po(this,Eu,"f").get(a);if(u&&u!=r&&!n)throw new Error(`"${r} -> ${a}" conflicts with "${u} -> ${a}". Pass \`force=true\` to override this definition.`);po(this,Eu,"f").set(a,r)}}return this}getType(e){if(typeof e!="string")return null;const n=e.replace(/^.*[/\\]/s,"").toLowerCase(),r=n.replace(/^.*\./s,"").toLowerCase(),i=n.length<e.length;return!(r.length<n.length-1)&&i?null:po(this,Eu,"f").get(r)??null}getExtension(e){return typeof e!="string"?null:(e=e?.split?.(";")[0],(e&&po(this,If,"f").get(e.trim().toLowerCase()))??null)}getAllExtensions(e){return typeof e!="string"?null:po(this,Al,"f").get(e.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of po(this,Al,"f").values())Object.freeze(e);return this}_getTestState(){return{types:po(this,Eu,"f"),extensions:po(this,If,"f")}}}Eu=new WeakMap,If=new WeakMap,Al=new WeakMap;const Gs=new CU($T,ET)._freeze(),TT=["image","video","audio"],PU=[...TT,"document","other"],OU=/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xlsx?)$/i,bg=t=>TT.includes(t),ry=t=>{const e=Gs.getType(t.path);return bg(t.kind)||e==="application/pdf"||!!e&&pf(e)},AT=async t=>{let e="";if(typeof t=="string")if(t.startsWith("blob:"))try{e=(await(await fetch(t)).blob()).type}catch{}else{if(hf(t)){const{hostname:i,pathname:o}=new URL(t);if(i.startsWith("images."))return"image";t=o}e=Gs.getType(t)??""}else t instanceof Blob&&(e=t.type);if(!e)return;const[n,r]=e.split("/");if(bg(n)&&!r.startsWith("x-"))return n},LU=t=>{const e=Gs.getType(t.path);return!!e&&pf(e)},$u=t=>Gs.getType(t)?.match(/^(?<type>image|audio|video)\//)?.groups?.type??(OU.test(t)?"document":"other"),CT=/^(?:.+\/)?(\.git(?:attributes|ignore|keep))$/,iy=ot([]);sn(iy,t=>t.find(({path:e})=>e===".gitattributes")?.text?.replace(/\r\n?/g,`
138
138
  `).split(`
139
- `).map(e=>e.startsWith("*.")&&e.includes("filter=lfs")?e.split(" ")[0].slice(2).toLowerCase():"").filter(Boolean)??[]);const Rt=(t=0)=>new Promise(e=>{globalThis.setTimeout(()=>{e(void 0)},t)});var oy,PT;function IU(){if(PT)return oy;PT=1;function t(n){return n>=55296&&n<=56319}function e(n){return n>=56320&&n<=57343}return oy=function(r,i,o){if(typeof i!="string")throw new Error("Input must be string");for(var s=i.length,a=0,l,u,d=0;d<s;d+=1){if(l=i.charCodeAt(d),u=i[d],t(l)&&e(i.charCodeAt(d+1))&&(d+=1,u+=i[d]),a+=r(u),a===o)return i.slice(0,d+1);if(a>o)return i.slice(0,d-u.length+1)}return i},oy}var sy,OT;function NU(){if(OT)return sy;OT=1;function t(n){return n>=55296&&n<=56319}function e(n){return n>=56320&&n<=57343}return sy=function(r){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,s=null,a=null,l=0;l<i;l++)s=r.charCodeAt(l),e(s)?a!=null&&t(a)?o+=1:o+=3:s<=127?o+=1:s>=128&&s<=2047?o+=2:s>=2048&&s<=65535&&(o+=3),a=s;return o},sy}var ay,LT;function RU(){if(LT)return ay;LT=1;var t=IU(),e=NU();return ay=t.bind(null,e),ay}var ly,IT;function MU(){if(IT)return ly;IT=1;var t=RU(),e=/[\/\?<>\\:\*\|"]/g,n=/[\x00-\x1f\x80-\x9f]/g,r=/^\.+$/,i=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,o=/[\. ]+$/;function s(a,l){if(typeof a!="string")throw new Error("Input must be string");var u=a.replace(e,l).replace(n,l).replace(r,l).replace(i,l).replace(o,l);return t(u,255)}return ly=function(a,l){var u=l&&l.replacement||"",d=s(a,u);return u===""?d:s(d,"")},ly}var DU=MU();const FU=Cs(DU),NT=(t,e)=>new RegExp(`^${t.split("/").map(e).join("\\/")}(?:\\/|$)`),RT=t=>{const e=t.startsWith("@");return e&&(t=t.slice(1)),t=t.split("/").map(n=>encodeURIComponent(n).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`)).join("/"),e?`@${t}`:t},zU=t=>decodeURIComponent(t),yg=t=>{const e=new Intl.NumberFormat(oe(Ut),{maximumFractionDigits:1}),n=1e3,r=n*1e3,i=r*1e3,o=i*1e3;return t<n?oe(ce)("file_size_units.b",{values:{size:e.format(t)}}):t<r?oe(ce)("file_size_units.kb",{values:{size:e.format(t/n)}}):t<i?oe(ce)("file_size_units.mb",{values:{size:e.format(t/r)}}):t<o?oe(ce)("file_size_units.gb",{values:{size:e.format(t/i)}}):oe(ce)("file_size_units.tb",{values:{size:e.format(t/o)}})},MT=(t,e)=>{if(!e.length)return t;const{filename:n,extension:r}=cn(t),i=new RegExp(`^${zt(n)}(?:-(?<num>\\d+?))?${r?`\\.${r}`:""}$`),o=e.sort((a,l)=>Yi(a.split(".")[0],l.split(".")[0])).findLast(a=>i.test(a));if(!o)return t;const s=Number(o.match(i)?.groups?.num??0)+1;return`${n}-${s}${r?`.${r}`:""}`},cy=(t,{slugificationEnabled:e=!1,assetNamesInSameFolder:n=[]}={})=>{let r=FU(t.normalize().replace(/[\s\u00A0\u202F]+/g," "));if(e){const{filename:i,extension:o}=cn(r);r=`${jC(i)}${o?`.${o}`:""}`}return MT(r,n)},Cl=t=>t.filter(Boolean).join("/"),uy=t=>{const e=t.split("/");let n=!1;return e.forEach((r,i)=>{if(r==="."||r===".."){if(n&&(e[i]=null,r==="..")){const o=e.findLastIndex((s,a)=>!!s&&a<i);o>-1&&(e[o]=null)}}else n=!0}),Cl(e)},dy=t=>typeof t=="string"?new Blob([t],{type:"text/plain"}):t,Pl=async t=>{const n=await dy(t).arrayBuffer();return wl(new Blob([`blob ${n.byteLength}\0`,n]))},qle="modulepreload",Hle=function(t){return"/"+t},Kle={},DT=function(e,n,r){let i=Promise.resolve();function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},fy="0.128.5",jU={"@jsquash/webp":"^1.5.0","@lexical/markdown":"^0.39.0","@sindresorhus/transliterate":"^2.3.1","@sveltia/ui":"^0.31.12","@sveltia/utils":"^0.8.6","create-react-class":"^15.7.0",dayjs:"^1.11.19",deepmerge:"^4.3.1",exifr:"^7.1.3","fast-deep-equal":"^3.1.3",flat:"^6.0.1",immutable:"^5.1.4","isomorphic-dompurify":"^2.35.0",leaflet:"^1.9.4",lexical:"^0.39.0",marked:"^17.0.1","marked-bidi":"^1.0.14",mime:"^4.1.0","parse-entities":"^4.0.2","pdfjs-dist":"^5.4.530",qrcode:"^1.5.4",react:"^19.2.3","react-dom":"^19.2.3","sanitize-filename":"^1.6.3","smol-toml":"^1.6.0","svelte-i18n":"^4.0.1",svgo:"^4.0.0","terra-draw":"^1.23.1","terra-draw-leaflet-adapter":"1.0.3",turndown:"^7.2.2",yaml:"^2.8.2"},hy=t=>{const e=`https://unpkg.com/${t}`,n=jU[t]?.replace(/^\D/,"");return n?`${e}@${n}`:e},Tu=async(t,e)=>DT(()=>import(`${hy(t)}/${e}`),void 0),Ol=(t,e)=>{if(typeof t!="number")return NaN;if(!Number.isFinite(t))return t;const n=10**e;return Math.round(t*n)/n},UU=async(t,e)=>{const r=e==="image"?await Ws(t):null;if(!r)return{createdDate:void 0,coordinates:void 0};const{parse:i}=await Tu("exifr","dist/lite.esm.mjs"),{latitude:o,longitude:s,DateTimeOriginal:a,CreateDate:l=a}=await i(r).catch(()=>{})??{};return{createdDate:l instanceof Date?l:void 0,coordinates:Number.isFinite(o)&&Number.isFinite(s)?{latitude:Ol(o,7),longitude:Ol(s,7)}:void 0}},BU=t=>{const e=new Image;return new Promise(n=>{const r=()=>{n({dimensions:{width:e.naturalWidth,height:e.naturalHeight}})};e.addEventListener("load",r,{once:!0}),e.src=t})},qU=async(t,e)=>{const n=document.createElement(e);return new Promise(r=>{const i=()=>{const{duration:o}=n;e==="audio"&&r({duration:o});const{videoWidth:s,videoHeight:a}=n;r({dimensions:{width:s,height:a},duration:o})};n.addEventListener("loadedmetadata",i,{once:!0}),n.src=t})},HU=async(t,e)=>e==="image"?BU(t):qU(t,e),KU=async(t,e,n)=>{const{dimensions:r,duration:i}=await HU(e,n),{createdDate:o,coordinates:s}=await UU(t,n);return{dimensions:r,duration:i,createdDate:o,coordinates:s}},FT=["avif","gif","jpeg","png","webp"],VU=FT.map(t=>`image/${t}`),py=/\b(?:avif|gif|jpe?g|png|webp)$/i,GU=["image/svg+xml"],WU=/\b(?:svg)$/i,os=[...VU,...GU],zT=["webp"],gy={},YU=async t=>{if(t in gy)return gy[t];const e=`image/${t}`,n=new OffscreenCanvas(1,1);n.getContext("2d");const i=(await n.convertToBlob({type:e})).type===e;return gy[t]=i,i},jT=async(t,{format:e="webp",quality:n=85}={})=>{const r=`image/${e}`;if(!await YU(e)&&zT.includes(e)){const o=t.getContext("2d").getImageData(0,0,t.width,t.height);try{const s=(await Tu(`@jsquash/${e}`,"encode.js?module")).default,a=await s(o,{quality:n});return new Blob([a],{type:r})}catch{}}return t.convertToBlob({type:r,quality:n/100})},JU=({width:t,height:e},{width:n=t,height:r=e,fit:i="scale-down"}={})=>{const o={scale:1,width:t,height:e};if(t===r&&e===r)return o;const s=t>e,a=t<r||e<r;let l=1,u=0,d=0;if(i==="scale-down"){if(a)return o;i="contain"}return i==="contain"&&(s?(n>r?(l=n/t,u=n):(l=r/t,u=r),d=e*l):(n>r?(l=r/e,d=r):(l=n/e,d=n),u=t*l)),{scale:l,width:u,height:d}},UT=(t,e,n)=>{const{scale:r,width:i,height:o}=JU(e,n);return t.width=i,t.height=o,{scale:r,width:i,height:o}},XU=async({blob:t})=>{const e=URL.createObjectURL(t),n=new Image;return new Promise(r=>{n.addEventListener("load",()=>{r({source:n,naturalWidth:n.naturalWidth,naturalHeight:n.naturalHeight}),URL.revokeObjectURL(e)},{once:!0}),n.src=e})},ZU=async({blob:t})=>{const e=URL.createObjectURL(t),n=document.createElement("video");return new Promise(r=>{n.addEventListener("canplay",()=>{n.pause(),r({source:n,naturalWidth:n.videoWidth,naturalHeight:n.videoHeight}),URL.revokeObjectURL(e)},{once:!0}),n.muted=!0,n.autoplay=!0,n.playsInline=!0,n.src=e,n.style.opacity="0",n.style.pointerEvents="none",document.body.appendChild(n)})},QU=async t=>t.type.startsWith("video/")?ZU({blob:t}):XU({blob:t}),my=async(t,{format:e="png",quality:n=85,width:r=void 0,height:i=void 0,fit:o="scale-down"}={})=>{let s,a=0,l=0;try{s=await createImageBitmap(t),{width:a,height:l}=s}catch{({source:s,naturalWidth:a,naturalHeight:l}=await QU(t))}r??=a,i??=l;const u=new OffscreenCanvas(512,512),d=u.getContext("2d");return UT(u,{width:a,height:l},{fit:o,width:r,height:i}),d.drawImage(s,0,0,u.width,u.height),s instanceof HTMLVideoElement&&document.body.removeChild(s),jT(u,{format:e,quality:n})},eB=async t=>{const e=await t.text();try{const{optimize:n}=await Tu("svgo","dist/svgo.browser.js"),{data:r}=n(e);return new Blob([r],{type:t.type})}catch{}return t},Au=hy("pdfjs-dist"),tB=`${Au}/build/pdf.min.mjs`,nB=`${Au}/build/pdf.worker.min.mjs`,rB={isEvalSupported:!1,disableAutoFetch:!0,cMapUrl:`${Au}/cmaps/`,iccUrl:`${Au}/iccs/`,standardFontDataUrl:`${Au}/standard_fonts/`,wasmUrl:`${Au}/wasm/`};let wg;const iB=async(t,{format:e="png",quality:n=85,width:r=void 0,height:i=void 0,fit:o="scale-down"}={})=>{if(!wg)try{wg=await import(tB),wg.GlobalWorkerOptions.workerSrc=nB}catch{throw new Error("Failed to load PDF.js library")}const s=URL.createObjectURL(t),a=new OffscreenCanvas(512,512),l=a.getContext("2d");try{const d=await(await wg.getDocument({...rB,url:s}).promise).getPage(1),f=d.getViewport({scale:1}),{scale:h}=UT(a,{width:f.width,height:f.height},{width:r,height:i,fit:o});await d.render({canvasContext:l,viewport:h===1?f:d.getViewport({scale:h})}).promise,URL.revokeObjectURL(s)}catch{throw new Error("Failed to render PDF")}return jT(a,{format:e,quality:n})},vy=new Set,Ws=async(t,e=0)=>{const{file:n,handle:r,blobURL:i,name:o,path:s}=t;if(i)return fetch(i).then(l=>l.blob());let a;if(n)a=n;else if(r)try{a=await r.getFile()}catch{throw new Error("Failed to retrieve blob from file handle")}else{if(vy.has(s)&&e<=25)return await Rt(200),Ws(t,e+1);vy.add(s);const l=await oe(An)?.fetchBlob?.(t);if(!l)throw new Error("Failed to retrieve blob");a=new Blob([l],{type:Gs.getType(o)??l.type})}return t.blobURL=URL.createObjectURL(a),vy.delete(s),a},_y=async t=>(t.blobURL||await Ws(t),t.blobURL);let xg;const by=async(t,{cacheOnly:e=!1}={})=>{const n=t.name.endsWith(".pdf");if(!(["image","video"].includes(t.kind)||n))return;if(xg===void 0){const{databaseName:i}=oe(An)?.repository??{};xg=i?new Ro(i,"asset-thumbnails"):null}let r=await xg?.get(t.sha);if(!r){if(e)return;const i=await Ws(t),o={format:"webp",quality:85,width:512,height:512,fit:"contain"};r=n?await iB(i,o):await my(i,o),await xg?.set(t.sha,r)}return URL.createObjectURL(r)},Nf=(t,{pathOnly:e=!1,allowSpecial:n=!1,entry:r=void 0}={})=>{const{publicPath:i,entryRelative:o,hasTemplateTags:s}=t.folder.collectionName===void 0?t.folder:jp(t.path).find(({collectionName:d})=>d!==void 0)??oe(iu);if(o)return e&&r&&cn(t.path).dirname===cn(Object.values(r.locales)[0].path).dirname?t.name:void 0;const{_baseURL:a="",output:{encode_file_path:l=!1}={}}=oe(Et);let u=s?t.path.replace(NT(t.folder.internalPath??"",d=>{const f=d.match(/{{(?<tag>.+?)}}/)?.groups?.tag;return f?`(?<${f}>[^/]+)`:zt(d)}),i?.replaceAll(/{{(.+?)}}/g,"$<$1>")??""):t.path.replace(t.folder.internalPath??"",i==="/"?"":i??"");if(l&&(u=RT(u)),!(!u.startsWith("/")&&!n))return e?u:`${a}${u}`},Ll=async({value:t,entry:e,collectionName:n,fileName:r,thumbnail:i=!1})=>{if(!t)return;if(/^(?:https?|data|blob):/.test(t))return t;const o=$w({value:t,entry:e,collectionName:n,fileName:r});if(o)return(i?await by(o):await _y(o))??Nf(o)},kg={publicURL:void 0,repoBlobURL:void 0,dimensions:void 0,duration:void 0,usedEntries:[]},Sg=async t=>{const{kind:e,path:n}=t,{blobBaseURL:r}=oe(An)?.repository??{},i=await _y(t),o=Nf(t,{allowSpecial:!0,pathOnly:!0})??i;let s={};return["image","video","audio"].includes(e)&&i&&(s=await KU(t,i,e)),{...s,publicURL:Nf(t),repoBlobURL:r?`${r}/${n}`:void 0,usedEntries:o?await Wy(o):[]}},Rr=t=>{let e;if(t!=="_default")try{[e]=Intl.getCanonicalLocales(t)}catch{}return e},Mo=(t,{displayLocale:e=Rr(oe(Ut)??"en")}={})=>{const n=Rr(t);if(!n)return;const r=new Intl.DisplayNames(e,{type:"language"});try{return r.of(n)}catch(i){console.error(i);return}},Il=(t,e={})=>new Intl.ListFormat(Rr(t),{style:"narrow",type:"conjunction",...e}),yy=({_i18n:t,locale:e,path:n})=>{const{defaultLocale:r,omitDefaultLocaleFromFileName:i}=t;return i&&e===r&&(n=n.replace(/\.{{locale}}\.(\w+)$/,".$1")),n.replaceAll("{{locale}}",e)},oB=/^(?:\d{4}-[01]\d-[0-3]\d)?(?:T?[0-2]\d:[0-5]\d)?(?::[0-5]\d)?(?:\.\d+)?(?:[+-][0-2]\d:[0-5]\d|Z)?$/,sB=/^\d{4}-[01]\d-[0-3]\d$/,aB=/T00:00(?::00)?(?:\.000)?Z$/,wy={year:"numeric",month:"short",day:"numeric"},xy={hour:"numeric",minute:"numeric",hour12:!0},lB={...wy,...xy};Xi.extend(ey),Xi.extend(ty),Xi.extend(ny);const Ia=t=>{const{format:e,date_format:n=void 0,time_format:r=void 0,picker_utc:i=!1}=t;return{format:e||[typeof n=="string"?n:"",typeof r=="string"?r:""].join(" ").trim()||void 0,dateOnly:r===!1,timeOnly:n===!1,utc:i}},ky=t=>t instanceof Date&&!Number.isNaN(t.getTime()),Sy=t=>t?Xi.utc:Xi,Nl=(t,e)=>{const{format:n,timeOnly:r,utc:i}=Ia(e);if(!t)return;let o;if(n){const s=Sy(i);let a=s(t,n);if(!a.isValid()&&(a=s(t),!a.isValid())){console.error("Invalid Date",t);return}return a.toDate()}if(r?o=new Date(`${new Date().toJSON().split("T")[0]}T${t}`):o=new Date(t),ky(o))return o;console.error("Invalid Date",t)},BT=t=>{const{dateOnly:e,timeOnly:n,utc:r}=Ia(t),{year:i,month:o,day:s,hour:a,minute:l}=xl({timeZone:r?"UTC":void 0}),u=`${i}-${o}-${s}`,d=`${a}:${l}`;return e?u:n?d:r?`${u}T${d}:00.000Z`:`${u}T${d}`},qT=(t,e,n)=>{const{format:r,dateOnly:i,timeOnly:o,utc:s}=Ia(n),a=i?"YYYY-MM-DD":o?"HH:mm":"YYYY-MM-DDTHH:mm",l=`:00${e?.endsWith(".000")?".000":""}`;if(t==="")return"";if(t){if(r){const u=Sy(s);let d=u(t,a);return!d.isValid()&&(d=u(t),!d.isValid())?(console.info("Invalid date",t),""):d.format(r)}return i?t:s?`${t}:00.000Z`:`${t}${l}`}},cB=(t,e)=>{const{dateOnly:n,timeOnly:r,utc:i}=Ia(e);if(!t)return"";const o=n?t?.match(/^(?<date>\d{4}-[01]\d-[0-3]\d)\b/)?.groups?.date:r?t?.match(/(?:^|T)(?<time>[0-2]\d:[0-5]\d)\b/)?.groups?.time:void 0;if(o)return o;const s=t?Nl(t,e):new Date;if(!s)return"";const{year:a,month:l,day:u,hour:d,minute:f}=xl({date:s,timeZone:i?"UTC":void 0}),h=`${a}-${l}-${u}`,p=`${d}:${f}`;return n?h:r?p:`${h}T${p}`},HT=({locale:t,fieldConfig:e,currentValue:n})=>{const{format:r,dateOnly:i,timeOnly:o,utc:s}=Ia(e);if(typeof n!="string"||!n.trim())return"";if(r){const u=Sy(s);let d=u(n,r);return!d.isValid()&&(d=u(n),!d.isValid())?(console.error("Invalid Date",n),""):d.format(r)}const a=Nl(n,e),l=Rr(t);return ky(a)?o?a.toLocaleTimeString(l,xy):i?a.toLocaleDateString(l,{...wy,timeZone:s||sB.test(n)||aB.test(n)?"UTC":void 0}):a.toLocaleString(l,{...wy,...xy,timeZone:s?"UTC":void 0,timeZoneName:s?void 0:"short"}):""};Xi.extend(ey),Xi.extend(ty),Xi.extend(ny);const Ey=/^date\('(?<format>.+?)'(?:,\s*'(?<timeZone>.+?)')?\)$/,KT=/^default\('(?<defaultValue>.+?)'\)$/,VT=/^ternary\('(?<truthyValue>.*?)',\s*'(?<falsyValue>.*?)'\)$/,uB=/^truncate\((?<max>\d+)(?:,\s*'(?<ellipsis>.+?)')?\)$/,dB=t=>String(t).toUpperCase(),fB=t=>String(t).toLowerCase(),hB=(t,{format:e,timeZone:n},r)=>{const i=String(t),{dateOnly:o,utc:s}=Ia(r),l=(n==="utc"||s||o&&!!i.match(/^\d{4}-[01]\d-[0-3]\d$/)||o&&!!i.match(/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/)?Xi.utc:Xi)(i);return l.isValid()?l.format(e):""},pB=(t,{defaultValue:e})=>t?String(t):e,gB=(t,{truthyValue:e,falsyValue:n})=>t?e:n,mB=(t,{max:e,ellipsis:n="…"})=>tb(String(t),Number(e),{ellipsis:n}),vB=({fieldConfig:t,value:e,transformation:n})=>{if(n==="upper")return dB(e);if(n==="lower")return fB(e);const r=n.match(Ey);if(r?.groups)return hB(e,r.groups,t??{});const i=n.match(KT);if(i?.groups)return pB(e,i.groups);const o=n.match(VT);if(o?.groups)return gB(e,o.groups);const s=n.match(uB);return s?.groups?mB(e,s.groups):String(e)},$y=({fieldConfig:t,value:e,transformations:n})=>(n.forEach(r=>{e=vB({fieldConfig:t,value:e,transformation:r})}),e),Ty=["file","image"],Eg=[...Ty,"relation","select"],GT=[...Eg,"list","number"];var Ay,WT;function YT(){if(WT)return Ay;WT=1;const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:u}=typeof Reflect<"u"&&Reflect;o||(o=function(Te){return Te}),s||(s=function(Te){return Te}),l||(l=function(Te,Ce){for(var $e=arguments.length,He=new Array($e>2?$e-2:0),Ke=2;Ke<$e;Ke++)He[Ke-2]=arguments[Ke];return Te.apply(Ce,He)}),u||(u=function(Te){for(var Ce=arguments.length,$e=new Array(Ce>1?Ce-1:0),He=1;He<Ce;He++)$e[He-1]=arguments[He];return new Te(...$e)});const d=k(Array.prototype.forEach),f=k(Array.prototype.lastIndexOf),h=k(Array.prototype.pop),p=k(Array.prototype.push),g=k(Array.prototype.splice),m=k(String.prototype.toLowerCase),v=k(String.prototype.toString),b=k(String.prototype.match),y=k(String.prototype.replace),w=k(String.prototype.indexOf),x=k(String.prototype.trim),S=k(Object.prototype.hasOwnProperty),T=k(RegExp.prototype.test),A=$(TypeError);function k(Ie){return function(Te){Te instanceof RegExp&&(Te.lastIndex=0);for(var Ce=arguments.length,$e=new Array(Ce>1?Ce-1:0),He=1;He<Ce;He++)$e[He-1]=arguments[He];return l(Ie,Te,$e)}}function $(Ie){return function(){for(var Te=arguments.length,Ce=new Array(Te),$e=0;$e<Te;$e++)Ce[$e]=arguments[$e];return u(Ie,Ce)}}function C(Ie,Te){let Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m;e&&e(Ie,null);let $e=Te.length;for(;$e--;){let He=Te[$e];if(typeof He=="string"){const Ke=Ce(He);Ke!==He&&(n(Te)||(Te[$e]=Ke),He=Ke)}Ie[He]=!0}return Ie}function P(Ie){for(let Te=0;Te<Ie.length;Te++)S(Ie,Te)||(Ie[Te]=null);return Ie}function O(Ie){const Te=a(null);for(const[Ce,$e]of t(Ie))S(Ie,Ce)&&(Array.isArray($e)?Te[Ce]=P($e):$e&&typeof $e=="object"&&$e.constructor===Object?Te[Ce]=O($e):Te[Ce]=$e);return Te}function I(Ie,Te){for(;Ie!==null;){const $e=i(Ie,Te);if($e){if($e.get)return k($e.get);if(typeof $e.value=="function")return k($e.value)}Ie=r(Ie)}function Ce(){return null}return Ce}const L=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),q=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),V=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),K=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),W=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Y=o(["#text"]),R=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),U=o(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),J=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Q=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ee=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ne=s(/<%[\w\W]*|[\w\W]*%>/gm),re=s(/\$\{[\w\W]*/gm),ue=s(/^data-[\-\w.\u00B7-\uFFFF]+$/),fe=s(/^aria-[\-\w]+$/),de=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ve=s(/^(?:\w+script|data):/i),be=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ge=s(/^html$/i),we=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var Oe=Object.freeze({__proto__:null,ARIA_ATTR:fe,ATTR_WHITESPACE:be,CUSTOM_ELEMENT:we,DATA_ATTR:ue,DOCTYPE_NAME:ge,ERB_EXPR:ne,IS_ALLOWED_URI:de,IS_SCRIPT_OR_DATA:ve,MUSTACHE_EXPR:ee,TMPLIT_EXPR:re});const ye={element:1,text:3,progressingInstruction:7,comment:8,document:9},pe=function(){return typeof window>"u"?null:window},_e=function(Te,Ce){if(typeof Te!="object"||typeof Te.createPolicy!="function")return null;let $e=null;const He="data-tt-policy-suffix";Ce&&Ce.hasAttribute(He)&&($e=Ce.getAttribute(He));const Ke="dompurify"+($e?"#"+$e:"");try{return Te.createPolicy(Ke,{createHTML(pt){return pt},createScriptURL(pt){return pt}})}catch{return console.warn("TrustedTypes policy "+Ke+" could not be created."),null}},Le=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ze(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pe();const Te=ut=>ze(ut);if(Te.version="3.3.1",Te.removed=[],!Ie||!Ie.document||Ie.document.nodeType!==ye.document||!Ie.Element)return Te.isSupported=!1,Te;let{document:Ce}=Ie;const $e=Ce,He=$e.currentScript,{DocumentFragment:Ke,HTMLTemplateElement:pt,Node:Pe,Element:Ne,NodeFilter:he,NamedNodeMap:Ae=Ie.NamedNodeMap||Ie.MozNamedAttrMap,HTMLFormElement:Re,DOMParser:rt,trustedTypes:Ge}=Ie,Qe=Ne.prototype,tt=I(Qe,"cloneNode"),bt=I(Qe,"remove"),qt=I(Qe,"nextSibling"),pn=I(Qe,"childNodes"),Wt=I(Qe,"parentNode");if(typeof pt=="function"){const ut=Ce.createElement("template");ut.content&&ut.content.ownerDocument&&(Ce=ut.content.ownerDocument)}let At,en="";const{implementation:kt,createNodeIterator:It,createDocumentFragment:wr,getElementsByTagName:wn}=Ce,{importNode:or}=$e;let St=Le();Te.isSupported=typeof t=="function"&&typeof Wt=="function"&&kt&&kt.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:gn,ERB_EXPR:ct,TMPLIT_EXPR:gt,DATA_ATTR:xn,ARIA_ATTR:Un,IS_SCRIPT_OR_DATA:Nn,ATTR_WHITESPACE:kn,CUSTOM_ELEMENT:mn}=Oe;let{IS_ALLOWED_URI:Sn}=Oe,Nt=null;const Pr=C({},[...L,...M,...q,...K,...Y]);let Yt=null;const Ri=C({},[...R,...U,...J,...Q]);let Ct=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xi=null,ro=null;const xo=Object.seal(a(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let sl=!0,Rn=!0,ht=!1,Ot=!0,vn=!1,pr=!0,xr=!1,Yo=!1,sr=!1,Bn=!1,Qr=!1,ei=!1,Mi=!0,Yn=!1;const Hr="user-content-";let ki=!0,ip=!1,Cd={},Ts=null;const z1=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let hM=null;const pM=C({},["audio","video","img","source","image","track"]);let j1=null;const gM=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xv="http://www.w3.org/1998/Math/MathML",kv="http://www.w3.org/2000/svg",da="http://www.w3.org/1999/xhtml";let Pd=da,U1=!1,B1=null;const Rle=C({},[xv,kv,da],v);let Sv=C({},["mi","mo","mn","ms","mtext"]),Ev=C({},["annotation-xml"]);const Mle=C({},["title","style","font","a","script"]);let op=null;const Dle=["application/xhtml+xml","text/html"],Fle="text/html";let kr=null,Od=null;const zle=Ce.createElement("form"),mM=function(le){return le instanceof RegExp||le instanceof Function},q1=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Od&&Od===le)){if((!le||typeof le!="object")&&(le={}),le=O(le),op=Dle.indexOf(le.PARSER_MEDIA_TYPE)===-1?Fle:le.PARSER_MEDIA_TYPE,kr=op==="application/xhtml+xml"?v:m,Nt=S(le,"ALLOWED_TAGS")?C({},le.ALLOWED_TAGS,kr):Pr,Yt=S(le,"ALLOWED_ATTR")?C({},le.ALLOWED_ATTR,kr):Ri,B1=S(le,"ALLOWED_NAMESPACES")?C({},le.ALLOWED_NAMESPACES,v):Rle,j1=S(le,"ADD_URI_SAFE_ATTR")?C(O(gM),le.ADD_URI_SAFE_ATTR,kr):gM,hM=S(le,"ADD_DATA_URI_TAGS")?C(O(pM),le.ADD_DATA_URI_TAGS,kr):pM,Ts=S(le,"FORBID_CONTENTS")?C({},le.FORBID_CONTENTS,kr):z1,xi=S(le,"FORBID_TAGS")?C({},le.FORBID_TAGS,kr):O({}),ro=S(le,"FORBID_ATTR")?C({},le.FORBID_ATTR,kr):O({}),Cd=S(le,"USE_PROFILES")?le.USE_PROFILES:!1,sl=le.ALLOW_ARIA_ATTR!==!1,Rn=le.ALLOW_DATA_ATTR!==!1,ht=le.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,vn=le.SAFE_FOR_TEMPLATES||!1,pr=le.SAFE_FOR_XML!==!1,xr=le.WHOLE_DOCUMENT||!1,Bn=le.RETURN_DOM||!1,Qr=le.RETURN_DOM_FRAGMENT||!1,ei=le.RETURN_TRUSTED_TYPE||!1,sr=le.FORCE_BODY||!1,Mi=le.SANITIZE_DOM!==!1,Yn=le.SANITIZE_NAMED_PROPS||!1,ki=le.KEEP_CONTENT!==!1,ip=le.IN_PLACE||!1,Sn=le.ALLOWED_URI_REGEXP||de,Pd=le.NAMESPACE||da,Sv=le.MATHML_TEXT_INTEGRATION_POINTS||Sv,Ev=le.HTML_INTEGRATION_POINTS||Ev,Ct=le.CUSTOM_ELEMENT_HANDLING||{},le.CUSTOM_ELEMENT_HANDLING&&mM(le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ct.tagNameCheck=le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),le.CUSTOM_ELEMENT_HANDLING&&mM(le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ct.attributeNameCheck=le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ct.allowCustomizedBuiltInElements=le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vn&&(Rn=!1),Qr&&(Bn=!0),Cd&&(Nt=C({},Y),Yt=[],Cd.html===!0&&(C(Nt,L),C(Yt,R)),Cd.svg===!0&&(C(Nt,M),C(Yt,U),C(Yt,Q)),Cd.svgFilters===!0&&(C(Nt,q),C(Yt,U),C(Yt,Q)),Cd.mathMl===!0&&(C(Nt,K),C(Yt,J),C(Yt,Q))),le.ADD_TAGS&&(typeof le.ADD_TAGS=="function"?xo.tagCheck=le.ADD_TAGS:(Nt===Pr&&(Nt=O(Nt)),C(Nt,le.ADD_TAGS,kr))),le.ADD_ATTR&&(typeof le.ADD_ATTR=="function"?xo.attributeCheck=le.ADD_ATTR:(Yt===Ri&&(Yt=O(Yt)),C(Yt,le.ADD_ATTR,kr))),le.ADD_URI_SAFE_ATTR&&C(j1,le.ADD_URI_SAFE_ATTR,kr),le.FORBID_CONTENTS&&(Ts===z1&&(Ts=O(Ts)),C(Ts,le.FORBID_CONTENTS,kr)),le.ADD_FORBID_CONTENTS&&(Ts===z1&&(Ts=O(Ts)),C(Ts,le.ADD_FORBID_CONTENTS,kr)),ki&&(Nt["#text"]=!0),xr&&C(Nt,["html","head","body"]),Nt.table&&(C(Nt,["tbody"]),delete xi.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');At=le.TRUSTED_TYPES_POLICY,en=At.createHTML("")}else At===void 0&&(At=_e(Ge,He)),At!==null&&typeof en=="string"&&(en=At.createHTML(""));o&&o(le),Od=le}},vM=C({},[...M,...q,...V]),_M=C({},[...K,...W]),jle=function(le){let Ve=Wt(le);(!Ve||!Ve.tagName)&&(Ve={namespaceURI:Pd,tagName:"template"});const lt=m(le.tagName),qn=m(Ve.tagName);return B1[le.namespaceURI]?le.namespaceURI===kv?Ve.namespaceURI===da?lt==="svg":Ve.namespaceURI===xv?lt==="svg"&&(qn==="annotation-xml"||Sv[qn]):!!vM[lt]:le.namespaceURI===xv?Ve.namespaceURI===da?lt==="math":Ve.namespaceURI===kv?lt==="math"&&Ev[qn]:!!_M[lt]:le.namespaceURI===da?Ve.namespaceURI===kv&&!Ev[qn]||Ve.namespaceURI===xv&&!Sv[qn]?!1:!_M[lt]&&(Mle[lt]||!vM[lt]):!!(op==="application/xhtml+xml"&&B1[le.namespaceURI]):!1},As=function(le){p(Te.removed,{element:le});try{Wt(le).removeChild(le)}catch{bt(le)}},Pc=function(le,Ve){try{p(Te.removed,{attribute:Ve.getAttributeNode(le),from:Ve})}catch{p(Te.removed,{attribute:null,from:Ve})}if(Ve.removeAttribute(le),le==="is")if(Bn||Qr)try{As(Ve)}catch{}else try{Ve.setAttribute(le,"")}catch{}},bM=function(le){let Ve=null,lt=null;if(sr)le="<remove></remove>"+le;else{const gr=b(le,/^[\r\n\t ]+/);lt=gr&&gr[0]}op==="application/xhtml+xml"&&Pd===da&&(le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+le+"</body></html>");const qn=At?At.createHTML(le):le;if(Pd===da)try{Ve=new rt().parseFromString(qn,op)}catch{}if(!Ve||!Ve.documentElement){Ve=kt.createDocument(Pd,"template",null);try{Ve.documentElement.innerHTML=U1?en:qn}catch{}}const ti=Ve.body||Ve.documentElement;return le&&lt&&ti.insertBefore(Ce.createTextNode(lt),ti.childNodes[0]||null),Pd===da?wn.call(Ve,xr?"html":"body")[0]:xr?Ve.documentElement:ti},yM=function(le){return It.call(le.ownerDocument||le,le,he.SHOW_ELEMENT|he.SHOW_COMMENT|he.SHOW_TEXT|he.SHOW_PROCESSING_INSTRUCTION|he.SHOW_CDATA_SECTION,null)},H1=function(le){return le instanceof Re&&(typeof le.nodeName!="string"||typeof le.textContent!="string"||typeof le.removeChild!="function"||!(le.attributes instanceof Ae)||typeof le.removeAttribute!="function"||typeof le.setAttribute!="function"||typeof le.namespaceURI!="string"||typeof le.insertBefore!="function"||typeof le.hasChildNodes!="function")},wM=function(le){return typeof Pe=="function"&&le instanceof Pe};function fa(ut,le,Ve){d(ut,lt=>{lt.call(Te,le,Ve,Od)})}const xM=function(le){let Ve=null;if(fa(St.beforeSanitizeElements,le,null),H1(le))return As(le),!0;const lt=kr(le.nodeName);if(fa(St.uponSanitizeElement,le,{tagName:lt,allowedTags:Nt}),pr&&le.hasChildNodes()&&!wM(le.firstElementChild)&&T(/<[/\w!]/g,le.innerHTML)&&T(/<[/\w!]/g,le.textContent)||le.nodeType===ye.progressingInstruction||pr&&le.nodeType===ye.comment&&T(/<[/\w]/g,le.data))return As(le),!0;if(!(xo.tagCheck instanceof Function&&xo.tagCheck(lt))&&(!Nt[lt]||xi[lt])){if(!xi[lt]&&SM(lt)&&(Ct.tagNameCheck instanceof RegExp&&T(Ct.tagNameCheck,lt)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(lt)))return!1;if(ki&&!Ts[lt]){const qn=Wt(le)||le.parentNode,ti=pn(le)||le.childNodes;if(ti&&qn){const gr=ti.length;for(let Di=gr-1;Di>=0;--Di){const ha=tt(ti[Di],!0);ha.__removalCount=(le.__removalCount||0)+1,qn.insertBefore(ha,qt(le))}}}return As(le),!0}return le instanceof Ne&&!jle(le)||(lt==="noscript"||lt==="noembed"||lt==="noframes")&&T(/<\/no(script|embed|frames)/i,le.innerHTML)?(As(le),!0):(vn&&le.nodeType===ye.text&&(Ve=le.textContent,d([gn,ct,gt],qn=>{Ve=y(Ve,qn," ")}),le.textContent!==Ve&&(p(Te.removed,{element:le.cloneNode()}),le.textContent=Ve)),fa(St.afterSanitizeElements,le,null),!1)},kM=function(le,Ve,lt){if(Mi&&(Ve==="id"||Ve==="name")&&(lt in Ce||lt in zle))return!1;if(!(Rn&&!ro[Ve]&&T(xn,Ve))){if(!(sl&&T(Un,Ve))){if(!(xo.attributeCheck instanceof Function&&xo.attributeCheck(Ve,le))){if(!Yt[Ve]||ro[Ve]){if(!(SM(le)&&(Ct.tagNameCheck instanceof RegExp&&T(Ct.tagNameCheck,le)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(le))&&(Ct.attributeNameCheck instanceof RegExp&&T(Ct.attributeNameCheck,Ve)||Ct.attributeNameCheck instanceof Function&&Ct.attributeNameCheck(Ve,le))||Ve==="is"&&Ct.allowCustomizedBuiltInElements&&(Ct.tagNameCheck instanceof RegExp&&T(Ct.tagNameCheck,lt)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(lt))))return!1}else if(!j1[Ve]){if(!T(Sn,y(lt,kn,""))){if(!((Ve==="src"||Ve==="xlink:href"||Ve==="href")&&le!=="script"&&w(lt,"data:")===0&&hM[le])){if(!(ht&&!T(Nn,y(lt,kn,"")))){if(lt)return!1}}}}}}}return!0},SM=function(le){return le!=="annotation-xml"&&b(le,mn)},EM=function(le){fa(St.beforeSanitizeAttributes,le,null);const{attributes:Ve}=le;if(!Ve||H1(le))return;const lt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Yt,forceKeepAttr:void 0};let qn=Ve.length;for(;qn--;){const ti=Ve[qn],{name:gr,namespaceURI:Di,value:ha}=ti,Ld=kr(gr),K1=ha;let Kr=gr==="value"?K1:x(K1);if(lt.attrName=Ld,lt.attrValue=Kr,lt.keepAttr=!0,lt.forceKeepAttr=void 0,fa(St.uponSanitizeAttribute,le,lt),Kr=lt.attrValue,Yn&&(Ld==="id"||Ld==="name")&&(Pc(gr,le),Kr=Hr+Kr),pr&&T(/((--!?|])>)|<\/(style|title|textarea)/i,Kr)){Pc(gr,le);continue}if(Ld==="attributename"&&b(Kr,"href")){Pc(gr,le);continue}if(lt.forceKeepAttr)continue;if(!lt.keepAttr){Pc(gr,le);continue}if(!Ot&&T(/\/>/i,Kr)){Pc(gr,le);continue}vn&&d([gn,ct,gt],TM=>{Kr=y(Kr,TM," ")});const $M=kr(le.nodeName);if(!kM($M,Ld,Kr)){Pc(gr,le);continue}if(At&&typeof Ge=="object"&&typeof Ge.getAttributeType=="function"&&!Di)switch(Ge.getAttributeType($M,Ld)){case"TrustedHTML":{Kr=At.createHTML(Kr);break}case"TrustedScriptURL":{Kr=At.createScriptURL(Kr);break}}if(Kr!==K1)try{Di?le.setAttributeNS(Di,gr,Kr):le.setAttribute(gr,Kr),H1(le)?As(le):h(Te.removed)}catch{Pc(gr,le)}}fa(St.afterSanitizeAttributes,le,null)},Ule=function ut(le){let Ve=null;const lt=yM(le);for(fa(St.beforeSanitizeShadowDOM,le,null);Ve=lt.nextNode();)fa(St.uponSanitizeShadowNode,Ve,null),xM(Ve),EM(Ve),Ve.content instanceof Ke&&ut(Ve.content);fa(St.afterSanitizeShadowDOM,le,null)};return Te.sanitize=function(ut){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve=null,lt=null,qn=null,ti=null;if(U1=!ut,U1&&(ut="<!-->"),typeof ut!="string"&&!wM(ut))if(typeof ut.toString=="function"){if(ut=ut.toString(),typeof ut!="string")throw A("dirty is not a string, aborting")}else throw A("toString is not a function");if(!Te.isSupported)return ut;if(Yo||q1(le),Te.removed=[],typeof ut=="string"&&(ip=!1),ip){if(ut.nodeName){const ha=kr(ut.nodeName);if(!Nt[ha]||xi[ha])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(ut instanceof Pe)Ve=bM("<!---->"),lt=Ve.ownerDocument.importNode(ut,!0),lt.nodeType===ye.element&&lt.nodeName==="BODY"||lt.nodeName==="HTML"?Ve=lt:Ve.appendChild(lt);else{if(!Bn&&!vn&&!xr&&ut.indexOf("<")===-1)return At&&ei?At.createHTML(ut):ut;if(Ve=bM(ut),!Ve)return Bn?null:ei?en:""}Ve&&sr&&As(Ve.firstChild);const gr=yM(ip?ut:Ve);for(;qn=gr.nextNode();)xM(qn),EM(qn),qn.content instanceof Ke&&Ule(qn.content);if(ip)return ut;if(Bn){if(Qr)for(ti=wr.call(Ve.ownerDocument);Ve.firstChild;)ti.appendChild(Ve.firstChild);else ti=Ve;return(Yt.shadowroot||Yt.shadowrootmode)&&(ti=or.call($e,ti,!0)),ti}let Di=xr?Ve.outerHTML:Ve.innerHTML;return xr&&Nt["!doctype"]&&Ve.ownerDocument&&Ve.ownerDocument.doctype&&Ve.ownerDocument.doctype.name&&T(ge,Ve.ownerDocument.doctype.name)&&(Di="<!DOCTYPE "+Ve.ownerDocument.doctype.name+`>
139
+ `).map(e=>e.startsWith("*.")&&e.includes("filter=lfs")?e.split(" ")[0].slice(2).toLowerCase():"").filter(Boolean)??[]);const Rt=(t=0)=>new Promise(e=>{globalThis.setTimeout(()=>{e(void 0)},t)});var oy,PT;function IU(){if(PT)return oy;PT=1;function t(n){return n>=55296&&n<=56319}function e(n){return n>=56320&&n<=57343}return oy=function(r,i,o){if(typeof i!="string")throw new Error("Input must be string");for(var s=i.length,a=0,l,u,d=0;d<s;d+=1){if(l=i.charCodeAt(d),u=i[d],t(l)&&e(i.charCodeAt(d+1))&&(d+=1,u+=i[d]),a+=r(u),a===o)return i.slice(0,d+1);if(a>o)return i.slice(0,d-u.length+1)}return i},oy}var sy,OT;function NU(){if(OT)return sy;OT=1;function t(n){return n>=55296&&n<=56319}function e(n){return n>=56320&&n<=57343}return sy=function(r){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,s=null,a=null,l=0;l<i;l++)s=r.charCodeAt(l),e(s)?a!=null&&t(a)?o+=1:o+=3:s<=127?o+=1:s>=128&&s<=2047?o+=2:s>=2048&&s<=65535&&(o+=3),a=s;return o},sy}var ay,LT;function RU(){if(LT)return ay;LT=1;var t=IU(),e=NU();return ay=t.bind(null,e),ay}var ly,IT;function MU(){if(IT)return ly;IT=1;var t=RU(),e=/[\/\?<>\\:\*\|"]/g,n=/[\x00-\x1f\x80-\x9f]/g,r=/^\.+$/,i=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,o=/[\. ]+$/;function s(a,l){if(typeof a!="string")throw new Error("Input must be string");var u=a.replace(e,l).replace(n,l).replace(r,l).replace(i,l).replace(o,l);return t(u,255)}return ly=function(a,l){var u=l&&l.replacement||"",d=s(a,u);return u===""?d:s(d,"")},ly}var DU=MU();const FU=Cs(DU),NT=(t,e)=>new RegExp(`^${t.split("/").map(e).join("\\/")}(?:\\/|$)`),RT=t=>{const e=t.startsWith("@");return e&&(t=t.slice(1)),t=t.split("/").map(n=>encodeURIComponent(n).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`)).join("/"),e?`@${t}`:t},zU=t=>decodeURIComponent(t),yg=t=>{const e=new Intl.NumberFormat(oe(Ut),{maximumFractionDigits:1}),n=1e3,r=n*1e3,i=r*1e3,o=i*1e3;return t<n?oe(ce)("file_size_units.b",{values:{size:e.format(t)}}):t<r?oe(ce)("file_size_units.kb",{values:{size:e.format(t/n)}}):t<i?oe(ce)("file_size_units.mb",{values:{size:e.format(t/r)}}):t<o?oe(ce)("file_size_units.gb",{values:{size:e.format(t/i)}}):oe(ce)("file_size_units.tb",{values:{size:e.format(t/o)}})},MT=(t,e)=>{if(!e.length)return t;const{filename:n,extension:r}=cn(t),i=new RegExp(`^${zt(n)}(?:-(?<num>\\d+?))?${r?`\\.${r}`:""}$`),o=e.sort((a,l)=>Yi(a.split(".")[0],l.split(".")[0])).findLast(a=>i.test(a));if(!o)return t;const s=Number(o.match(i)?.groups?.num??0)+1;return`${n}-${s}${r?`.${r}`:""}`},cy=(t,{slugificationEnabled:e=!1,assetNamesInSameFolder:n=[]}={})=>{let r=FU(t.normalize().replace(/[\s\u00A0\u202F]+/g," "));if(e){const{filename:i,extension:o}=cn(r);r=`${jC(i)}${o?`.${o}`:""}`}return MT(r,n)},Cl=t=>t.filter(Boolean).join("/"),uy=t=>{const e=t.split("/");let n=!1;return e.forEach((r,i)=>{if(r==="."||r===".."){if(n&&(e[i]=null,r==="..")){const o=e.findLastIndex((s,a)=>!!s&&a<i);o>-1&&(e[o]=null)}}else n=!0}),Cl(e)},dy=t=>typeof t=="string"?new Blob([t],{type:"text/plain"}):t,Pl=async t=>{const n=await dy(t).arrayBuffer();return wl(new Blob([`blob ${n.byteLength}\0`,n]))},qle="modulepreload",Hle=function(t){return"/"+t},Kle={},DT=function(e,n,r){let i=Promise.resolve();function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},fy="0.128.6",jU={"@jsquash/webp":"^1.5.0","@lexical/markdown":"^0.39.0","@sindresorhus/transliterate":"^2.3.1","@sveltia/ui":"^0.31.12","@sveltia/utils":"^0.8.6","create-react-class":"^15.7.0",dayjs:"^1.11.19",deepmerge:"^4.3.1",exifr:"^7.1.3","fast-deep-equal":"^3.1.3",flat:"^6.0.1",immutable:"^5.1.4","isomorphic-dompurify":"^2.35.0",leaflet:"^1.9.4",lexical:"^0.39.0",marked:"^17.0.1","marked-bidi":"^1.0.14",mime:"^4.1.0","parse-entities":"^4.0.2","pdfjs-dist":"^5.4.530",qrcode:"^1.5.4",react:"^19.2.3","react-dom":"^19.2.3","sanitize-filename":"^1.6.3","smol-toml":"^1.6.0","svelte-i18n":"^4.0.1",svgo:"^4.0.0","terra-draw":"^1.23.1","terra-draw-leaflet-adapter":"1.0.3",turndown:"^7.2.2",yaml:"^2.8.2"},hy=t=>{const e=`https://unpkg.com/${t}`,n=jU[t]?.replace(/^\D/,"");return n?`${e}@${n}`:e},Tu=async(t,e)=>DT(()=>import(`${hy(t)}/${e}`),void 0),Ol=(t,e)=>{if(typeof t!="number")return NaN;if(!Number.isFinite(t))return t;const n=10**e;return Math.round(t*n)/n},UU=async(t,e)=>{const r=e==="image"?await Ws(t):null;if(!r)return{createdDate:void 0,coordinates:void 0};const{parse:i}=await Tu("exifr","dist/lite.esm.mjs"),{latitude:o,longitude:s,DateTimeOriginal:a,CreateDate:l=a}=await i(r).catch(()=>{})??{};return{createdDate:l instanceof Date?l:void 0,coordinates:Number.isFinite(o)&&Number.isFinite(s)?{latitude:Ol(o,7),longitude:Ol(s,7)}:void 0}},BU=t=>{const e=new Image;return new Promise(n=>{const r=()=>{n({dimensions:{width:e.naturalWidth,height:e.naturalHeight}})};e.addEventListener("load",r,{once:!0}),e.src=t})},qU=async(t,e)=>{const n=document.createElement(e);return new Promise(r=>{const i=()=>{const{duration:o}=n;e==="audio"&&r({duration:o});const{videoWidth:s,videoHeight:a}=n;r({dimensions:{width:s,height:a},duration:o})};n.addEventListener("loadedmetadata",i,{once:!0}),n.src=t})},HU=async(t,e)=>e==="image"?BU(t):qU(t,e),KU=async(t,e,n)=>{const{dimensions:r,duration:i}=await HU(e,n),{createdDate:o,coordinates:s}=await UU(t,n);return{dimensions:r,duration:i,createdDate:o,coordinates:s}},FT=["avif","gif","jpeg","png","webp"],VU=FT.map(t=>`image/${t}`),py=/\b(?:avif|gif|jpe?g|png|webp)$/i,GU=["image/svg+xml"],WU=/\b(?:svg)$/i,os=[...VU,...GU],zT=["webp"],gy={},YU=async t=>{if(t in gy)return gy[t];const e=`image/${t}`,n=new OffscreenCanvas(1,1);n.getContext("2d");const i=(await n.convertToBlob({type:e})).type===e;return gy[t]=i,i},jT=async(t,{format:e="webp",quality:n=85}={})=>{const r=`image/${e}`;if(!await YU(e)&&zT.includes(e)){const o=t.getContext("2d").getImageData(0,0,t.width,t.height);try{const s=(await Tu(`@jsquash/${e}`,"encode.js?module")).default,a=await s(o,{quality:n});return new Blob([a],{type:r})}catch{}}return t.convertToBlob({type:r,quality:n/100})},JU=({width:t,height:e},{width:n=t,height:r=e,fit:i="scale-down"}={})=>{const o={scale:1,width:t,height:e};if(t===r&&e===r)return o;const s=t>e,a=t<r||e<r;let l=1,u=0,d=0;if(i==="scale-down"){if(a)return o;i="contain"}return i==="contain"&&(s?(n>r?(l=n/t,u=n):(l=r/t,u=r),d=e*l):(n>r?(l=r/e,d=r):(l=n/e,d=n),u=t*l)),{scale:l,width:u,height:d}},UT=(t,e,n)=>{const{scale:r,width:i,height:o}=JU(e,n);return t.width=i,t.height=o,{scale:r,width:i,height:o}},XU=async({blob:t})=>{const e=URL.createObjectURL(t),n=new Image;return new Promise(r=>{n.addEventListener("load",()=>{r({source:n,naturalWidth:n.naturalWidth,naturalHeight:n.naturalHeight}),URL.revokeObjectURL(e)},{once:!0}),n.src=e})},ZU=async({blob:t})=>{const e=URL.createObjectURL(t),n=document.createElement("video");return new Promise(r=>{n.addEventListener("canplay",()=>{n.pause(),r({source:n,naturalWidth:n.videoWidth,naturalHeight:n.videoHeight}),URL.revokeObjectURL(e)},{once:!0}),n.muted=!0,n.autoplay=!0,n.playsInline=!0,n.src=e,n.style.opacity="0",n.style.pointerEvents="none",document.body.appendChild(n)})},QU=async t=>t.type.startsWith("video/")?ZU({blob:t}):XU({blob:t}),my=async(t,{format:e="png",quality:n=85,width:r=void 0,height:i=void 0,fit:o="scale-down"}={})=>{let s,a=0,l=0;try{s=await createImageBitmap(t),{width:a,height:l}=s}catch{({source:s,naturalWidth:a,naturalHeight:l}=await QU(t))}r??=a,i??=l;const u=new OffscreenCanvas(512,512),d=u.getContext("2d");return UT(u,{width:a,height:l},{fit:o,width:r,height:i}),d.drawImage(s,0,0,u.width,u.height),s instanceof HTMLVideoElement&&document.body.removeChild(s),jT(u,{format:e,quality:n})},eB=async t=>{const e=await t.text();try{const{optimize:n}=await Tu("svgo","dist/svgo.browser.js"),{data:r}=n(e);return new Blob([r],{type:t.type})}catch{}return t},Au=hy("pdfjs-dist"),tB=`${Au}/build/pdf.min.mjs`,nB=`${Au}/build/pdf.worker.min.mjs`,rB={isEvalSupported:!1,disableAutoFetch:!0,cMapUrl:`${Au}/cmaps/`,iccUrl:`${Au}/iccs/`,standardFontDataUrl:`${Au}/standard_fonts/`,wasmUrl:`${Au}/wasm/`};let wg;const iB=async(t,{format:e="png",quality:n=85,width:r=void 0,height:i=void 0,fit:o="scale-down"}={})=>{if(!wg)try{wg=await import(tB),wg.GlobalWorkerOptions.workerSrc=nB}catch{throw new Error("Failed to load PDF.js library")}const s=URL.createObjectURL(t),a=new OffscreenCanvas(512,512),l=a.getContext("2d");try{const d=await(await wg.getDocument({...rB,url:s}).promise).getPage(1),f=d.getViewport({scale:1}),{scale:h}=UT(a,{width:f.width,height:f.height},{width:r,height:i,fit:o});await d.render({canvasContext:l,viewport:h===1?f:d.getViewport({scale:h})}).promise,URL.revokeObjectURL(s)}catch{throw new Error("Failed to render PDF")}return jT(a,{format:e,quality:n})},vy=new Set,Ws=async(t,e=0)=>{const{file:n,handle:r,blobURL:i,name:o,path:s}=t;if(i)return fetch(i).then(l=>l.blob());let a;if(n)a=n;else if(r)try{a=await r.getFile()}catch{throw new Error("Failed to retrieve blob from file handle")}else{if(vy.has(s)&&e<=25)return await Rt(200),Ws(t,e+1);vy.add(s);const l=await oe(An)?.fetchBlob?.(t);if(!l)throw new Error("Failed to retrieve blob");a=new Blob([l],{type:Gs.getType(o)??l.type})}return t.blobURL=URL.createObjectURL(a),vy.delete(s),a},_y=async t=>(t.blobURL||await Ws(t),t.blobURL);let xg;const by=async(t,{cacheOnly:e=!1}={})=>{const n=t.name.endsWith(".pdf");if(!(["image","video"].includes(t.kind)||n))return;if(xg===void 0){const{databaseName:i}=oe(An)?.repository??{};xg=i?new Ro(i,"asset-thumbnails"):null}let r=await xg?.get(t.sha);if(!r){if(e)return;const i=await Ws(t),o={format:"webp",quality:85,width:512,height:512,fit:"contain"};r=n?await iB(i,o):await my(i,o),await xg?.set(t.sha,r)}return URL.createObjectURL(r)},Nf=(t,{pathOnly:e=!1,allowSpecial:n=!1,entry:r=void 0}={})=>{const{publicPath:i,entryRelative:o,hasTemplateTags:s}=t.folder.collectionName===void 0?t.folder:jp(t.path).find(({collectionName:d})=>d!==void 0)??oe(iu);if(o)return e&&r&&cn(t.path).dirname===cn(Object.values(r.locales)[0].path).dirname?t.name:void 0;const{_baseURL:a="",output:{encode_file_path:l=!1}={}}=oe(Et);let u=s?t.path.replace(NT(t.folder.internalPath??"",d=>{const f=d.match(/{{(?<tag>.+?)}}/)?.groups?.tag;return f?`(?<${f}>[^/]+)`:zt(d)}),i?.replaceAll(/{{(.+?)}}/g,"$<$1>")??""):t.path.replace(t.folder.internalPath??"",i==="/"?"":i??"");if(l&&(u=RT(u)),!(!u.startsWith("/")&&!n))return e?u:`${a}${u}`},Ll=async({value:t,entry:e,collectionName:n,fileName:r,thumbnail:i=!1})=>{if(!t)return;if(/^(?:https?|data|blob):/.test(t))return t;const o=$w({value:t,entry:e,collectionName:n,fileName:r});if(o)return(i?await by(o):await _y(o))??Nf(o)},kg={publicURL:void 0,repoBlobURL:void 0,dimensions:void 0,duration:void 0,usedEntries:[]},Sg=async t=>{const{kind:e,path:n}=t,{blobBaseURL:r}=oe(An)?.repository??{},i=await _y(t),o=Nf(t,{allowSpecial:!0,pathOnly:!0})??i;let s={};return["image","video","audio"].includes(e)&&i&&(s=await KU(t,i,e)),{...s,publicURL:Nf(t),repoBlobURL:r?`${r}/${n}`:void 0,usedEntries:o?await Wy(o):[]}},Rr=t=>{let e;if(t!=="_default")try{[e]=Intl.getCanonicalLocales(t)}catch{}return e},Mo=(t,{displayLocale:e=Rr(oe(Ut)??"en")}={})=>{const n=Rr(t);if(!n)return;const r=new Intl.DisplayNames(e,{type:"language"});try{return r.of(n)}catch(i){console.error(i);return}},Il=(t,e={})=>new Intl.ListFormat(Rr(t),{style:"narrow",type:"conjunction",...e}),yy=({_i18n:t,locale:e,path:n})=>{const{defaultLocale:r,omitDefaultLocaleFromFileName:i}=t;return i&&e===r&&(n=n.replace(/\.{{locale}}\.(\w+)$/,".$1")),n.replaceAll("{{locale}}",e)},oB=/^(?:\d{4}-[01]\d-[0-3]\d)?(?:T?[0-2]\d:[0-5]\d)?(?::[0-5]\d)?(?:\.\d+)?(?:[+-][0-2]\d:[0-5]\d|Z)?$/,sB=/^\d{4}-[01]\d-[0-3]\d$/,aB=/T00:00(?::00)?(?:\.000)?Z$/,wy={year:"numeric",month:"short",day:"numeric"},xy={hour:"numeric",minute:"numeric",hour12:!0},lB={...wy,...xy};Xi.extend(ey),Xi.extend(ty),Xi.extend(ny);const Ia=t=>{const{format:e,date_format:n=void 0,time_format:r=void 0,picker_utc:i=!1}=t;return{format:e||[typeof n=="string"?n:"",typeof r=="string"?r:""].join(" ").trim()||void 0,dateOnly:r===!1,timeOnly:n===!1,utc:i}},ky=t=>t instanceof Date&&!Number.isNaN(t.getTime()),Sy=t=>t?Xi.utc:Xi,Nl=(t,e)=>{const{format:n,timeOnly:r,utc:i}=Ia(e);if(!t)return;let o;if(n){const s=Sy(i);let a=s(t,n);if(!a.isValid()&&(a=s(t),!a.isValid())){console.error("Invalid Date",t);return}return a.toDate()}if(r?o=new Date(`${new Date().toJSON().split("T")[0]}T${t}`):o=new Date(t),ky(o))return o;console.error("Invalid Date",t)},BT=t=>{const{dateOnly:e,timeOnly:n,utc:r}=Ia(t),{year:i,month:o,day:s,hour:a,minute:l}=xl({timeZone:r?"UTC":void 0}),u=`${i}-${o}-${s}`,d=`${a}:${l}`;return e?u:n?d:r?`${u}T${d}:00.000Z`:`${u}T${d}`},qT=(t,e,n)=>{const{format:r,dateOnly:i,timeOnly:o,utc:s}=Ia(n),a=i?"YYYY-MM-DD":o?"HH:mm":"YYYY-MM-DDTHH:mm",l=`:00${e?.endsWith(".000")?".000":""}`;if(t==="")return"";if(t){if(r){const u=Sy(s);let d=u(t,a);return!d.isValid()&&(d=u(t),!d.isValid())?(console.info("Invalid date",t),""):d.format(r)}return i?t:s?`${t}:00.000Z`:`${t}${l}`}},cB=(t,e)=>{const{dateOnly:n,timeOnly:r,utc:i}=Ia(e);if(!t)return"";const o=n?t?.match(/^(?<date>\d{4}-[01]\d-[0-3]\d)\b/)?.groups?.date:r?t?.match(/(?:^|T)(?<time>[0-2]\d:[0-5]\d)\b/)?.groups?.time:void 0;if(o)return o;const s=t?Nl(t,e):new Date;if(!s)return"";const{year:a,month:l,day:u,hour:d,minute:f}=xl({date:s,timeZone:i?"UTC":void 0}),h=`${a}-${l}-${u}`,p=`${d}:${f}`;return n?h:r?p:`${h}T${p}`},HT=({locale:t,fieldConfig:e,currentValue:n})=>{const{format:r,dateOnly:i,timeOnly:o,utc:s}=Ia(e);if(typeof n!="string"||!n.trim())return"";if(r){const u=Sy(s);let d=u(n,r);return!d.isValid()&&(d=u(n),!d.isValid())?(console.error("Invalid Date",n),""):d.format(r)}const a=Nl(n,e),l=Rr(t);return ky(a)?o?a.toLocaleTimeString(l,xy):i?a.toLocaleDateString(l,{...wy,timeZone:s||sB.test(n)||aB.test(n)?"UTC":void 0}):a.toLocaleString(l,{...wy,...xy,timeZone:s?"UTC":void 0,timeZoneName:s?void 0:"short"}):""};Xi.extend(ey),Xi.extend(ty),Xi.extend(ny);const Ey=/^date\('(?<format>.+?)'(?:,\s*'(?<timeZone>.+?)')?\)$/,KT=/^default\('(?<defaultValue>.+?)'\)$/,VT=/^ternary\('(?<truthyValue>.*?)',\s*'(?<falsyValue>.*?)'\)$/,uB=/^truncate\((?<max>\d+)(?:,\s*'(?<ellipsis>.+?)')?\)$/,dB=t=>String(t).toUpperCase(),fB=t=>String(t).toLowerCase(),hB=(t,{format:e,timeZone:n},r)=>{const i=String(t),{dateOnly:o,utc:s}=Ia(r),l=(n==="utc"||s||o&&!!i.match(/^\d{4}-[01]\d-[0-3]\d$/)||o&&!!i.match(/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/)?Xi.utc:Xi)(i);return l.isValid()?l.format(e):""},pB=(t,{defaultValue:e})=>t?String(t):e,gB=(t,{truthyValue:e,falsyValue:n})=>t?e:n,mB=(t,{max:e,ellipsis:n="…"})=>tb(String(t),Number(e),{ellipsis:n}),vB=({fieldConfig:t,value:e,transformation:n})=>{if(n==="upper")return dB(e);if(n==="lower")return fB(e);const r=n.match(Ey);if(r?.groups)return hB(e,r.groups,t??{});const i=n.match(KT);if(i?.groups)return pB(e,i.groups);const o=n.match(VT);if(o?.groups)return gB(e,o.groups);const s=n.match(uB);return s?.groups?mB(e,s.groups):String(e)},$y=({fieldConfig:t,value:e,transformations:n})=>(n.forEach(r=>{e=vB({fieldConfig:t,value:e,transformation:r})}),e),Ty=["file","image"],Eg=[...Ty,"relation","select"],GT=[...Eg,"list","number"];var Ay,WT;function YT(){if(WT)return Ay;WT=1;const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:u}=typeof Reflect<"u"&&Reflect;o||(o=function(Te){return Te}),s||(s=function(Te){return Te}),l||(l=function(Te,Ce){for(var $e=arguments.length,He=new Array($e>2?$e-2:0),Ke=2;Ke<$e;Ke++)He[Ke-2]=arguments[Ke];return Te.apply(Ce,He)}),u||(u=function(Te){for(var Ce=arguments.length,$e=new Array(Ce>1?Ce-1:0),He=1;He<Ce;He++)$e[He-1]=arguments[He];return new Te(...$e)});const d=k(Array.prototype.forEach),f=k(Array.prototype.lastIndexOf),h=k(Array.prototype.pop),p=k(Array.prototype.push),g=k(Array.prototype.splice),m=k(String.prototype.toLowerCase),v=k(String.prototype.toString),b=k(String.prototype.match),y=k(String.prototype.replace),w=k(String.prototype.indexOf),x=k(String.prototype.trim),S=k(Object.prototype.hasOwnProperty),T=k(RegExp.prototype.test),A=$(TypeError);function k(Ie){return function(Te){Te instanceof RegExp&&(Te.lastIndex=0);for(var Ce=arguments.length,$e=new Array(Ce>1?Ce-1:0),He=1;He<Ce;He++)$e[He-1]=arguments[He];return l(Ie,Te,$e)}}function $(Ie){return function(){for(var Te=arguments.length,Ce=new Array(Te),$e=0;$e<Te;$e++)Ce[$e]=arguments[$e];return u(Ie,Ce)}}function C(Ie,Te){let Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m;e&&e(Ie,null);let $e=Te.length;for(;$e--;){let He=Te[$e];if(typeof He=="string"){const Ke=Ce(He);Ke!==He&&(n(Te)||(Te[$e]=Ke),He=Ke)}Ie[He]=!0}return Ie}function P(Ie){for(let Te=0;Te<Ie.length;Te++)S(Ie,Te)||(Ie[Te]=null);return Ie}function O(Ie){const Te=a(null);for(const[Ce,$e]of t(Ie))S(Ie,Ce)&&(Array.isArray($e)?Te[Ce]=P($e):$e&&typeof $e=="object"&&$e.constructor===Object?Te[Ce]=O($e):Te[Ce]=$e);return Te}function I(Ie,Te){for(;Ie!==null;){const $e=i(Ie,Te);if($e){if($e.get)return k($e.get);if(typeof $e.value=="function")return k($e.value)}Ie=r(Ie)}function Ce(){return null}return Ce}const L=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),q=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),V=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),K=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),W=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Y=o(["#text"]),R=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),U=o(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),J=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Q=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ee=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ne=s(/<%[\w\W]*|[\w\W]*%>/gm),re=s(/\$\{[\w\W]*/gm),ue=s(/^data-[\-\w.\u00B7-\uFFFF]+$/),fe=s(/^aria-[\-\w]+$/),de=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ve=s(/^(?:\w+script|data):/i),be=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ge=s(/^html$/i),we=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var Oe=Object.freeze({__proto__:null,ARIA_ATTR:fe,ATTR_WHITESPACE:be,CUSTOM_ELEMENT:we,DATA_ATTR:ue,DOCTYPE_NAME:ge,ERB_EXPR:ne,IS_ALLOWED_URI:de,IS_SCRIPT_OR_DATA:ve,MUSTACHE_EXPR:ee,TMPLIT_EXPR:re});const ye={element:1,text:3,progressingInstruction:7,comment:8,document:9},pe=function(){return typeof window>"u"?null:window},_e=function(Te,Ce){if(typeof Te!="object"||typeof Te.createPolicy!="function")return null;let $e=null;const He="data-tt-policy-suffix";Ce&&Ce.hasAttribute(He)&&($e=Ce.getAttribute(He));const Ke="dompurify"+($e?"#"+$e:"");try{return Te.createPolicy(Ke,{createHTML(pt){return pt},createScriptURL(pt){return pt}})}catch{return console.warn("TrustedTypes policy "+Ke+" could not be created."),null}},Le=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ze(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pe();const Te=ut=>ze(ut);if(Te.version="3.3.1",Te.removed=[],!Ie||!Ie.document||Ie.document.nodeType!==ye.document||!Ie.Element)return Te.isSupported=!1,Te;let{document:Ce}=Ie;const $e=Ce,He=$e.currentScript,{DocumentFragment:Ke,HTMLTemplateElement:pt,Node:Pe,Element:Ne,NodeFilter:he,NamedNodeMap:Ae=Ie.NamedNodeMap||Ie.MozNamedAttrMap,HTMLFormElement:Re,DOMParser:rt,trustedTypes:Ge}=Ie,Qe=Ne.prototype,tt=I(Qe,"cloneNode"),bt=I(Qe,"remove"),qt=I(Qe,"nextSibling"),pn=I(Qe,"childNodes"),Wt=I(Qe,"parentNode");if(typeof pt=="function"){const ut=Ce.createElement("template");ut.content&&ut.content.ownerDocument&&(Ce=ut.content.ownerDocument)}let At,en="";const{implementation:kt,createNodeIterator:It,createDocumentFragment:wr,getElementsByTagName:wn}=Ce,{importNode:or}=$e;let St=Le();Te.isSupported=typeof t=="function"&&typeof Wt=="function"&&kt&&kt.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:gn,ERB_EXPR:ct,TMPLIT_EXPR:gt,DATA_ATTR:xn,ARIA_ATTR:Un,IS_SCRIPT_OR_DATA:Nn,ATTR_WHITESPACE:kn,CUSTOM_ELEMENT:mn}=Oe;let{IS_ALLOWED_URI:Sn}=Oe,Nt=null;const Pr=C({},[...L,...M,...q,...K,...Y]);let Yt=null;const Ri=C({},[...R,...U,...J,...Q]);let Ct=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xi=null,ro=null;const xo=Object.seal(a(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let sl=!0,Rn=!0,ht=!1,Ot=!0,vn=!1,pr=!0,xr=!1,Yo=!1,sr=!1,Bn=!1,Qr=!1,ei=!1,Mi=!0,Yn=!1;const Hr="user-content-";let ki=!0,ip=!1,Cd={},Ts=null;const z1=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let hM=null;const pM=C({},["audio","video","img","source","image","track"]);let j1=null;const gM=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xv="http://www.w3.org/1998/Math/MathML",kv="http://www.w3.org/2000/svg",da="http://www.w3.org/1999/xhtml";let Pd=da,U1=!1,B1=null;const Rle=C({},[xv,kv,da],v);let Sv=C({},["mi","mo","mn","ms","mtext"]),Ev=C({},["annotation-xml"]);const Mle=C({},["title","style","font","a","script"]);let op=null;const Dle=["application/xhtml+xml","text/html"],Fle="text/html";let kr=null,Od=null;const zle=Ce.createElement("form"),mM=function(le){return le instanceof RegExp||le instanceof Function},q1=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Od&&Od===le)){if((!le||typeof le!="object")&&(le={}),le=O(le),op=Dle.indexOf(le.PARSER_MEDIA_TYPE)===-1?Fle:le.PARSER_MEDIA_TYPE,kr=op==="application/xhtml+xml"?v:m,Nt=S(le,"ALLOWED_TAGS")?C({},le.ALLOWED_TAGS,kr):Pr,Yt=S(le,"ALLOWED_ATTR")?C({},le.ALLOWED_ATTR,kr):Ri,B1=S(le,"ALLOWED_NAMESPACES")?C({},le.ALLOWED_NAMESPACES,v):Rle,j1=S(le,"ADD_URI_SAFE_ATTR")?C(O(gM),le.ADD_URI_SAFE_ATTR,kr):gM,hM=S(le,"ADD_DATA_URI_TAGS")?C(O(pM),le.ADD_DATA_URI_TAGS,kr):pM,Ts=S(le,"FORBID_CONTENTS")?C({},le.FORBID_CONTENTS,kr):z1,xi=S(le,"FORBID_TAGS")?C({},le.FORBID_TAGS,kr):O({}),ro=S(le,"FORBID_ATTR")?C({},le.FORBID_ATTR,kr):O({}),Cd=S(le,"USE_PROFILES")?le.USE_PROFILES:!1,sl=le.ALLOW_ARIA_ATTR!==!1,Rn=le.ALLOW_DATA_ATTR!==!1,ht=le.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,vn=le.SAFE_FOR_TEMPLATES||!1,pr=le.SAFE_FOR_XML!==!1,xr=le.WHOLE_DOCUMENT||!1,Bn=le.RETURN_DOM||!1,Qr=le.RETURN_DOM_FRAGMENT||!1,ei=le.RETURN_TRUSTED_TYPE||!1,sr=le.FORCE_BODY||!1,Mi=le.SANITIZE_DOM!==!1,Yn=le.SANITIZE_NAMED_PROPS||!1,ki=le.KEEP_CONTENT!==!1,ip=le.IN_PLACE||!1,Sn=le.ALLOWED_URI_REGEXP||de,Pd=le.NAMESPACE||da,Sv=le.MATHML_TEXT_INTEGRATION_POINTS||Sv,Ev=le.HTML_INTEGRATION_POINTS||Ev,Ct=le.CUSTOM_ELEMENT_HANDLING||{},le.CUSTOM_ELEMENT_HANDLING&&mM(le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ct.tagNameCheck=le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),le.CUSTOM_ELEMENT_HANDLING&&mM(le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ct.attributeNameCheck=le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ct.allowCustomizedBuiltInElements=le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vn&&(Rn=!1),Qr&&(Bn=!0),Cd&&(Nt=C({},Y),Yt=[],Cd.html===!0&&(C(Nt,L),C(Yt,R)),Cd.svg===!0&&(C(Nt,M),C(Yt,U),C(Yt,Q)),Cd.svgFilters===!0&&(C(Nt,q),C(Yt,U),C(Yt,Q)),Cd.mathMl===!0&&(C(Nt,K),C(Yt,J),C(Yt,Q))),le.ADD_TAGS&&(typeof le.ADD_TAGS=="function"?xo.tagCheck=le.ADD_TAGS:(Nt===Pr&&(Nt=O(Nt)),C(Nt,le.ADD_TAGS,kr))),le.ADD_ATTR&&(typeof le.ADD_ATTR=="function"?xo.attributeCheck=le.ADD_ATTR:(Yt===Ri&&(Yt=O(Yt)),C(Yt,le.ADD_ATTR,kr))),le.ADD_URI_SAFE_ATTR&&C(j1,le.ADD_URI_SAFE_ATTR,kr),le.FORBID_CONTENTS&&(Ts===z1&&(Ts=O(Ts)),C(Ts,le.FORBID_CONTENTS,kr)),le.ADD_FORBID_CONTENTS&&(Ts===z1&&(Ts=O(Ts)),C(Ts,le.ADD_FORBID_CONTENTS,kr)),ki&&(Nt["#text"]=!0),xr&&C(Nt,["html","head","body"]),Nt.table&&(C(Nt,["tbody"]),delete xi.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');At=le.TRUSTED_TYPES_POLICY,en=At.createHTML("")}else At===void 0&&(At=_e(Ge,He)),At!==null&&typeof en=="string"&&(en=At.createHTML(""));o&&o(le),Od=le}},vM=C({},[...M,...q,...V]),_M=C({},[...K,...W]),jle=function(le){let Ve=Wt(le);(!Ve||!Ve.tagName)&&(Ve={namespaceURI:Pd,tagName:"template"});const lt=m(le.tagName),qn=m(Ve.tagName);return B1[le.namespaceURI]?le.namespaceURI===kv?Ve.namespaceURI===da?lt==="svg":Ve.namespaceURI===xv?lt==="svg"&&(qn==="annotation-xml"||Sv[qn]):!!vM[lt]:le.namespaceURI===xv?Ve.namespaceURI===da?lt==="math":Ve.namespaceURI===kv?lt==="math"&&Ev[qn]:!!_M[lt]:le.namespaceURI===da?Ve.namespaceURI===kv&&!Ev[qn]||Ve.namespaceURI===xv&&!Sv[qn]?!1:!_M[lt]&&(Mle[lt]||!vM[lt]):!!(op==="application/xhtml+xml"&&B1[le.namespaceURI]):!1},As=function(le){p(Te.removed,{element:le});try{Wt(le).removeChild(le)}catch{bt(le)}},Pc=function(le,Ve){try{p(Te.removed,{attribute:Ve.getAttributeNode(le),from:Ve})}catch{p(Te.removed,{attribute:null,from:Ve})}if(Ve.removeAttribute(le),le==="is")if(Bn||Qr)try{As(Ve)}catch{}else try{Ve.setAttribute(le,"")}catch{}},bM=function(le){let Ve=null,lt=null;if(sr)le="<remove></remove>"+le;else{const gr=b(le,/^[\r\n\t ]+/);lt=gr&&gr[0]}op==="application/xhtml+xml"&&Pd===da&&(le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+le+"</body></html>");const qn=At?At.createHTML(le):le;if(Pd===da)try{Ve=new rt().parseFromString(qn,op)}catch{}if(!Ve||!Ve.documentElement){Ve=kt.createDocument(Pd,"template",null);try{Ve.documentElement.innerHTML=U1?en:qn}catch{}}const ti=Ve.body||Ve.documentElement;return le&&lt&&ti.insertBefore(Ce.createTextNode(lt),ti.childNodes[0]||null),Pd===da?wn.call(Ve,xr?"html":"body")[0]:xr?Ve.documentElement:ti},yM=function(le){return It.call(le.ownerDocument||le,le,he.SHOW_ELEMENT|he.SHOW_COMMENT|he.SHOW_TEXT|he.SHOW_PROCESSING_INSTRUCTION|he.SHOW_CDATA_SECTION,null)},H1=function(le){return le instanceof Re&&(typeof le.nodeName!="string"||typeof le.textContent!="string"||typeof le.removeChild!="function"||!(le.attributes instanceof Ae)||typeof le.removeAttribute!="function"||typeof le.setAttribute!="function"||typeof le.namespaceURI!="string"||typeof le.insertBefore!="function"||typeof le.hasChildNodes!="function")},wM=function(le){return typeof Pe=="function"&&le instanceof Pe};function fa(ut,le,Ve){d(ut,lt=>{lt.call(Te,le,Ve,Od)})}const xM=function(le){let Ve=null;if(fa(St.beforeSanitizeElements,le,null),H1(le))return As(le),!0;const lt=kr(le.nodeName);if(fa(St.uponSanitizeElement,le,{tagName:lt,allowedTags:Nt}),pr&&le.hasChildNodes()&&!wM(le.firstElementChild)&&T(/<[/\w!]/g,le.innerHTML)&&T(/<[/\w!]/g,le.textContent)||le.nodeType===ye.progressingInstruction||pr&&le.nodeType===ye.comment&&T(/<[/\w]/g,le.data))return As(le),!0;if(!(xo.tagCheck instanceof Function&&xo.tagCheck(lt))&&(!Nt[lt]||xi[lt])){if(!xi[lt]&&SM(lt)&&(Ct.tagNameCheck instanceof RegExp&&T(Ct.tagNameCheck,lt)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(lt)))return!1;if(ki&&!Ts[lt]){const qn=Wt(le)||le.parentNode,ti=pn(le)||le.childNodes;if(ti&&qn){const gr=ti.length;for(let Di=gr-1;Di>=0;--Di){const ha=tt(ti[Di],!0);ha.__removalCount=(le.__removalCount||0)+1,qn.insertBefore(ha,qt(le))}}}return As(le),!0}return le instanceof Ne&&!jle(le)||(lt==="noscript"||lt==="noembed"||lt==="noframes")&&T(/<\/no(script|embed|frames)/i,le.innerHTML)?(As(le),!0):(vn&&le.nodeType===ye.text&&(Ve=le.textContent,d([gn,ct,gt],qn=>{Ve=y(Ve,qn," ")}),le.textContent!==Ve&&(p(Te.removed,{element:le.cloneNode()}),le.textContent=Ve)),fa(St.afterSanitizeElements,le,null),!1)},kM=function(le,Ve,lt){if(Mi&&(Ve==="id"||Ve==="name")&&(lt in Ce||lt in zle))return!1;if(!(Rn&&!ro[Ve]&&T(xn,Ve))){if(!(sl&&T(Un,Ve))){if(!(xo.attributeCheck instanceof Function&&xo.attributeCheck(Ve,le))){if(!Yt[Ve]||ro[Ve]){if(!(SM(le)&&(Ct.tagNameCheck instanceof RegExp&&T(Ct.tagNameCheck,le)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(le))&&(Ct.attributeNameCheck instanceof RegExp&&T(Ct.attributeNameCheck,Ve)||Ct.attributeNameCheck instanceof Function&&Ct.attributeNameCheck(Ve,le))||Ve==="is"&&Ct.allowCustomizedBuiltInElements&&(Ct.tagNameCheck instanceof RegExp&&T(Ct.tagNameCheck,lt)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(lt))))return!1}else if(!j1[Ve]){if(!T(Sn,y(lt,kn,""))){if(!((Ve==="src"||Ve==="xlink:href"||Ve==="href")&&le!=="script"&&w(lt,"data:")===0&&hM[le])){if(!(ht&&!T(Nn,y(lt,kn,"")))){if(lt)return!1}}}}}}}return!0},SM=function(le){return le!=="annotation-xml"&&b(le,mn)},EM=function(le){fa(St.beforeSanitizeAttributes,le,null);const{attributes:Ve}=le;if(!Ve||H1(le))return;const lt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Yt,forceKeepAttr:void 0};let qn=Ve.length;for(;qn--;){const ti=Ve[qn],{name:gr,namespaceURI:Di,value:ha}=ti,Ld=kr(gr),K1=ha;let Kr=gr==="value"?K1:x(K1);if(lt.attrName=Ld,lt.attrValue=Kr,lt.keepAttr=!0,lt.forceKeepAttr=void 0,fa(St.uponSanitizeAttribute,le,lt),Kr=lt.attrValue,Yn&&(Ld==="id"||Ld==="name")&&(Pc(gr,le),Kr=Hr+Kr),pr&&T(/((--!?|])>)|<\/(style|title|textarea)/i,Kr)){Pc(gr,le);continue}if(Ld==="attributename"&&b(Kr,"href")){Pc(gr,le);continue}if(lt.forceKeepAttr)continue;if(!lt.keepAttr){Pc(gr,le);continue}if(!Ot&&T(/\/>/i,Kr)){Pc(gr,le);continue}vn&&d([gn,ct,gt],TM=>{Kr=y(Kr,TM," ")});const $M=kr(le.nodeName);if(!kM($M,Ld,Kr)){Pc(gr,le);continue}if(At&&typeof Ge=="object"&&typeof Ge.getAttributeType=="function"&&!Di)switch(Ge.getAttributeType($M,Ld)){case"TrustedHTML":{Kr=At.createHTML(Kr);break}case"TrustedScriptURL":{Kr=At.createScriptURL(Kr);break}}if(Kr!==K1)try{Di?le.setAttributeNS(Di,gr,Kr):le.setAttribute(gr,Kr),H1(le)?As(le):h(Te.removed)}catch{Pc(gr,le)}}fa(St.afterSanitizeAttributes,le,null)},Ule=function ut(le){let Ve=null;const lt=yM(le);for(fa(St.beforeSanitizeShadowDOM,le,null);Ve=lt.nextNode();)fa(St.uponSanitizeShadowNode,Ve,null),xM(Ve),EM(Ve),Ve.content instanceof Ke&&ut(Ve.content);fa(St.afterSanitizeShadowDOM,le,null)};return Te.sanitize=function(ut){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ve=null,lt=null,qn=null,ti=null;if(U1=!ut,U1&&(ut="<!-->"),typeof ut!="string"&&!wM(ut))if(typeof ut.toString=="function"){if(ut=ut.toString(),typeof ut!="string")throw A("dirty is not a string, aborting")}else throw A("toString is not a function");if(!Te.isSupported)return ut;if(Yo||q1(le),Te.removed=[],typeof ut=="string"&&(ip=!1),ip){if(ut.nodeName){const ha=kr(ut.nodeName);if(!Nt[ha]||xi[ha])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(ut instanceof Pe)Ve=bM("<!---->"),lt=Ve.ownerDocument.importNode(ut,!0),lt.nodeType===ye.element&&lt.nodeName==="BODY"||lt.nodeName==="HTML"?Ve=lt:Ve.appendChild(lt);else{if(!Bn&&!vn&&!xr&&ut.indexOf("<")===-1)return At&&ei?At.createHTML(ut):ut;if(Ve=bM(ut),!Ve)return Bn?null:ei?en:""}Ve&&sr&&As(Ve.firstChild);const gr=yM(ip?ut:Ve);for(;qn=gr.nextNode();)xM(qn),EM(qn),qn.content instanceof Ke&&Ule(qn.content);if(ip)return ut;if(Bn){if(Qr)for(ti=wr.call(Ve.ownerDocument);Ve.firstChild;)ti.appendChild(Ve.firstChild);else ti=Ve;return(Yt.shadowroot||Yt.shadowrootmode)&&(ti=or.call($e,ti,!0)),ti}let Di=xr?Ve.outerHTML:Ve.innerHTML;return xr&&Nt["!doctype"]&&Ve.ownerDocument&&Ve.ownerDocument.doctype&&Ve.ownerDocument.doctype.name&&T(ge,Ve.ownerDocument.doctype.name)&&(Di="<!DOCTYPE "+Ve.ownerDocument.doctype.name+`>
140
140
  `+Di),vn&&d([gn,ct,gt],ha=>{Di=y(Di,ha," ")}),At&&ei?At.createHTML(Di):Di},Te.setConfig=function(){let ut=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};q1(ut),Yo=!0},Te.clearConfig=function(){Od=null,Yo=!1},Te.isValidAttribute=function(ut,le,Ve){Od||q1({});const lt=kr(ut),qn=kr(le);return kM(lt,qn,Ve)},Te.addHook=function(ut,le){typeof le=="function"&&p(St[ut],le)},Te.removeHook=function(ut,le){if(le!==void 0){const Ve=f(St[ut],le);return Ve===-1?void 0:g(St[ut],Ve,1)[0]}return h(St[ut])},Te.removeHooks=function(ut){St[ut]=[]},Te.removeAllHooks=function(){St=Le()},Te}var je=ze();return Ay=je,Ay}var Cy,JT;function _B(){return JT||(JT=1,Cy=self.DOMPurify||(self.DOMPurify=YT().default||YT())),Cy}var Jr=_B();function Py(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rl=Py();function XT(t){Rl=t}var Rf={exec:()=>null};function Zt(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(fi.caret,"$1"),n=n.replace(i,s),r},getRegex:()=>new RegExp(n,e)};return r}var bB=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),fi={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},yB=/^(?:[ \t]*(?:\n|$))+/,wB=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xB=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,kB=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Oy=/(?:[*+-]|\d{1,9}[.)])/,ZT=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,QT=Zt(ZT).replace(/bull/g,Oy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),SB=Zt(ZT).replace(/bull/g,Oy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ly=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,EB=/^[^\n]+/,Iy=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$B=Zt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Iy).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),TB=Zt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oy).getRegex(),$g="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ny=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,AB=Zt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ny).replace("tag",$g).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eA=Zt(Ly).replace("hr",Mf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$g).getRegex(),CB=Zt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",eA).getRegex(),Ry={blockquote:CB,code:wB,def:$B,fences:xB,heading:kB,hr:Mf,html:AB,lheading:QT,list:TB,newline:yB,paragraph:eA,table:Rf,text:EB},tA=Zt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$g).getRegex(),PB={...Ry,lheading:SB,table:tA,paragraph:Zt(Ly).replace("hr",Mf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tA).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$g).getRegex()},OB={...Ry,html:Zt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ny).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rf,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Zt(Ly).replace("hr",Mf).replace("heading",` *#{1,6} *[^
141
141
  ]`).replace("lheading",QT).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},LB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,IB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,nA=/^( {2,}|\\)\n(?!\s*$)/,NB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Tg=/[\p{P}\p{S}]/u,My=/[\s\p{P}\p{S}]/u,rA=/[^\s\p{P}\p{S}]/u,RB=Zt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,My).getRegex(),iA=/(?!~)[\p{P}\p{S}]/u,MB=/(?!~)[\s\p{P}\p{S}]/u,DB=/(?:[^\s\p{P}\p{S}]|~)/u,FB=Zt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bB?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),oA=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,zB=Zt(oA,"u").replace(/punct/g,Tg).getRegex(),jB=Zt(oA,"u").replace(/punct/g,iA).getRegex(),sA="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",UB=Zt(sA,"gu").replace(/notPunctSpace/g,rA).replace(/punctSpace/g,My).replace(/punct/g,Tg).getRegex(),BB=Zt(sA,"gu").replace(/notPunctSpace/g,DB).replace(/punctSpace/g,MB).replace(/punct/g,iA).getRegex(),qB=Zt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,rA).replace(/punctSpace/g,My).replace(/punct/g,Tg).getRegex(),HB=Zt(/\\(punct)/,"gu").replace(/punct/g,Tg).getRegex(),KB=Zt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),VB=Zt(Ny).replace("(?:-->|$)","-->").getRegex(),GB=Zt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",VB).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ag=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,WB=Zt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ag).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),aA=Zt(/^!?\[(label)\]\[(ref)\]/).replace("label",Ag).replace("ref",Iy).getRegex(),lA=Zt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Iy).getRegex(),YB=Zt("reflink|nolink(?!\\()","g").replace("reflink",aA).replace("nolink",lA).getRegex(),cA=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Dy={_backpedal:Rf,anyPunctuation:HB,autolink:KB,blockSkip:FB,br:nA,code:IB,del:Rf,emStrongLDelim:zB,emStrongRDelimAst:UB,emStrongRDelimUnd:qB,escape:LB,link:WB,nolink:lA,punctuation:RB,reflink:aA,reflinkSearch:YB,tag:GB,text:NB,url:Rf},JB={...Dy,link:Zt(/^!?\[(label)\]\((.*?)\)/).replace("label",Ag).getRegex(),reflink:Zt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ag).getRegex()},Fy={...Dy,emStrongRDelimAst:BB,emStrongLDelim:jB,url:Zt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cA).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Zt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",cA).getRegex()},XB={...Fy,br:Zt(nA).replace("{2,}","*").getRegex(),text:Zt(Fy.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Cg={normal:Ry,gfm:PB,pedantic:OB},Df={normal:Dy,gfm:Fy,breaks:XB,pedantic:JB},ZB={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},uA=t=>ZB[t];function Ys(t,e){if(e){if(fi.escapeTest.test(t))return t.replace(fi.escapeReplace,uA)}else if(fi.escapeTestNoEncode.test(t))return t.replace(fi.escapeReplaceNoEncode,uA);return t}function dA(t){try{t=encodeURI(t).replace(fi.percentDecode,"%")}catch{return null}return t}function fA(t,e){let n=t.replace(fi.findPipe,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(fi.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(fi.slashPipe,"|");return r}function Ff(t,e,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function QB(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function hA(t,e,n,r,i){let o=e.href,s=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function e4(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
142
142
  `).map(o=>{let s=o.match(n.other.beginningSpace);if(s===null)return o;let[a]=s;return a.length>=i.length?o.slice(i.length):o}).join(`
@@ -226,7 +226,7 @@ ${o}`:`[${t}]`),o&&s?`${o}
226
226
  ${s}`:o||s}function X4(t,{maxDepth:e=1e3,numbersAsFloat:n=!1}={}){if(Uf(t)!=="object")throw new TypeError("stringify can only be called with an object");let r=ew(0,t,"",e,n);return r[r.length-1]!==`
227
227
  `?r+`
228
228
  `:r}const jA={slug_length:!1,yaml_quote:!1,uuid_read_only:!1,save_all_locales:!1,automatic_deployments:!1},Z4={slug_length:"The `slug_length` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `slug.maxlength` option instead. ",yaml_quote:"The `yaml_quote` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `output.yaml.quote` option instead. `yaml_quote: true` is equivalent to `quote: double`. https://sveltiacms.app/en/docs/data-output#controlling-data-output",uuid_read_only:"The `read_only` option for the UUID field type is deprecated and will be removed in Sveltia CMS 1.0. Use the `readonly` option instead.",save_all_locales:"The `save_all_locales` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `initial_locales` option instead. `save_all_locales: false` is equivalent to `initial_locales: all`. https://sveltiacms.app/en/docs/i18n#disabling-non-default-locale-content",automatic_deployments:"The `automatic_deployments` backend option is deprecated and will be removed in Sveltia CMS 1.0. Use the `skip_ci` option instead. `automatic_deployments: false` is equivalent to `skip_ci: true`, and `automatic_deployments: true` is equivalent to `skip_ci: false`. https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments"},Bf=(t,e)=>{jA[t]||(console.warn(Z4[t]),jA[t]=!0)},UA=/\\\{\\\{.+?\\\}\\\}/g,Dg=new Map,BA=({extension:t,format:e})=>{const n=e?Dg.get(e)?.extension:void 0;return n||t||(e==="raw"?"txt":e==="yaml"||e==="yml"?"yml":e==="toml"?"toml":e==="json"?"json":"md")},Q4=({extension:t,format:e})=>e||(t==="yaml"||t==="yml"?"yaml":t==="toml"?"toml":t==="json"?"json":["md","mkd","mkdn","mdwn","mdown","markdown"].includes(t)?"frontmatter":"yaml-frontmatter"),e5=(t,e)=>{if(!t)return"(?<subPath>[^/]+?)";const n=zt(t).replace(UA,"[^/]+?"),r=e?`|${e}`:"";return`(?<subPath>${n}${r})`},t5=({extension:t,format:e,basePath:n,subPath:r,indexFileName:i,_i18n:o})=>{const{allLocales:s,defaultLocale:a,omitDefaultLocaleFromFileName:l,structureMap:{i18nMultiFile:u,i18nMultiFolder:d,i18nRootMultiFolder:f}}=o,h=`(?<locale>${s.join("|")})`,p=["^",f?`${h}\\/`:"",n?`${zt(n)}\\/`:"",d?`${h}\\/`:"",e5(r,i),u?l?`(?:\\.(?<locale>${s.filter(g=>g!==a).join("|")}))?`:`\\.${h}`:"","\\.",BA({format:e,extension:t}),"$"].join("");return new RegExp(p)},qA=({format:t,delimiter:e})=>{if(typeof e=="string"&&e.trim())return[e,e];if(Array.isArray(e)&&e.length===2)return e;if(t==="json-frontmatter")return["{","}"];if(t==="toml-frontmatter")return["+++","+++"];if(t==="yaml-frontmatter")return["---","---"]},HA=({rawCollection:t,file:e,_i18n:n})=>{const{folder:r,path:i,extension:o,format:s,frontmatter_delimiter:a,yaml_quote:l}=t,u=Qf(t),d=e?.file?nn(e.file):void 0,f=d?cn(d).extension:o,h=e?.format??s,p=BA({format:h,extension:f}),g=Q4({format:h,extension:p}),m=e?.frontmatter_delimiter??a,v=u?nn(r):void 0,b=u?Ai(t)?.name:void 0;return l!==void 0&&Bf("yaml_quote"),{extension:p,format:g,basePath:v,subPath:u?i:void 0,fullPathRegEx:v!==void 0?t5({extension:p,format:g,basePath:v,subPath:i,indexFileName:b,_i18n:n}):void 0,fullPath:d?yy({_i18n:n,locale:n.defaultLocale,path:d}):void 0,fmDelimiters:qA({format:g,delimiter:m}),yamlQuote:!!l}},KA=t=>JSON.parse(t),tw=t=>pa(V4(t)),nw=(t,e)=>mU(t,e),n5=t=>t.startsWith("+++")?"toml-frontmatter":t.startsWith("{")?"json-frontmatter":"yaml-frontmatter",r5=({collection:t,collectionFile:e,format:n,text:r})=>{const{_file:{format:i,fmDelimiters:o}}=e??t,[s,a]=(i==="frontmatter"?qA({format:n,delimiter:o}):o)??["---","---"],l=zt(s),u=zt(a),d=new RegExp(`^${l}\\n(?:(?<head>.*?)\\n)?${u}$(?:\\n(?<body>.+))?`,"ms"),{head:f,body:h}=r.match(d)?.groups??{};if(!f&&!h)return{body:r};let p={};return n==="yaml-frontmatter"&&(p=nw(f)),n==="toml-frontmatter"&&(p=tw(f)),n==="json-frontmatter"&&(p=KA(`{${f}}`)),{...p,body:h}},i5=async({text:t="",path:e,folder:{collectionName:n,fileName:r}})=>{const i=pi(n),o=i&&r?Fu(i,r):void 0;if(!i)throw new Error("Collection not found");if(r&&!o)throw new Error("Collection file not found");t=t.trim().replace(/\r\n?/g,`
229
- `);let{_file:{format:s}}=o??i;const a=Dg.get(s)?.parser;if(a)return a(t);if(s==="raw")return{body:t};try{if(s==="yaml"||s==="yml")return nw(t);if(s==="toml")return tw(t);if(s==="json")return KA(t);if(s==="frontmatter"&&(s=n5(t)),/^(?:yaml|toml|json)-frontmatter$/.test(s))return r5({collection:i,collectionFile:o,format:s,text:t})}catch(l){throw new Error(`${e} could not be parsed due to ${l.name}: ${l.message}`)}throw new Error(`${e} could not be parsed due to an unknown format: ${s}`)},VA=t=>/\/_index(?:\.[\w-]+)?\.md$/.test(t),rw=({subPath:t,subPathTemplate:e})=>{if(e?.includes("{{slug}}")){let n="",r=e;for(;r.length>0;){const o=r.indexOf("{{");if(o===-1){n+=zt(r);break}o>0&&(n+=zt(r.substring(0,o)));const s=r.indexOf("}}",o);if(s===-1){n+=zt(r);break}r.substring(o,s+2)==="{{slug}}"?n+="(.+)":n+="[^/]+",r=r.substring(s+2)}const[,i]=t.match(new RegExp(`^${n}$`))??[];if(i)return i}return t},o5=async(t,e)=>{try{return await i5(t)}catch(n){console.error(n),e.push(n);return}},s5=(t,e,n)=>{if(NA(e)){const r=e[0].name;return n?!$t(t)||!Object.values(t).every(Array.isArray)?void 0:Object.fromEntries(Object.entries(t).map(([i,o])=>[i,{[r]:o}])):Array.isArray(t)?{[r]:t}:void 0}return $t(t)?t:void 0},a5=(t,e,n,r,i)=>r?.split("/").pop()==="_index"&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(t)&&i!=="md"?!0:VA(t)?!(e||Ai(n)?.name==="_index"||r?.split("/").pop()==="_index"&&i==="md"):!1,l5=(t,e,n,r,i)=>{const{path:o,folder:{filePathMap:s}}=t;if(e){if(i){const[d,f]=Object.entries(s??{}).find(([,h])=>h===o)??[];return{subPath:f,locale:d}}return{subPath:o,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};const a=o.match(n);if(!a?.groups)return{subPath:void 0,locale:void 0};const{subPath:l,locale:u=r}=a.groups;return{subPath:l,locale:u}},c5=(t,e,n,r,i,o)=>{const s=r||rw({subPath:i,subPathTemplate:o});t.slug=s,t.locales._default={slug:s,path:n,content:$i(e)}},u5=(t,e,n,r,i,o,s)=>{const a=r||rw({subPath:i,subPathTemplate:o});t.slug=a,t.locales=Object.fromEntries(s.filter(l=>l in e).map(l=>[l,{slug:a,path:n,content:$i(e[l])}]))},d5=(t,e,n,r,i,o,s,a,l,u,d)=>{const f=u&&typeof e[u]=="string"?e[u]:void 0,h=r||rw({subPath:i,subPathTemplate:o}),p={slug:h,path:n,content:$i(e)},g=`${l}/${f??h}`,m=d.find(v=>v.id===g);return m?(m.locales[s]=p,s===a&&(m.slug=h,m.subPath=i),!0):(t.id=g,t.locales[s]=p,s===a&&(t.slug=h),!1)},f5=async({file:t,entries:e,errors:n})=>{const r=await o5(t,n);if(!r)return;const{path:i,meta:o={},folder:{collectionName:s,fileName:a}}=t,l=pi(s),u=l&&a?Fu(l,a):void 0;if(!l||a&&!u)return;const{fields:d=[],_file:{fullPathRegEx:f,subPath:h,extension:p},_i18n:{i18nEnabled:g,allLocales:m,defaultLocale:v,structureMap:{i18nSingleFile:b,i18nMultiFile:y,i18nMultiFolder:w,i18nRootMultiFolder:x},canonicalSlug:{key:S}}}=u??l,T=s5(r,d,b);if(!T||a5(i,a,l,h,p))return;const A=y||w||x,{subPath:k,locale:$}=l5(t,a,f,v,A);if(!k||A&&!$)return;const C={id:"",slug:"",subPath:k,locales:{},...o};if(!g)c5(C,T,i,a,k,h);else if(b)u5(C,T,i,a,k,h,m);else if(A&&$&&d5(C,T,i,a,k,h,$,v,s,S,e))return;e.push(C)},GA=async t=>{const e=[],n=[];return await Promise.all(t.map(r=>f5({file:r,entries:e,errors:n}))),{entries:e.filter(r=>(r.id=Wi(),!!r.slug&&!!Object.keys(r.locales).length)),errors:n}},iw=t=>{const e=[],n=[],r=[];t.forEach(o=>{const{path:s,name:a}=o;if(a.startsWith("."))CT.test(a)&&r.push({...o,type:"config"});else{const[l]=bT(s),[u]=jp(s);l&&e.push({...o,type:"entry",folder:l}),u&&!e.find(d=>d.path===s)&&!VA(s)&&n.push({...o,type:"asset",folder:u})}});const i=[...e,...n,...r];return{entryFiles:e,assetFiles:n,configFiles:r,allFiles:i,count:i.length}},h5=10*1024*1024,Du=10,WA=async(t,e,n="file")=>{const r=nn(e??"");let i=t;if(!r){if(n==="directory")return i;throw new Error("Path is required for file handle retrieval")}const o=r.split("/"),s=o.length-1,a=!0;for await(const[l,u]of o.entries())i=await(l===s&&n==="file"?i.getFileHandle(u,{create:a}):i.getDirectoryHandle(u,{create:a}));return i},YA=(t,e)=>WA(t,e,"file"),Fg=(t,e)=>WA(t,e,"directory"),JA=t=>NT(t,e=>zt(e).replace(UA,".+?")),XA=async(t,e,n="")=>{const{scanningPaths:r,scanningPathsRegEx:i,fileHandles:o,pathRegexCache:s}=e;for await(const[a,l]of t.entries()){if(a.startsWith(".")&&!CT.test(a))continue;const u=n?`${n}/${a}`:a,d=i.some(f=>f.test(u));if(l.kind==="file"&&d&&o.push({handle:l,path:u}),l.kind==="directory"){let f=s.get(u);f||(f=JA(u),s.set(u,f)),(d||r.some(h=>f.test(h)))&&await XA(l,e,u)}}},p5=()=>{const t=oe(Zb).map(({filePathMap:n,folderPathMap:r})=>Object.values(n||(r??{}))).flat(1),e=oe(Hs).filter(({internalPath:n})=>n!==void 0).map(({internalPath:n})=>n);return Su([...t,...e].map(n=>nn(n??"")))},g5=async t=>{const e=[],n=p5();return await XA(t,{scanningPaths:n,scanningPathsRegEx:n.map(JA),fileHandles:e,pathRegexCache:new Map}),e.map(({handle:r,path:i})=>({handle:r,path:i.normalize(),name:r.name.normalize(),size:0,sha:""}))},ZA=async t=>{const{name:e,handle:n}=t;if(e===".gitkeep")return t;try{const r=await n.getFile();if(r.size>h5)return console.warn(`File ${e} is too large (${r.size} bytes), skipping content read`),{...t,text:""};const i=await w3(r);return{...t,text:i}}catch(r){return console.error(r),{...t,text:""}}},m5=async t=>{const{name:e,handle:n}=t,r=$u(e);try{const i=await n.getFile(),{size:o}=i,s=await Pl(i);return{...t,kind:r,size:o,sha:s}}catch(i){return console.error(i),{...t,kind:r}}},QA=async t=>{const{entryFiles:e,assetFiles:n,configFiles:r}=iw(await g5(t)),i=[],o=[];for(let u=0;u<e.length;u+=Du){const d=e.slice(u,u+Du),f=await Promise.all(d.map(h=>ZA(h)));i.push(...f)}for(let u=0;u<r.length;u+=Du){const d=r.slice(u,u+Du),f=await Promise.all(d.map(h=>ZA(h)));o.push(...f)}const{entries:s,errors:a}=await GA(i),l=[];for(let u=0;u<n.length;u+=Du){const d=n.slice(u,u+Du),f=await Promise.all(d.map(h=>m5(h)));l.push(...f)}Ji.set(s),Wn.set(l),iy.set(o),Qb.set(a),ku.set(!0)},v5=async({rootDirHandle:t,previousPath:e,path:n})=>{const{dirname:r,basename:i}=cn(n),o=cn(e).dirname,s=await YA(t,e);return r&&r!==o?await s.move(await Fg(t,r),i):await s.move(i),s},_5=async({rootDirHandle:t,fileHandle:e,path:n,data:r})=>{e??=await YA(t,n);const i=await e.createWritable?.();try{await i?.write(r)}catch{}finally{try{await i?.close()}catch{}}return e.getFile()},b5=async(t,e)=>{for(let n=e.length;n>0;n-=1){const r=e[n-1],i=e.slice(0,n-1).join("/"),o=await Fg(t,i),s=await o.getDirectoryHandle(r);for await(const a of s.entries())return;await o.removeEntry(r)}},y5=async({rootDirHandle:t,path:e})=>{const{dirname:n="",basename:r}=cn(nn(e));await(await Fg(t,n)).removeEntry(r),n&&await b5(t,n.split("/"))},w5=async(t,{action:e,path:n,previousPath:r,data:i})=>{let o;return e==="move"&&r&&(o=await v5({rootDirHandle:t,previousPath:r,path:n})),["create","update","move"].includes(e)&&i?_5({rootDirHandle:t,fileHandle:o,path:n,data:i}):(e==="delete"&&await y5({rootDirHandle:t,path:n}),null)},eC=async(t,e)=>{const n=await Promise.all(e.map(async r=>{const{path:i,data:o}=r;let s=null;if(t)try{s=await w5(t,r)}catch(a){console.error(a)}if(!s){if(o===void 0)return null;s=dy(o)}return[i,{file:s,sha:await Pl(s)}]}));return{sha:await Pl(new Date().toJSON()),files:Object.fromEntries(n.filter(r=>!!r))}},tC="local",x5="Local Repository";let ow;const k5={service:"",label:"",owner:"",repo:"",branch:""},nC=new Proxy({},{get:(t,e)=>(ow??k5)[e]}),sw="root_dir_handle";let zg,aw;const S5=async({forceReload:t=!1,showPicker:e=!0}={})=>{if(!("showDirectoryPicker"in window))throw new Error("unsupported");let n=t?null:await zg?.get(sw)??null;if(n)if(await n.requestPermission({mode:"readwrite"})!=="granted")n=null;else try{await n.entries().next()}catch(r){n=null,console.error(r)}return!n&&e&&(n=await window.showDirectoryPicker(),n&&(await n.getDirectoryHandle(".git"),await zg?.set(sw,n))),n},E5={isGit:!1,name:tC,label:x5,repository:nC,init:()=>{const{name:t}=oe(Et).backend;ow=Wf[t]?.init?.();const{databaseName:e}=ow??{};return zg=e?new Ro(e,"file-system-handles"):null,nC},signIn:async({auto:t=!1})=>{const e=await S5({showPicker:!t});if(e)aw=e;else throw new Error("Directory handle could not be acquired");return{backendName:tC}},signOut:async()=>{await zg?.delete(sw)},fetchFiles:async()=>{await QA(aw)},commitChanges:async t=>eC(aw,t)},$5="sveltia-cms-test",rC="test-repo",T5="Test";let jg;const A5={isGit:!1,name:rC,label:T5,init:()=>{},signIn:async()=>{try{jg=await Fg(await navigator.storage.getDirectory(),$5)}catch{}return{backendName:rC}},signOut:async()=>{},fetchFiles:async()=>{jg?await QA(jg):ku.set(!0)},commitChanges:async t=>eC(jg,t)},qf="gitea",iC="Gitea / Forgejo",oC="https://gitea.com/api/v1",C5="https://gitea.com",P5="login/oauth/authorize",O5=1.24,L5=12,Fn=ot();Fn.subscribe(t=>{(async()=>{try{t?await Ti.set("sveltia-cms.user",t):t===null&&await Ti.delete("sveltia-cms.user")}catch{}})()});const Hf=async(t,e={},{responseType:n="json",refreshAccessToken:r=void 0}={})=>{let i;e.cache="no-cache",e.headers=new Headers(e.headers),n==="json"&&e.headers.set("Accept","application/json"),e.method==="POST"&&$t(e.body)&&(e.headers.set("Content-Type","application/json"),e.body=JSON.stringify(e.body));try{i=await fetch(t,e)}catch(u){throw new Error("Failed to send the request",{cause:u})}if(n==="raw")return i;const{ok:o,status:s}=i;let a;try{if(o&&n==="blob")return i.blob();if(o&&n==="text")return i.text();a=await i.json()}catch(u){throw new Error("Failed to parse the response",{cause:u})}if(o&&!(t.endsWith("/graphql")&&$t(a)&&a.errors))return a;if(s===401&&r){const[u]=e.headers.get("Authorization")?.split(" ")??["token"],{token:d}=await r();return e.headers.set("Authorization",`${u} ${d}`),Hf(t,e,{responseType:n})}if(!$t(a))throw new Error("Server responded with an error",{cause:{status:s}});let l="";throw typeof a.error=="string"&&(l=a.error),typeof a.message=="string"&&(l=a.message),Array.isArray(a.errors)&&(typeof a.errors[0]=="string"&&(l=a.errors.join(", ")),$t(a.errors[0])&&typeof a.errors[0].message=="string"&&(l=a.errors.map(u=>u.message).join(", "))),new Error("Server responded with an error",{cause:{status:s,message:l}})},zl={...{clientId:"",authScope:"",authURL:"",tokenURL:"",authScheme:"token",restBaseURL:"",graphqlBaseURL:""}},Kf={},I5=async({clientId:t,tokenURL:e,refreshToken:n})=>{let r,i="";try{r=await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",client_id:t,refresh_token:n})})}catch{}if(!r?.ok)throw new Error(oe(ce)("sign_in_error.TOKEN_REFRESH_FAILED"));return{access_token:i,refresh_token:n}=await r.json(),Fn.update(o=>o&&{...o,token:i,refreshToken:n}),{token:i,refreshToken:n}},ur=async(t,{method:e="GET",headers:n={},body:r=null,isGraphQL:i=!1,responseType:o="json",token:s=void 0,refreshToken:a=void 0}={})=>{const{clientId:l,tokenURL:u,restBaseURL:d,graphqlBaseURL:f,authScheme:h="token"}=zl,p=oe(Fn),g=i?f:d;return s??=p?.token,a??=p?.refreshToken,n.Authorization=`${h} ${s}`,Hf(`${g}${t}`,{method:e,headers:n,body:r},{responseType:o,refreshAccessToken:a?()=>I5({clientId:l,tokenURL:u,refreshToken:a}):void 0})},Na=async(t,e={})=>{t=t.replace(/\n\s*/g," "),Object.entries(Kf).forEach(([r,i])=>{t.includes(`$${r}`)&&(e[r]??=i)});const{data:n}=await ur("",{method:"POST",body:{query:t,variables:e},isGraphQL:!0});return n},N5=async({token:t,refreshToken:e})=>{const{id:n,full_name:r,login:i,email:o,avatar_url:s,html_url:a}=await ur("/user",{token:t,refreshToken:e}),l=oe(Fn);return l?.token&&l.token!==t&&(t=l.token,e=l.refreshToken),{backendName:qf,id:n,name:r,login:i,email:o,avatarURL:s,profileURL:a,token:t,refreshToken:e}},sC=ot(!1),R5=({authURL:t})=>{const{availHeight:r,availWidth:i}=window.screen,o=r/2-800/2,s=i/2-600/2;return window.open(t,"auth",`width=600,height=800,top=${o},left=${s}`)},aC=async({backendName:t,authURL:e})=>{const n=R5({authURL:e});return new Promise((r,i)=>{const o=t==="github"?setInterval(()=>{n?.closed&&(clearInterval(o),i(Object.assign(new Error("Authentication aborted"),{name:"AbortError"})))},1e3):0,s=({origin:a,data:l})=>{if(a!==new URL(e).origin||typeof l!="string")return;const u=t;if(l===`authorizing:${u}`){n?.postMessage(l,a);return}const{result:d}=l.match(`^authorization:${u}:(success|error):(?<result>.+)`)?.groups??{};let f;try{f=d?JSON.parse(d):{error:"No data"},$t(f)||(f={error:"Malformed data"})}catch{f={error:"Malformed data"}}"token"in f?r(f):i(new Error("Authentication failed",{cause:new Error(f.errorCode?oe(ce)(`sign_in_error.${f.errorCode}`,{default:f.error}):f.error)})),window.removeEventListener("message",s),clearInterval(o),n?.close()};window.addEventListener("message",s)})},M5=async({backendName:t,siteDomain:e,authURL:n,scope:r})=>{const{hostname:i}=window.location;e??=i==="localhost"?"cms.netlify.com":i;try{new URL(n).origin==="https://api.netlify.com"&&(e=new URL(`https://${e}`).hostname)}catch{}const o=new URLSearchParams({provider:t,site_id:e,scope:r});return aC({backendName:t,authURL:`${n}?${o}`})},D5=async()=>{const t=`${eb()}${eb()}`,e=btoa(await wl(t,{algorithm:"SHA-256",format:"binary"})).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return{csrfToken:Wi().replaceAll("-",""),codeVerifier:t,codeChallenge:e}},F5=async({backendName:t,clientId:e,authURL:n,scope:r})=>{const{csrfToken:i,codeVerifier:o,codeChallenge:s}=await D5(),{origin:a,pathname:l}=window.location,u=`${a}${l}`,d=new URLSearchParams({client_id:e,redirect_uri:u,response_type:"code",state:i,scope:r,code_challenge:s,code_challenge_method:"S256"});return await Ti.set("sveltia-cms.auth",{csrfToken:i,codeVerifier:o,realAuthURL:`${n}?${d}`}),await Ti.set("sveltia-cms.user",{backendName:t}),aC({backendName:t,authURL:u})},Ug=({provider:t="unknown",token:e,refreshToken:n,error:r,errorCode:i})=>{const o=r?"error":"success",s=r?{provider:t,error:r,errorCode:i}:{provider:t,token:e,refreshToken:n};window.addEventListener("message",({data:a,origin:l})=>{a===`authorizing:${t}`&&window.opener?.postMessage(`authorization:${t}:${o}:${JSON.stringify(s)}`,l)}),window.opener?.postMessage(`authorizing:${t}`,"*")},z5=async({backendName:t,clientId:e,tokenURL:n,code:r,state:i})=>{const{origin:o,pathname:s}=new URL(window.location.href),{csrfToken:a,codeVerifier:l}=await Ti.get("sveltia-cms.auth")??{},u=t,d=`${o}${s}`;if(await Ti.delete("sveltia-cms.auth"),!a||!l||i!==a)return Ug({provider:u,error:oe(ce)("sign_in_error.CSRF_DETECTED"),errorCode:"CSRF_DETECTED"});let f,h="",p="",g="";try{f=await fetch(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",client_id:e,code:r,redirect_uri:d,code_verifier:l})})}catch{}if(!f)return Ug({provider:u,error:oe(ce)("sign_in_error.TOKEN_REQUEST_FAILED"),errorCode:"TOKEN_REQUEST_FAILED"});try{({access_token:h,refresh_token:p,error:g}=await f.json())}catch{return Ug({provider:u,error:oe(ce)("sign_in_error.MALFORMED_RESPONSE"),errorCode:"MALFORMED_RESPONSE"})}return Ug({provider:u,token:h,refreshToken:p,error:g})},j5=async({backendName:t,clientId:e,tokenURL:n})=>{sC.set(!0);const{search:r}=window.location,{code:i,state:o}=Object.fromEntries(new URLSearchParams(r));if(i&&o)await z5({backendName:t,clientId:e,tokenURL:n,code:i,state:o});else{const{realAuthURL:s}=await Ti.get("sveltia-cms.auth")??{};s&&(window.location.href=s)}},U5=async({auto:t,apiConfig:e})=>{const{backend:n}=oe(Et),{name:r,site_domain:i,auth_type:o}=n,{clientId:s,authScope:a,authURL:l,tokenURL:u}=e,d={backendName:r,authURL:l,scope:a};if(r==="gitea"||o==="pkce"){const f=window.opener?.origin===window.location.origin&&window.name==="auth";return f&&await j5({backendName:r,clientId:s,tokenURL:u}),f||t?void 0:F5({...d,clientId:s})}if(!t)return M5({...d,siteDomain:i})},lw=async({options:{token:t,refreshToken:e,auto:n=!1},apiConfig:r})=>{if(!t){const i=await U5({auto:n,apiConfig:r});if(!i)return;({token:t,refreshToken:e}=i)}return{token:t,refreshToken:e}},B5=t=>{const{origin:e}=new URL(t);return`${e}/user/settings/applications`},q5=async t=>{const{token:e,refreshToken:n}=await lw({options:t,apiConfig:zl})??{};if(e)return N5({token:e,refreshToken:n})},H5=async()=>{},cw={service:"",label:"",owner:"",repo:"",branch:"",repoURL:"",treeBaseURL:"",blobBaseURL:"",isSelfHosted:!1,databaseName:""},uw=(t,e)=>`${t==="https://api.github.com"?"https://github.com":t.replace(/\/api(?:\/v\d+)?(?:\/.*)?/,"")}/${e}`,hi={...cw};let lC=null;const cC=(t,e)=>({treeBaseURL:e?`${t}/src/branch/${e}`:t,blobBaseURL:e?`${t}/src/branch/${e}`:""}),uC=async()=>{const{owner:t,repo:e}=hi;return lC??=await ur(`/repos/${t}/${e}`),lC},K5=async()=>{const{repo:t}=hi;try{const{permissions:e}=await uC();if(!e?.pull)throw new Error("Not a collaborator of the repository",{cause:new Error(oe(ce)("repository_no_access",{values:{repo:t}}))})}catch(e){throw e instanceof Error&&e.message.includes("Not a collaborator")?e:new Error("Failed to check repository access",{cause:new Error(oe(ce)("repository_not_found",{values:{repo:t}}))})}},V5=async()=>{const{repo:t,repoURL:e=""}=hi;try{const{default_branch:n}=await uC();if(!n)throw new Error("Failed to retrieve the default branch name.",{cause:new Error(oe(ce)("repository_empty",{values:{repo:t}}))});return Object.assign(hi,{branch:n},cC(e,n)),n}catch{throw new Error("Failed to retrieve the default branch name.",{cause:new Error(oe(ce)("repository_not_found",{values:{repo:t}}))})}},G5={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},dw=(t,{commitType:e="update",collection:n,skipCI:r=void 0})=>{const{commit_messages:i={},skip_ci:o,automatic_deployments:s}=oe(Et)?.backend??{},{email:a="",login:l="",name:u=""}=oe(Fn),[d=""]=t.map(m=>m.slug).filter(Boolean),[f,...h]=t.map(({path:m})=>m),p=n?Xs(n,{useSingular:!0}):"";let g=i[e]||G5[e]||"";return["create","update","delete"].includes(e)&&(g=g.replaceAll("{{slug}}",d).replaceAll("{{collection}}",p).replaceAll("{{path}}",f).replaceAll("{{author-email}}",a).replaceAll("{{author-login}}",l).replaceAll("{{author-name}}",u)),["uploadMedia","deleteMedia"].includes(e)&&(g=g.replaceAll("{{path}}",f).replaceAll("{{author-email}}",a).replaceAll("{{author-login}}",l).replaceAll("{{author-name}}",u),h.length&&(g+=` +${h.length}`)),["openAuthoring"].includes(e)&&(g=g.replaceAll("{{message}}",e).replaceAll("{{author-email}}",a).replaceAll("{{author-login}}",l).replaceAll("{{author-name}}",u)),!["delete","deleteMedia"].includes(e)&&(r??(o===!0||s===!1))&&(g=`[skip ci] ${g}`),g},W5=async()=>{const{owner:t,repo:e,branch:n}=hi;try{const{commit:{id:r,message:i}}=await ur(`/repos/${t}/${e}/branches/${n}`);return{hash:r,message:i}}catch{throw new Error("Failed to retrieve the last commit hash.",{cause:new Error(oe(ce)("branch_not_found",{values:{repo:e,branch:n}}))})}},Y5=async(t,e)=>{const{owner:n,repo:r,branch:i}=hi,o=dw(t,e),{name:s,email:a}=oe(Fn),l=new Date().toJSON(),u=await Promise.all(t.map(async({action:h,path:p,previousPath:g,previousSha:m,data:v=""})=>({operation:h==="move"?"update":h,path:p,content:await nb(v),from_path:g,sha:m}))),{commit:d,files:f}=await ur(`/repos/${n}/${r}/contents`,{method:"POST",body:{branch:i,author:{name:s,email:a},committer:{name:s,email:a},dates:{author:l,committer:l},message:o,files:u}});return{sha:d.sha,date:new Date(d.created),files:Object.fromEntries(f.map((h,p)=>[h?.path??t[p].path,{sha:h?.sha??""}]))}},dC={isForgejo:!1},J5=async()=>{const{version:t}=await ur("/version"),e=Number.parseFloat(t),n=e>10,r=n?"Forgejo":"Gitea",i=n?L5:O5;if(Object.assign(dC,{isForgejo:n}),Object.assign(hi,{label:r}),e<i)throw new Error(`Unsupported ${r} version`,{cause:new Error(oe(ce)("backend_unsupported_version",{values:{name:r,version:i}}))})},X5=async({metaDB:t,lastHash:e,cachedFileEntries:n,fetchFileList:r})=>{const i=await t.get("last_commit_hash"),o=await t.get("git_config_fetched");if(i&&i===e&&o&&n.length)return iw(n.map(([a,l])=>({path:a,name:cn(a).basename,...l})));const s=iw(await r(e));return t.set("last_commit_hash",e),t.set("git_config_fetched",!0),s},Z5=({allFiles:t,cachedFiles:e})=>{t.forEach(({sha:n,path:r},i)=>{e[r]?.sha===n&&Object.assign(t[i],e[r])})},fw=({fileInfo:t,fetchedFileMap:e})=>{const{meta:n,size:r,text:i}=e[t.path]??{};return{...t,size:t.size??r,text:t.text??i,meta:t.meta??n}},Q5=t=>{const{name:e,meta:n={},...r}=t,i=$u(e);return{...r,...n,name:e,kind:i}},fC=({entries:t,assets:e,configFiles:n,errors:r=[]})=>{Ji.set(t),Wn.set(e),iy.set(n),Qb.set(r),ku.set(!0)},eq=async({cacheDB:t,allFiles:e,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i})=>{const o=e.map(({path:a})=>a),s=Object.keys(n).filter(a=>!o.includes(a));r.length&&await t.saveEntries(Object.entries(i)),s.length&&t.deleteEntries(s)},hw=async({repository:t,fetchDefaultBranchName:e,fetchLastCommit:n,fetchFileList:r,fetchFileContents:i})=>{const{databaseName:o,branch:s}=t,a=new Ro(o,"meta"),l=new Ro(o,"file-cache"),u=await l.entries();let d=s;d||(d=await e(),t.branch=d);const{hash:f,message:h}=await n(),p=await X5({metaDB:a,lastHash:f,cachedFileEntries:u,fetchFileList:r});if(qg.set(!h.startsWith("[skip ci]")),!p.count){fC({entries:[],assets:[],configFiles:[]});return}const{entryFiles:g,assetFiles:m,configFiles:v,allFiles:b}=p,y=Object.fromEntries(u);Z5({allFiles:b,cachedFiles:y});const w=b.filter(({meta:$})=>!$),x=w.length?await i(w):{},{entries:S,errors:T}=await GA(g.map($=>fw({fileInfo:$,fetchedFileMap:x}))),A=m.map($=>Q5(fw({fileInfo:$,fetchedFileMap:x}))),k=v.map($=>fw({fileInfo:$,fetchedFileMap:x}));fC({entries:S,assets:A,configFiles:k,errors:T}),await eq({cacheDB:l,allFiles:b,cachedFiles:y,fetchingFiles:w,fetchedFileMap:x})},tq=async t=>{const{owner:e,repo:n,branch:r}=hi,i=`/repos/${e}/${n}/git/trees/${t??r}?recursive=1`,o=[];let s=1;for(;;){const{tree:a,truncated:l}=await ur(`${i}&page=${s}`);if(a&&o.push(...a),a&&l)s+=1;else break}return o.filter(({type:a})=>a==="blob").map(({path:a,sha:l,size:u})=>({path:a,sha:l,size:u,name:cn(a).basename}))},nq=async(t,e)=>{const n=await Promise.all(t.map(async({path:r,sha:i,size:o},s)=>{const a=e[s],l={sha:i,size:o??0,text:a?.content&&a.encoding==="base64"?await k3(a.content):"",meta:{}};return[r,l]}).filter(r=>!!r));return Object.fromEntries(n)},rq=async t=>{const{owner:e,repo:n,branch:r}=hi,{isForgejo:i}=dC,o=i?`/repos/${e}/${n}/git/blobs`:`/repos/${e}/${n}/file-contents?ref=${r}`,s=i?"sha":"path",a=t.filter(({type:f})=>f!=="asset").map(({[s]:f})=>f);if(!a.length)return{};const l=[],u=[...a];is.set(0);const{default_paging_num:d=30}=await ur("/settings/api");for(;;){const f=u.splice(0,d),h=await(i?ur(`${o}?shas=${f.join(",")}`):ur(o,{method:"POST",body:{files:f}}));if(l.push(...h),is.set(Math.ceil((a.length-u.length)/a.length*100)),!u.length)break}return is.set(void 0),nq(t,l)},iq=async()=>{await J5(),await K5(),await hw({repository:hi,fetchDefaultBranchName:V5,fetchLastCommit:W5,fetchFileList:tq,fetchFileContents:rq})},oq=async t=>{const{owner:e,repo:n,branch:r}=hi,{path:i}=t;return ur(`/repos/${e}/${n}/media/${r}/${encodeURI(i)}`,{responseType:"blob"})},pw="sveltia-cms.prefs",gw=ot(),dt=ot({},t=>{gw.set(void 0),(async()=>{try{const e=await Ti.get(pw)??{};e.apiKeys??={},e.useDraftBackup??=!0,e.closeOnSave??=!0,e.closeWithEscape??=!0,e.underlineLinks??=!0,e.beta??=!1,e.devModeEnabled??=!1,e.defaultTranslationService??="google",t(e)}catch{gw.set({type:"permission_denied"})}})()});dt.subscribe(t=>{if(!t||!Object.keys(t).length)return;(async()=>{try{un(t,await Ti.get(pw))||await Ti.set(pw,t)}catch{}})();const{locale:e,theme:n,underlineLinks:r=!0,beta:i=!1,devModeEnabled:o=!1}=t;e&&oe(g$).includes(e)&&Ut.set(e);const s=!n||n==="auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";Object.assign(document.documentElement.dataset,{theme:s?a:n,autoTheming:s,underlineLinks:r,beta:i,devMode:o})});const sq={isGit:!0,name:qf,label:iC,repository:hi,init:()=>{const{backend:t}=oe(Et)??{};if(t?.name!==qf)return;const{repo:e,branch:n,base_url:r=C5,auth_endpoint:i=P5,app_id:o="",api_root:s=oC}=t,[a,l]=e.split("/"),u=`${a}/${l}`,d=`${nn(r)}/${nn(i)}`,f=uw(s,u);return Object.assign(hi,{service:qf,label:iC,owner:a,repo:l,branch:n,repoURL:f,tokenPageURL:B5(f),databaseName:`${qf}:${u}`,isSelfHosted:s!==oC},cC(f,n)),Object.assign(zl,{clientId:o,authScope:"read:repository,write:repository,read:user",authURL:d,tokenURL:d.replace("/authorize","/access_token"),restBaseURL:nn(s)}),oe(dt).devModeEnabled&&console.info("repositoryInfo",hi),hi},signIn:q5,signOut:H5,fetchFiles:iq,fetchBlob:oq,commitChanges:Y5},Vf="github",hC="GitHub",Bg="https://api.github.com",aq="https://api.netlify.com",lq="auth",cq="https://github.com",uq="login/oauth/authorize",dq=t=>(t=nn(t),t===Bg||t.endsWith("/api/v3")?t:t.endsWith("/api")?`${t}/v3`:`${t}/api/v3`),fq=t=>(t=nn(t),t===Bg?`${t}/graphql`:t.endsWith("/graphql")?t:t.endsWith("/api/v3")?t.replace("/api/v3","/graphql"):t.endsWith("/api")?`${t}/graphql`:`${t}/api/graphql`),hq=async({token:t,refreshToken:e})=>{const{id:n,name:r,login:i,email:o,avatar_url:s,html_url:a}=await ur("/user",{token:t,refreshToken:e}),l=oe(Fn);return l?.token&&l.token!==t&&(t=l.token,e=l.refreshToken),{backendName:Vf,id:n,name:r,login:i,email:o,avatarURL:s,profileURL:a,token:t,refreshToken:e}},pq=t=>{const{origin:e}=new URL(t),n=new URLSearchParams({name:"Sveltia CMS",contents:"write"});return`${e}/settings/personal-access-tokens/new?${n}`},gq=async t=>{const{token:e,refreshToken:n}=await lw({options:t,apiConfig:zl})??{};if(e)return hq({token:e,refreshToken:n})},mq=async()=>{},Zi={...cw},pC=(t,e)=>({treeBaseURL:e?`${t}/tree/${e}`:t,blobBaseURL:e?`${t}/blob/${e}`:""}),vq=async()=>{const{owner:t,repo:e}=Zi,n=oe(Fn)?.login,{ok:r}=await ur(`/repos/${t}/${e}/collaborators/${encodeURIComponent(n)}`,{headers:{Accept:"application/json"},responseType:"raw"});if(!r)throw new Error("Not a collaborator of the repository",{cause:new Error(oe(ce)("repository_no_access",{values:{repo:e}}))})},_q=`
229
+ `);let{_file:{format:s}}=o??i;const a=Dg.get(s)?.parser;if(a)return a(t);if(s==="raw")return{body:t};try{if(s==="yaml"||s==="yml")return nw(t);if(s==="toml")return tw(t);if(s==="json")return KA(t);if(s==="frontmatter"&&(s=n5(t)),/^(?:yaml|toml|json)-frontmatter$/.test(s))return r5({collection:i,collectionFile:o,format:s,text:t})}catch(l){throw new Error(`${e} could not be parsed due to ${l.name}: ${l.message}`)}throw new Error(`${e} could not be parsed due to an unknown format: ${s}`)},VA=t=>/\/_index(?:\.[\w-]+)?\.md$/.test(t),rw=({subPath:t,subPathTemplate:e})=>{if(e?.includes("{{slug}}")){let n="",r=e;for(;r.length>0;){const o=r.indexOf("{{");if(o===-1){n+=zt(r);break}o>0&&(n+=zt(r.substring(0,o)));const s=r.indexOf("}}",o);if(s===-1){n+=zt(r);break}r.substring(o,s+2)==="{{slug}}"?n+="(.+)":n+="[^/]+",r=r.substring(s+2)}const[,i]=t.match(new RegExp(`^${n}$`))??[];if(i)return i}return t},o5=async(t,e)=>{try{return await i5(t)}catch(n){console.error(n),e.push(n);return}},s5=(t,e,n)=>{if(NA(e)){const r=e[0].name;return n?!$t(t)||!Object.values(t).every(Array.isArray)?void 0:Object.fromEntries(Object.entries(t).map(([i,o])=>[i,{[r]:o}])):Array.isArray(t)?{[r]:t}:void 0}return $t(t)?t:void 0},a5=(t,e,n,r,i)=>r?.split("/").pop()==="_index"&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(t)&&i!=="md"?!0:VA(t)?!(e||Ai(n)?.name==="_index"||r?.split("/").pop()==="_index"&&i==="md"):!1,l5=(t,e,n,r,i)=>{const{path:o,folder:{filePathMap:s}}=t;if(e){if(i){const[d,f]=Object.entries(s??{}).find(([,h])=>h===o)??[];return{subPath:f,locale:d}}return{subPath:o,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};const a=o.match(n);if(!a?.groups)return{subPath:void 0,locale:void 0};const{subPath:l,locale:u=r}=a.groups;return{subPath:l,locale:u}},c5=(t,e,n,r,i,o)=>{const s=r||rw({subPath:i,subPathTemplate:o});t.slug=s,t.locales._default={slug:s,path:n,content:$i(e)}},u5=(t,e,n,r,i,o,s)=>{const a=r||rw({subPath:i,subPathTemplate:o});t.slug=a,t.locales=Object.fromEntries(s.filter(l=>l in e).map(l=>[l,{slug:a,path:n,content:$i(e[l])}]))},d5=(t,e,n,r,i,o,s,a,l,u,d)=>{const f=u&&typeof e[u]=="string"?e[u]:void 0,h=r||rw({subPath:i,subPathTemplate:o}),p={slug:h,path:n,content:$i(e)},g=`${l}/${f??h}`,m=d.find(v=>v.id===g);return m?(m.locales[s]=p,s===a&&(m.slug=h,m.subPath=i),!0):(t.id=g,t.locales[s]=p,s===a&&(t.slug=h),!1)},f5=async({file:t,entries:e,errors:n})=>{const r=await o5(t,n);if(!r)return;const{path:i,meta:o={},folder:{collectionName:s,fileName:a}}=t,l=pi(s),u=l&&a?Fu(l,a):void 0;if(!l||a&&!u)return;const{fields:d=[],_file:{fullPathRegEx:f,subPath:h,extension:p},_i18n:{i18nEnabled:g,allLocales:m,defaultLocale:v,structureMap:{i18nSingleFile:b,i18nMultiFile:y,i18nMultiFolder:w,i18nRootMultiFolder:x},canonicalSlug:{key:S}}}=u??l,T=s5(r,d,b);if(!T||a5(i,a,l,h,p))return;const A=y||w||x,{subPath:k,locale:$}=l5(t,a,f,v,A);if(!k||A&&!$)return;const C={id:"",slug:"",subPath:k,locales:{},...o};if(!g)c5(C,T,i,a,k,h);else if(b)u5(C,T,i,a,k,h,m);else if(A&&$&&d5(C,T,i,a,k,h,$,v,s,S,e))return;e.push(C)},GA=async t=>{const e=[],n=[];return await Promise.all(t.map(r=>f5({file:r,entries:e,errors:n}))),{entries:e.filter(r=>(r.id=Wi(),!!r.slug&&!!Object.keys(r.locales).length)),errors:n}},iw=t=>{const e=[],n=[],r=[];t.forEach(o=>{const{path:s,name:a}=o;if(a.startsWith("."))CT.test(a)&&r.push({...o,type:"config"});else{const[l]=bT(s),[u]=jp(s);l&&e.push({...o,type:"entry",folder:l}),u&&!e.find(d=>d.path===s)&&!VA(s)&&n.push({...o,type:"asset",folder:u})}});const i=[...e,...n,...r];return{entryFiles:e,assetFiles:n,configFiles:r,allFiles:i,count:i.length}},h5=10*1024*1024,Du=10,WA=async(t,e,n="file")=>{const r=nn(e??"");let i=t;if(!r){if(n==="directory")return i;throw new Error("Path is required for file handle retrieval")}const o=r.split("/"),s=o.length-1,a=!0;for await(const[l,u]of o.entries())i=await(l===s&&n==="file"?i.getFileHandle(u,{create:a}):i.getDirectoryHandle(u,{create:a}));return i},YA=(t,e)=>WA(t,e,"file"),Fg=(t,e)=>WA(t,e,"directory"),JA=t=>t?NT(t,e=>zt(e).replace(UA,".+?")):/^.+$/,XA=async(t,e,n="")=>{const{scanningPaths:r,scanningPathsRegEx:i,fileHandles:o,pathRegexCache:s}=e;for await(const[a,l]of t.entries()){if(a.startsWith(".")&&!CT.test(a))continue;const u=n?`${n}/${a}`:a,d=i.some(f=>f.test(u));if(l.kind==="file"&&d&&o.push({handle:l,path:u}),l.kind==="directory"){let f=s.get(u);f||(f=JA(u),s.set(u,f)),(d||r.some(h=>f.test(h)))&&await XA(l,e,u)}}},p5=()=>{const t=oe(Zb).map(({filePathMap:n,folderPathMap:r})=>Object.values(n||(r??{}))).flat(1),e=oe(Hs).filter(({internalPath:n})=>n!==void 0).map(({internalPath:n})=>n);return Su([...t,...e].map(n=>nn(n??"")))},g5=async t=>{const e=[],n=p5();return await XA(t,{scanningPaths:n,scanningPathsRegEx:n.map(JA),fileHandles:e,pathRegexCache:new Map}),e.map(({handle:r,path:i})=>({handle:r,path:i.normalize(),name:r.name.normalize(),size:0,sha:""}))},ZA=async t=>{const{name:e,handle:n}=t;if(e===".gitkeep")return t;try{const r=await n.getFile();if(r.size>h5)return console.warn(`File ${e} is too large (${r.size} bytes), skipping content read`),{...t,text:""};const i=await w3(r);return{...t,text:i}}catch(r){return console.error(r),{...t,text:""}}},m5=async t=>{const{name:e,handle:n}=t,r=$u(e);try{const i=await n.getFile(),{size:o}=i,s=await Pl(i);return{...t,kind:r,size:o,sha:s}}catch(i){return console.error(i),{...t,kind:r}}},QA=async t=>{const{entryFiles:e,assetFiles:n,configFiles:r}=iw(await g5(t)),i=[],o=[];for(let u=0;u<e.length;u+=Du){const d=e.slice(u,u+Du),f=await Promise.all(d.map(h=>ZA(h)));i.push(...f)}for(let u=0;u<r.length;u+=Du){const d=r.slice(u,u+Du),f=await Promise.all(d.map(h=>ZA(h)));o.push(...f)}const{entries:s,errors:a}=await GA(i),l=[];for(let u=0;u<n.length;u+=Du){const d=n.slice(u,u+Du),f=await Promise.all(d.map(h=>m5(h)));l.push(...f)}Ji.set(s),Wn.set(l),iy.set(o),Qb.set(a),ku.set(!0)},v5=async({rootDirHandle:t,previousPath:e,path:n})=>{const{dirname:r,basename:i}=cn(n),o=cn(e).dirname,s=await YA(t,e);return r&&r!==o?await s.move(await Fg(t,r),i):await s.move(i),s},_5=async({rootDirHandle:t,fileHandle:e,path:n,data:r})=>{e??=await YA(t,n);const i=await e.createWritable?.();try{await i?.write(r)}catch{}finally{try{await i?.close()}catch{}}return e.getFile()},b5=async(t,e)=>{for(let n=e.length;n>0;n-=1){const r=e[n-1],i=e.slice(0,n-1).join("/"),o=await Fg(t,i),s=await o.getDirectoryHandle(r);for await(const a of s.entries())return;await o.removeEntry(r)}},y5=async({rootDirHandle:t,path:e})=>{const{dirname:n="",basename:r}=cn(nn(e));await(await Fg(t,n)).removeEntry(r),n&&await b5(t,n.split("/"))},w5=async(t,{action:e,path:n,previousPath:r,data:i})=>{let o;return e==="move"&&r&&(o=await v5({rootDirHandle:t,previousPath:r,path:n})),["create","update","move"].includes(e)&&i?_5({rootDirHandle:t,fileHandle:o,path:n,data:i}):(e==="delete"&&await y5({rootDirHandle:t,path:n}),null)},eC=async(t,e)=>{const n=await Promise.all(e.map(async r=>{const{path:i,data:o}=r;let s=null;if(t)try{s=await w5(t,r)}catch(a){console.error(a)}if(!s){if(o===void 0)return null;s=dy(o)}return[i,{file:s,sha:await Pl(s)}]}));return{sha:await Pl(new Date().toJSON()),files:Object.fromEntries(n.filter(r=>!!r))}},tC="local",x5="Local Repository";let ow;const k5={service:"",label:"",owner:"",repo:"",branch:""},nC=new Proxy({},{get:(t,e)=>(ow??k5)[e]}),sw="root_dir_handle";let zg,aw;const S5=async({forceReload:t=!1,showPicker:e=!0}={})=>{if(!("showDirectoryPicker"in window))throw new Error("unsupported");let n=t?null:await zg?.get(sw)??null;if(n)if(await n.requestPermission({mode:"readwrite"})!=="granted")n=null;else try{await n.entries().next()}catch(r){n=null,console.error(r)}return!n&&e&&(n=await window.showDirectoryPicker(),n&&(await n.getDirectoryHandle(".git"),await zg?.set(sw,n))),n},E5={isGit:!1,name:tC,label:x5,repository:nC,init:()=>{const{name:t}=oe(Et).backend;ow=Wf[t]?.init?.();const{databaseName:e}=ow??{};return zg=e?new Ro(e,"file-system-handles"):null,nC},signIn:async({auto:t=!1})=>{const e=await S5({showPicker:!t});if(e)aw=e;else throw new Error("Directory handle could not be acquired");return{backendName:tC}},signOut:async()=>{await zg?.delete(sw)},fetchFiles:async()=>{await QA(aw)},commitChanges:async t=>eC(aw,t)},$5="sveltia-cms-test",rC="test-repo",T5="Test";let jg;const A5={isGit:!1,name:rC,label:T5,init:()=>{},signIn:async()=>{try{jg=await Fg(await navigator.storage.getDirectory(),$5)}catch{}return{backendName:rC}},signOut:async()=>{},fetchFiles:async()=>{jg?await QA(jg):ku.set(!0)},commitChanges:async t=>eC(jg,t)},qf="gitea",iC="Gitea / Forgejo",oC="https://gitea.com/api/v1",C5="https://gitea.com",P5="login/oauth/authorize",O5=1.24,L5=12,Fn=ot();Fn.subscribe(t=>{(async()=>{try{t?await Ti.set("sveltia-cms.user",t):t===null&&await Ti.delete("sveltia-cms.user")}catch{}})()});const Hf=async(t,e={},{responseType:n="json",refreshAccessToken:r=void 0}={})=>{let i;e.cache="no-cache",e.headers=new Headers(e.headers),n==="json"&&e.headers.set("Accept","application/json"),e.method==="POST"&&$t(e.body)&&(e.headers.set("Content-Type","application/json"),e.body=JSON.stringify(e.body));try{i=await fetch(t,e)}catch(u){throw new Error("Failed to send the request",{cause:u})}if(n==="raw")return i;const{ok:o,status:s}=i;let a;try{if(o&&n==="blob")return i.blob();if(o&&n==="text")return i.text();a=await i.json()}catch(u){throw new Error("Failed to parse the response",{cause:u})}if(o&&!(t.endsWith("/graphql")&&$t(a)&&a.errors))return a;if(s===401&&r){const[u]=e.headers.get("Authorization")?.split(" ")??["token"],{token:d}=await r();return e.headers.set("Authorization",`${u} ${d}`),Hf(t,e,{responseType:n})}if(!$t(a))throw new Error("Server responded with an error",{cause:{status:s}});let l="";throw typeof a.error=="string"&&(l=a.error),typeof a.message=="string"&&(l=a.message),Array.isArray(a.errors)&&(typeof a.errors[0]=="string"&&(l=a.errors.join(", ")),$t(a.errors[0])&&typeof a.errors[0].message=="string"&&(l=a.errors.map(u=>u.message).join(", "))),new Error("Server responded with an error",{cause:{status:s,message:l}})},zl={...{clientId:"",authScope:"",authURL:"",tokenURL:"",authScheme:"token",restBaseURL:"",graphqlBaseURL:""}},Kf={},I5=async({clientId:t,tokenURL:e,refreshToken:n})=>{let r,i="";try{r=await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",client_id:t,refresh_token:n})})}catch{}if(!r?.ok)throw new Error(oe(ce)("sign_in_error.TOKEN_REFRESH_FAILED"));return{access_token:i,refresh_token:n}=await r.json(),Fn.update(o=>o&&{...o,token:i,refreshToken:n}),{token:i,refreshToken:n}},ur=async(t,{method:e="GET",headers:n={},body:r=null,isGraphQL:i=!1,responseType:o="json",token:s=void 0,refreshToken:a=void 0}={})=>{const{clientId:l,tokenURL:u,restBaseURL:d,graphqlBaseURL:f,authScheme:h="token"}=zl,p=oe(Fn),g=i?f:d;return s??=p?.token,a??=p?.refreshToken,n.Authorization=`${h} ${s}`,Hf(`${g}${t}`,{method:e,headers:n,body:r},{responseType:o,refreshAccessToken:a?()=>I5({clientId:l,tokenURL:u,refreshToken:a}):void 0})},Na=async(t,e={})=>{t=t.replace(/\n\s*/g," "),Object.entries(Kf).forEach(([r,i])=>{t.includes(`$${r}`)&&(e[r]??=i)});const{data:n}=await ur("",{method:"POST",body:{query:t,variables:e},isGraphQL:!0});return n},N5=async({token:t,refreshToken:e})=>{const{id:n,full_name:r,login:i,email:o,avatar_url:s,html_url:a}=await ur("/user",{token:t,refreshToken:e}),l=oe(Fn);return l?.token&&l.token!==t&&(t=l.token,e=l.refreshToken),{backendName:qf,id:n,name:r,login:i,email:o,avatarURL:s,profileURL:a,token:t,refreshToken:e}},sC=ot(!1),R5=({authURL:t})=>{const{availHeight:r,availWidth:i}=window.screen,o=r/2-800/2,s=i/2-600/2;return window.open(t,"auth",`width=600,height=800,top=${o},left=${s}`)},aC=async({backendName:t,authURL:e})=>{const n=R5({authURL:e});return new Promise((r,i)=>{const o=t==="github"?setInterval(()=>{n?.closed&&(clearInterval(o),i(Object.assign(new Error("Authentication aborted"),{name:"AbortError"})))},1e3):0,s=({origin:a,data:l})=>{if(a!==new URL(e).origin||typeof l!="string")return;const u=t;if(l===`authorizing:${u}`){n?.postMessage(l,a);return}const{result:d}=l.match(`^authorization:${u}:(success|error):(?<result>.+)`)?.groups??{};let f;try{f=d?JSON.parse(d):{error:"No data"},$t(f)||(f={error:"Malformed data"})}catch{f={error:"Malformed data"}}"token"in f?r(f):i(new Error("Authentication failed",{cause:new Error(f.errorCode?oe(ce)(`sign_in_error.${f.errorCode}`,{default:f.error}):f.error)})),window.removeEventListener("message",s),clearInterval(o),n?.close()};window.addEventListener("message",s)})},M5=async({backendName:t,siteDomain:e,authURL:n,scope:r})=>{const{hostname:i}=window.location;e??=i==="localhost"?"cms.netlify.com":i;try{new URL(n).origin==="https://api.netlify.com"&&(e=new URL(`https://${e}`).hostname)}catch{}const o=new URLSearchParams({provider:t,site_id:e,scope:r});return aC({backendName:t,authURL:`${n}?${o}`})},D5=async()=>{const t=`${eb()}${eb()}`,e=btoa(await wl(t,{algorithm:"SHA-256",format:"binary"})).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return{csrfToken:Wi().replaceAll("-",""),codeVerifier:t,codeChallenge:e}},F5=async({backendName:t,clientId:e,authURL:n,scope:r})=>{const{csrfToken:i,codeVerifier:o,codeChallenge:s}=await D5(),{origin:a,pathname:l}=window.location,u=`${a}${l}`,d=new URLSearchParams({client_id:e,redirect_uri:u,response_type:"code",state:i,scope:r,code_challenge:s,code_challenge_method:"S256"});return await Ti.set("sveltia-cms.auth",{csrfToken:i,codeVerifier:o,realAuthURL:`${n}?${d}`}),await Ti.set("sveltia-cms.user",{backendName:t}),aC({backendName:t,authURL:u})},Ug=({provider:t="unknown",token:e,refreshToken:n,error:r,errorCode:i})=>{const o=r?"error":"success",s=r?{provider:t,error:r,errorCode:i}:{provider:t,token:e,refreshToken:n};window.addEventListener("message",({data:a,origin:l})=>{a===`authorizing:${t}`&&window.opener?.postMessage(`authorization:${t}:${o}:${JSON.stringify(s)}`,l)}),window.opener?.postMessage(`authorizing:${t}`,"*")},z5=async({backendName:t,clientId:e,tokenURL:n,code:r,state:i})=>{const{origin:o,pathname:s}=new URL(window.location.href),{csrfToken:a,codeVerifier:l}=await Ti.get("sveltia-cms.auth")??{},u=t,d=`${o}${s}`;if(await Ti.delete("sveltia-cms.auth"),!a||!l||i!==a)return Ug({provider:u,error:oe(ce)("sign_in_error.CSRF_DETECTED"),errorCode:"CSRF_DETECTED"});let f,h="",p="",g="";try{f=await fetch(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",client_id:e,code:r,redirect_uri:d,code_verifier:l})})}catch{}if(!f)return Ug({provider:u,error:oe(ce)("sign_in_error.TOKEN_REQUEST_FAILED"),errorCode:"TOKEN_REQUEST_FAILED"});try{({access_token:h,refresh_token:p,error:g}=await f.json())}catch{return Ug({provider:u,error:oe(ce)("sign_in_error.MALFORMED_RESPONSE"),errorCode:"MALFORMED_RESPONSE"})}return Ug({provider:u,token:h,refreshToken:p,error:g})},j5=async({backendName:t,clientId:e,tokenURL:n})=>{sC.set(!0);const{search:r}=window.location,{code:i,state:o}=Object.fromEntries(new URLSearchParams(r));if(i&&o)await z5({backendName:t,clientId:e,tokenURL:n,code:i,state:o});else{const{realAuthURL:s}=await Ti.get("sveltia-cms.auth")??{};s&&(window.location.href=s)}},U5=async({auto:t,apiConfig:e})=>{const{backend:n}=oe(Et),{name:r,site_domain:i,auth_type:o}=n,{clientId:s,authScope:a,authURL:l,tokenURL:u}=e,d={backendName:r,authURL:l,scope:a};if(r==="gitea"||o==="pkce"){const f=window.opener?.origin===window.location.origin&&window.name==="auth";return f&&await j5({backendName:r,clientId:s,tokenURL:u}),f||t?void 0:F5({...d,clientId:s})}if(!t)return M5({...d,siteDomain:i})},lw=async({options:{token:t,refreshToken:e,auto:n=!1},apiConfig:r})=>{if(!t){const i=await U5({auto:n,apiConfig:r});if(!i)return;({token:t,refreshToken:e}=i)}return{token:t,refreshToken:e}},B5=t=>{const{origin:e}=new URL(t);return`${e}/user/settings/applications`},q5=async t=>{const{token:e,refreshToken:n}=await lw({options:t,apiConfig:zl})??{};if(e)return N5({token:e,refreshToken:n})},H5=async()=>{},cw={service:"",label:"",owner:"",repo:"",branch:"",repoURL:"",treeBaseURL:"",blobBaseURL:"",isSelfHosted:!1,databaseName:""},uw=(t,e)=>`${t==="https://api.github.com"?"https://github.com":t.replace(/\/api(?:\/v\d+)?(?:\/.*)?/,"")}/${e}`,hi={...cw};let lC=null;const cC=(t,e)=>({treeBaseURL:e?`${t}/src/branch/${e}`:t,blobBaseURL:e?`${t}/src/branch/${e}`:""}),uC=async()=>{const{owner:t,repo:e}=hi;return lC??=await ur(`/repos/${t}/${e}`),lC},K5=async()=>{const{repo:t}=hi;try{const{permissions:e}=await uC();if(!e?.pull)throw new Error("Not a collaborator of the repository",{cause:new Error(oe(ce)("repository_no_access",{values:{repo:t}}))})}catch(e){throw e instanceof Error&&e.message.includes("Not a collaborator")?e:new Error("Failed to check repository access",{cause:new Error(oe(ce)("repository_not_found",{values:{repo:t}}))})}},V5=async()=>{const{repo:t,repoURL:e=""}=hi;try{const{default_branch:n}=await uC();if(!n)throw new Error("Failed to retrieve the default branch name.",{cause:new Error(oe(ce)("repository_empty",{values:{repo:t}}))});return Object.assign(hi,{branch:n},cC(e,n)),n}catch{throw new Error("Failed to retrieve the default branch name.",{cause:new Error(oe(ce)("repository_not_found",{values:{repo:t}}))})}},G5={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},dw=(t,{commitType:e="update",collection:n,skipCI:r=void 0})=>{const{commit_messages:i={},skip_ci:o,automatic_deployments:s}=oe(Et)?.backend??{},{email:a="",login:l="",name:u=""}=oe(Fn),[d=""]=t.map(m=>m.slug).filter(Boolean),[f,...h]=t.map(({path:m})=>m),p=n?Xs(n,{useSingular:!0}):"";let g=i[e]||G5[e]||"";return["create","update","delete"].includes(e)&&(g=g.replaceAll("{{slug}}",d).replaceAll("{{collection}}",p).replaceAll("{{path}}",f).replaceAll("{{author-email}}",a).replaceAll("{{author-login}}",l).replaceAll("{{author-name}}",u)),["uploadMedia","deleteMedia"].includes(e)&&(g=g.replaceAll("{{path}}",f).replaceAll("{{author-email}}",a).replaceAll("{{author-login}}",l).replaceAll("{{author-name}}",u),h.length&&(g+=` +${h.length}`)),["openAuthoring"].includes(e)&&(g=g.replaceAll("{{message}}",e).replaceAll("{{author-email}}",a).replaceAll("{{author-login}}",l).replaceAll("{{author-name}}",u)),!["delete","deleteMedia"].includes(e)&&(r??(o===!0||s===!1))&&(g=`[skip ci] ${g}`),g},W5=async()=>{const{owner:t,repo:e,branch:n}=hi;try{const{commit:{id:r,message:i}}=await ur(`/repos/${t}/${e}/branches/${n}`);return{hash:r,message:i}}catch{throw new Error("Failed to retrieve the last commit hash.",{cause:new Error(oe(ce)("branch_not_found",{values:{repo:e,branch:n}}))})}},Y5=async(t,e)=>{const{owner:n,repo:r,branch:i}=hi,o=dw(t,e),{name:s,email:a}=oe(Fn),l=new Date().toJSON(),u=await Promise.all(t.map(async({action:h,path:p,previousPath:g,previousSha:m,data:v=""})=>({operation:h==="move"?"update":h,path:p,content:await nb(v),from_path:g,sha:m}))),{commit:d,files:f}=await ur(`/repos/${n}/${r}/contents`,{method:"POST",body:{branch:i,author:{name:s,email:a},committer:{name:s,email:a},dates:{author:l,committer:l},message:o,files:u}});return{sha:d.sha,date:new Date(d.created),files:Object.fromEntries(f.map((h,p)=>[h?.path??t[p].path,{sha:h?.sha??""}]))}},dC={isForgejo:!1},J5=async()=>{const{version:t}=await ur("/version"),e=Number.parseFloat(t),n=e>10,r=n?"Forgejo":"Gitea",i=n?L5:O5;if(Object.assign(dC,{isForgejo:n}),Object.assign(hi,{label:r}),e<i)throw new Error(`Unsupported ${r} version`,{cause:new Error(oe(ce)("backend_unsupported_version",{values:{name:r,version:i}}))})},X5=async({metaDB:t,lastHash:e,cachedFileEntries:n,fetchFileList:r})=>{const i=await t.get("last_commit_hash"),o=await t.get("git_config_fetched");if(i&&i===e&&o&&n.length)return iw(n.map(([a,l])=>({path:a,name:cn(a).basename,...l})));const s=iw(await r(e));return t.set("last_commit_hash",e),t.set("git_config_fetched",!0),s},Z5=({allFiles:t,cachedFiles:e})=>{t.forEach(({sha:n,path:r},i)=>{e[r]?.sha===n&&Object.assign(t[i],e[r])})},fw=({fileInfo:t,fetchedFileMap:e})=>{const{meta:n,size:r,text:i}=e[t.path]??{};return{...t,size:t.size??r,text:t.text??i,meta:t.meta??n}},Q5=t=>{const{name:e,meta:n={},...r}=t,i=$u(e);return{...r,...n,name:e,kind:i}},fC=({entries:t,assets:e,configFiles:n,errors:r=[]})=>{Ji.set(t),Wn.set(e),iy.set(n),Qb.set(r),ku.set(!0)},eq=async({cacheDB:t,allFiles:e,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i})=>{const o=e.map(({path:a})=>a),s=Object.keys(n).filter(a=>!o.includes(a));r.length&&await t.saveEntries(Object.entries(i)),s.length&&t.deleteEntries(s)},hw=async({repository:t,fetchDefaultBranchName:e,fetchLastCommit:n,fetchFileList:r,fetchFileContents:i})=>{const{databaseName:o,branch:s}=t,a=new Ro(o,"meta"),l=new Ro(o,"file-cache"),u=await l.entries();let d=s;d||(d=await e(),t.branch=d);const{hash:f,message:h}=await n(),p=await X5({metaDB:a,lastHash:f,cachedFileEntries:u,fetchFileList:r});if(qg.set(!h.startsWith("[skip ci]")),!p.count){fC({entries:[],assets:[],configFiles:[]});return}const{entryFiles:g,assetFiles:m,configFiles:v,allFiles:b}=p,y=Object.fromEntries(u);Z5({allFiles:b,cachedFiles:y});const w=b.filter(({meta:$})=>!$),x=w.length?await i(w):{},{entries:S,errors:T}=await GA(g.map($=>fw({fileInfo:$,fetchedFileMap:x}))),A=m.map($=>Q5(fw({fileInfo:$,fetchedFileMap:x}))),k=v.map($=>fw({fileInfo:$,fetchedFileMap:x}));fC({entries:S,assets:A,configFiles:k,errors:T}),await eq({cacheDB:l,allFiles:b,cachedFiles:y,fetchingFiles:w,fetchedFileMap:x})},tq=async t=>{const{owner:e,repo:n,branch:r}=hi,i=`/repos/${e}/${n}/git/trees/${t??r}?recursive=1`,o=[];let s=1;for(;;){const{tree:a,truncated:l}=await ur(`${i}&page=${s}`);if(a&&o.push(...a),a&&l)s+=1;else break}return o.filter(({type:a})=>a==="blob").map(({path:a,sha:l,size:u})=>({path:a,sha:l,size:u,name:cn(a).basename}))},nq=async(t,e)=>{const n=await Promise.all(t.map(async({path:r,sha:i,size:o},s)=>{const a=e[s],l={sha:i,size:o??0,text:a?.content&&a.encoding==="base64"?await k3(a.content):"",meta:{}};return[r,l]}).filter(r=>!!r));return Object.fromEntries(n)},rq=async t=>{const{owner:e,repo:n,branch:r}=hi,{isForgejo:i}=dC,o=i?`/repos/${e}/${n}/git/blobs`:`/repos/${e}/${n}/file-contents?ref=${r}`,s=i?"sha":"path",a=t.filter(({type:f})=>f!=="asset").map(({[s]:f})=>f);if(!a.length)return{};const l=[],u=[...a];is.set(0);const{default_paging_num:d=30}=await ur("/settings/api");for(;;){const f=u.splice(0,d),h=await(i?ur(`${o}?shas=${f.join(",")}`):ur(o,{method:"POST",body:{files:f}}));if(l.push(...h),is.set(Math.ceil((a.length-u.length)/a.length*100)),!u.length)break}return is.set(void 0),nq(t,l)},iq=async()=>{await J5(),await K5(),await hw({repository:hi,fetchDefaultBranchName:V5,fetchLastCommit:W5,fetchFileList:tq,fetchFileContents:rq})},oq=async t=>{const{owner:e,repo:n,branch:r}=hi,{path:i}=t;return ur(`/repos/${e}/${n}/media/${r}/${encodeURI(i)}`,{responseType:"blob"})},pw="sveltia-cms.prefs",gw=ot(),dt=ot({},t=>{gw.set(void 0),(async()=>{try{const e=await Ti.get(pw)??{};e.apiKeys??={},e.useDraftBackup??=!0,e.closeOnSave??=!0,e.closeWithEscape??=!0,e.underlineLinks??=!0,e.beta??=!1,e.devModeEnabled??=!1,e.defaultTranslationService??="google",t(e)}catch{gw.set({type:"permission_denied"})}})()});dt.subscribe(t=>{if(!t||!Object.keys(t).length)return;(async()=>{try{un(t,await Ti.get(pw))||await Ti.set(pw,t)}catch{}})();const{locale:e,theme:n,underlineLinks:r=!0,beta:i=!1,devModeEnabled:o=!1}=t;e&&oe(g$).includes(e)&&Ut.set(e);const s=!n||n==="auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";Object.assign(document.documentElement.dataset,{theme:s?a:n,autoTheming:s,underlineLinks:r,beta:i,devMode:o})});const sq={isGit:!0,name:qf,label:iC,repository:hi,init:()=>{const{backend:t}=oe(Et)??{};if(t?.name!==qf)return;const{repo:e,branch:n,base_url:r=C5,auth_endpoint:i=P5,app_id:o="",api_root:s=oC}=t,[a,l]=e.split("/"),u=`${a}/${l}`,d=`${nn(r)}/${nn(i)}`,f=uw(s,u);return Object.assign(hi,{service:qf,label:iC,owner:a,repo:l,branch:n,repoURL:f,tokenPageURL:B5(f),databaseName:`${qf}:${u}`,isSelfHosted:s!==oC},cC(f,n)),Object.assign(zl,{clientId:o,authScope:"read:repository,write:repository,read:user",authURL:d,tokenURL:d.replace("/authorize","/access_token"),restBaseURL:nn(s)}),oe(dt).devModeEnabled&&console.info("repositoryInfo",hi),hi},signIn:q5,signOut:H5,fetchFiles:iq,fetchBlob:oq,commitChanges:Y5},Vf="github",hC="GitHub",Bg="https://api.github.com",aq="https://api.netlify.com",lq="auth",cq="https://github.com",uq="login/oauth/authorize",dq=t=>(t=nn(t),t===Bg||t.endsWith("/api/v3")?t:t.endsWith("/api")?`${t}/v3`:`${t}/api/v3`),fq=t=>(t=nn(t),t===Bg?`${t}/graphql`:t.endsWith("/graphql")?t:t.endsWith("/api/v3")?t.replace("/api/v3","/graphql"):t.endsWith("/api")?`${t}/graphql`:`${t}/api/graphql`),hq=async({token:t,refreshToken:e})=>{const{id:n,name:r,login:i,email:o,avatar_url:s,html_url:a}=await ur("/user",{token:t,refreshToken:e}),l=oe(Fn);return l?.token&&l.token!==t&&(t=l.token,e=l.refreshToken),{backendName:Vf,id:n,name:r,login:i,email:o,avatarURL:s,profileURL:a,token:t,refreshToken:e}},pq=t=>{const{origin:e}=new URL(t),n=new URLSearchParams({name:"Sveltia CMS",contents:"write"});return`${e}/settings/personal-access-tokens/new?${n}`},gq=async t=>{const{token:e,refreshToken:n}=await lw({options:t,apiConfig:zl})??{};if(e)return hq({token:e,refreshToken:n})},mq=async()=>{},Zi={...cw},pC=(t,e)=>({treeBaseURL:e?`${t}/tree/${e}`:t,blobBaseURL:e?`${t}/blob/${e}`:""}),vq=async()=>{const{owner:t,repo:e}=Zi,n=oe(Fn)?.login,{ok:r}=await ur(`/repos/${t}/${e}/collaborators/${encodeURIComponent(n)}`,{headers:{Accept:"application/json"},responseType:"raw"});if(!r)throw new Error("Not a collaborator of the repository",{cause:new Error(oe(ce)("repository_no_access",{values:{repo:e}}))})},_q=`
230
230
  query($owner: String!, $repo: String!) {
231
231
  repository(owner: $owner, name: $repo) {
232
232
  defaultBranchRef {